summaryrefslogtreecommitdiff
path: root/modules/comment
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2006-01-08 00:29:37 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2006-01-08 00:29:37 +0000
commit49e5e1cd4786ea29831166074467c85b5a946f0f (patch)
treebcd5534d0db2e23c050c206bcc10a151740c99cd /modules/comment
parent86d35db26329e19007447ff765fa049e4a16ccd9 (diff)
downloadbrdo-49e5e1cd4786ea29831166074467c85b5a946f0f.tar.gz
brdo-49e5e1cd4786ea29831166074467c85b5a946f0f.tar.bz2
- #43097: restore admin/comment tablesort
Diffstat (limited to 'modules/comment')
-rw-r--r--modules/comment/comment.module13
1 files changed, 9 insertions, 4 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 70031f3db..c54a6ce89 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -1062,7 +1062,14 @@ function comment_admin_overview($type = 'new') {
// load the comments that we want to display
$status = ($type == 'approval') ? COMMENT_NOT_PUBLISHED : COMMENT_PUBLISHED;
- $result = pager_query('SELECT c.subject, c.nid, c.cid, c.comment, c.timestamp, c.status, c.name, c.homepage, u.name AS registered_name, u.uid FROM {comments} c INNER JOIN {users} u ON u.uid = c.uid WHERE c.status = '. $status);
+ $form['header'] = array('#type' => 'value', '#value' => array(
+ NULL,
+ array('data' => t('Subject'), 'field' => 'subject'),
+ array('data' => t('Author'), 'field' => 'name'),
+ array('data' => t('Time'), 'field' => 'timestamp', 'sort' => 'desc'),
+ array('data' => t('Operations'))
+ ));
+ $result = pager_query('SELECT c.subject, c.nid, c.cid, c.comment, c.timestamp, c.status, c.name, c.homepage, u.name AS registered_name, u.uid FROM {comments} c INNER JOIN {users} u ON u.uid = c.uid WHERE c.status = %d'. tablesort_sql($form['header']['#value']), 50, 0, NULL, $status);
// build a table listing the appropriate comments
$destination = drupal_get_destination();
@@ -1119,8 +1126,6 @@ function comment_admin_overview_submit($form_id, $edit) {
}
function theme_comment_admin_overview($form) {
- $header = array(NULL, t('Subject'), t('Author'), t('Time'), t('Operations'));
-
$output = form_render($form['options']);
if (isset($form['subject']) && is_array($form['subject'])) {
foreach (element_children($form['subject']) as $key) {
@@ -1137,7 +1142,7 @@ function theme_comment_admin_overview($form) {
$rows[] = array(array('data' => t('No comments available.'), 'colspan' => '6'));
}
- $output .= theme('table', $header, $rows);
+ $output .= theme('table', $form['header']['#value'], $rows);
if ($form['pager']['#value']) {
$output .= form_render($form['pager']);
}