Skip to content
Snippets Groups Projects
Commit 49e5e1cd authored by Steven Wittens's avatar Steven Wittens
Browse files

- #43097: restore admin/comment tablesort

parent 86d35db2
No related branches found
No related tags found
No related merge requests found
......@@ -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']);
}
......
......@@ -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']);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment