Commit 67e68fc6 authored by Dries's avatar Dries

- Patch #28786 by Neil: move pagers out of table.

parent e4ec9ad3
......@@ -1065,12 +1065,9 @@ function _locale_string_seek() {
}
}
if ($pager = theme('pager', NULL, 50, 0, $request)) {
$rows[] = array(array('data' => "$pager", 'colspan' => '5'));
}
$output .= theme('table', $header, $rows);
$output .= theme('pager', NULL, 50, 0, $request);
}
return $output;
......
......@@ -1004,9 +1004,7 @@ function _aggregator_page_list($sql, $op, $header = '') {
}
$output .= '</div>';
if ($pager = theme('pager', NULL, 20, 0)) {
$output .= $pager;
}
$output .= theme('pager', NULL, 20, 0);
// arg(1) is undefined if we are at the top aggregator URL
// is there a better way to do this?
......
......@@ -1004,9 +1004,7 @@ function _aggregator_page_list($sql, $op, $header = '') {
}
$output .= '</div>';
if ($pager = theme('pager', NULL, 20, 0)) {
$output .= $pager;
}
$output .= theme('pager', NULL, 20, 0);
// arg(1) is undefined if we are at the top aggregator URL
// is there a better way to do this?
......
......@@ -938,9 +938,7 @@ function comment_render($node, $cid = 0) {
// Use the standard pager; $pager_total is the number of returned rows,
// is global and defined in pager.inc.
if ($pager = theme('pager', NULL, $comments_per_page, 0, array('comments_per_page' => $comments_per_page))) {
$output .= $pager;
}
$output .= theme('pager', NULL, $comments_per_page, 0, array('comments_per_page' => $comments_per_page));
if (db_num_rows($result) && comment_user_can_moderate($node)) {
$output .= '<div id="comment-moderation-button">'. form_submit(t('Moderate comments')) .'</div>';
......
......@@ -938,9 +938,7 @@ function comment_render($node, $cid = 0) {
// Use the standard pager; $pager_total is the number of returned rows,
// is global and defined in pager.inc.
if ($pager = theme('pager', NULL, $comments_per_page, 0, array('comments_per_page' => $comments_per_page))) {
$output .= $pager;
}
$output .= theme('pager', NULL, $comments_per_page, 0, array('comments_per_page' => $comments_per_page));
if (db_num_rows($result) && comment_user_can_moderate($node)) {
$output .= '<div id="comment-moderation-button">'. form_submit(t('Moderate comments')) .'</div>';
......
......@@ -951,13 +951,10 @@ function theme_forum_topic_list($tid, $topics, $sortby, $forum_per_page) {
);
}
}
if ($pager = theme('pager', NULL, $forum_per_page, 0, tablesort_pager())) {
$rows[] = array(array('data' => $pager, 'colspan' => '5', 'class' => 'pager'));
}
}
$output .= theme('table', $forum_topic_list_header, $rows);
$output .= theme('pager', NULL, $forum_per_page, 0, tablesort_pager());
return $output;
}
......
......@@ -951,13 +951,10 @@ function theme_forum_topic_list($tid, $topics, $sortby, $forum_per_page) {
);
}
}
if ($pager = theme('pager', NULL, $forum_per_page, 0, tablesort_pager())) {
$rows[] = array(array('data' => $pager, 'colspan' => '5', 'class' => 'pager'));
}
}
$output .= theme('table', $forum_topic_list_header, $rows);
$output .= theme('pager', NULL, $forum_per_page, 0, tablesort_pager());
return $output;
}
......
......@@ -962,15 +962,12 @@ function node_admin_nodes() {
l(t('edit'), 'node/'. $node->nid .'/edit', array(), $destination));
}
if ($pager = theme('pager', NULL, 50, 0)) {
$rows[] = array(array('data' => $pager, 'colspan' => '7'));
}
if (!$rows) {
$rows[] = array(array('data' => t('No posts available.'), 'colspan' => '6'));
}
$output .= theme('table', $header, $rows);
$output .= theme('pager', NULL, 50, 0);
return form($output, 'post', url('admin/node/action'));
}
......
......@@ -962,15 +962,12 @@ function node_admin_nodes() {
l(t('edit'), 'node/'. $node->nid .'/edit', array(), $destination));
}
if ($pager = theme('pager', NULL, 50, 0)) {
$rows[] = array(array('data' => $pager, 'colspan' => '7'));
}
if (!$rows) {
$rows[] = array(array('data' => t('No posts available.'), 'colspan' => '6'));
}
$output .= theme('table', $header, $rows);
$output .= theme('pager', NULL, 50, 0);
return form($output, 'post', url('admin/node/action'));
}
......
......@@ -256,15 +256,13 @@ function path_overview() {
$rows[] = array($data->dst, $data->src, l(t('edit'), "admin/path/edit/$data->pid", array(), $destination), l(t('delete'), "admin/path/delete/$data->pid", array(), $destination));
}
if ($pager = theme('pager', NULL, 50, 0, tablesort_pager())) {
$rows[] = array(array('data' => $pager, 'colspan' => '4'));
}
if (!$rows) {
$rows[] = array(array('data' => t('No URL aliases available.'), 'colspan' => '4'));
}
return theme('table', $header, $rows);
$output = theme('table', $header, $rows);
$output .= theme('pager', NULL, 50, 0, tablesort_pager());
return $output;
}
/**
......
......@@ -256,15 +256,13 @@ function path_overview() {
$rows[] = array($data->dst, $data->src, l(t('edit'), "admin/path/edit/$data->pid", array(), $destination), l(t('delete'), "admin/path/delete/$data->pid", array(), $destination));
}
if ($pager = theme('pager', NULL, 50, 0, tablesort_pager())) {
$rows[] = array(array('data' => $pager, 'colspan' => '4'));
}
if (!$rows) {
$rows[] = array(array('data' => t('No URL aliases available.'), 'colspan' => '4'));
}
return theme('table', $header, $rows);
$output = theme('table', $header, $rows);
$output .= theme('pager', NULL, 50, 0, tablesort_pager());
return $output;
}
/**
......
......@@ -177,12 +177,10 @@ function statistics_node_tracker() {
l(t('details'), "admin/logs/access/$log->aid"));
}
if ($pager = theme('pager', NULL, 30, 0, tablesort_pager())) {
$rows[] = array(array('data' => $pager, 'colspan' => '4'));
}
drupal_set_title(check_plain($node->title));
return theme('table', $header, $rows);
$output = theme('table', $header, $rows);
$output .= theme('pager', NULL, 30, 0, tablesort_pager());
return $output;
}
else {
drupal_not_found();
......@@ -205,12 +203,10 @@ function statistics_user_tracker() {
l(t('details'), "admin/logs/access/$log->aid"));
}
if ($pager = theme('pager', NULL, 30, 0, tablesort_pager())) {
$rows[] = array(array('data' => $pager, 'colspan' => '3'));
}
drupal_set_title($account->name);
return theme('table', $header, $rows);
$output = theme('table', $header, $rows);
$output .= theme('pager', NULL, 30, 0, tablesort_pager());
return $output;
}
else {
drupal_not_found();
......@@ -239,11 +235,9 @@ function statistics_recent_hits($type = 'all', $id = 0) {
l(t('details'), "admin/logs/access/$log->aid"));
}
if ($pager = theme('pager', NULL, 30, 0, tablesort_pager())) {
$rows[] = array(array('data' => $pager, 'colspan' => '4'));
}
return theme('table', $header, $rows);
$output = theme('table', $header, $rows);
$output .= theme('pager', NULL, 30, 0, tablesort_pager());
return $output;
}
/**
......@@ -266,12 +260,10 @@ function statistics_top_pages() {
$rows[] = array($page->hits, _statistics_format_item($page->title, $page->path), t('%time ms', array('%time' => round($page->average_time))), format_interval(round($page->total_time / 1000)));
}
if ($pager = theme('pager', NULL, 30, 0, tablesort_pager())) {
$rows[] = array(array('data' => $pager, 'colspan' => '4'));
}
drupal_set_title(t('Top pages in the past %interval', array('%interval' => format_interval(variable_get('statistics_flush_accesslog_timer', 259200)))));
return theme('table', $header, $rows);
$output = theme('table', $header, $rows);
$output .= theme('pager', NULL, 30, 0, tablesort_pager());
return $output;
}
/**
......@@ -296,12 +288,10 @@ function statistics_top_visitors() {
$rows[] = array($account->hits, ($account->uid ? theme('username', $account) : $account->hostname), format_interval(round($account->total / 1000)), $ban_link);
}
if ($pager = theme('pager', NULL, 30, 0, tablesort_pager())) {
$rows[] = array(array('data' => $pager, 'colspan' => '4'));
}
drupal_set_title(t('Top visitors in the past %interval', array('%interval' => format_interval(variable_get('statistics_flush_accesslog_timer', 259200)))));
return theme('table', $header, $rows);
$output = theme('table', $header, $rows);
$output .= theme('pager', NULL, 30, 0, tablesort_pager());
return $output;
}
/**
......@@ -324,11 +314,10 @@ function statistics_top_referrers() {
while ($referrer = db_fetch_object($result)) {
$rows[] = array($referrer->hits, '<a href="'. check_url($referrer->url) .'">'. check_plain(_statistics_column_width($referrer->url)) .'</a>', t('%time ago', array('%time' => format_interval(time() - $referrer->last))));
}
if ($pager = theme('pager', NULL, 30, 0, tablesort_pager())) {
$rows[] = array(array('data' => $pager, 'colspan' => '3'));
}
return theme('table', $header, $rows);
$output = theme('table', $header, $rows);
$output .= theme('pager', NULL, 30, 0, tablesort_pager());
return $output;
}
/**
......
......@@ -177,12 +177,10 @@ function statistics_node_tracker() {
l(t('details'), "admin/logs/access/$log->aid"));
}
if ($pager = theme('pager', NULL, 30, 0, tablesort_pager())) {
$rows[] = array(array('data' => $pager, 'colspan' => '4'));
}
drupal_set_title(check_plain($node->title));
return theme('table', $header, $rows);
$output = theme('table', $header, $rows);
$output .= theme('pager', NULL, 30, 0, tablesort_pager());
return $output;
}
else {
drupal_not_found();
......@@ -205,12 +203,10 @@ function statistics_user_tracker() {
l(t('details'), "admin/logs/access/$log->aid"));
}
if ($pager = theme('pager', NULL, 30, 0, tablesort_pager())) {
$rows[] = array(array('data' => $pager, 'colspan' => '3'));
}
drupal_set_title($account->name);
return theme('table', $header, $rows);
$output = theme('table', $header, $rows);
$output .= theme('pager', NULL, 30, 0, tablesort_pager());
return $output;
}
else {
drupal_not_found();
......@@ -239,11 +235,9 @@ function statistics_recent_hits($type = 'all', $id = 0) {
l(t('details'), "admin/logs/access/$log->aid"));
}
if ($pager = theme('pager', NULL, 30, 0, tablesort_pager())) {
$rows[] = array(array('data' => $pager, 'colspan' => '4'));
}
return theme('table', $header, $rows);
$output = theme('table', $header, $rows);
$output .= theme('pager', NULL, 30, 0, tablesort_pager());
return $output;
}
/**
......@@ -266,12 +260,10 @@ function statistics_top_pages() {
$rows[] = array($page->hits, _statistics_format_item($page->title, $page->path), t('%time ms', array('%time' => round($page->average_time))), format_interval(round($page->total_time / 1000)));
}
if ($pager = theme('pager', NULL, 30, 0, tablesort_pager())) {
$rows[] = array(array('data' => $pager, 'colspan' => '4'));
}
drupal_set_title(t('Top pages in the past %interval', array('%interval' => format_interval(variable_get('statistics_flush_accesslog_timer', 259200)))));
return theme('table', $header, $rows);
$output = theme('table', $header, $rows);
$output .= theme('pager', NULL, 30, 0, tablesort_pager());
return $output;
}
/**
......@@ -296,12 +288,10 @@ function statistics_top_visitors() {
$rows[] = array($account->hits, ($account->uid ? theme('username', $account) : $account->hostname), format_interval(round($account->total / 1000)), $ban_link);
}
if ($pager = theme('pager', NULL, 30, 0, tablesort_pager())) {
$rows[] = array(array('data' => $pager, 'colspan' => '4'));
}
drupal_set_title(t('Top visitors in the past %interval', array('%interval' => format_interval(variable_get('statistics_flush_accesslog_timer', 259200)))));
return theme('table', $header, $rows);
$output = theme('table', $header, $rows);
$output .= theme('pager', NULL, 30, 0, tablesort_pager());
return $output;
}
/**
......@@ -324,11 +314,10 @@ function statistics_top_referrers() {
while ($referrer = db_fetch_object($result)) {
$rows[] = array($referrer->hits, '<a href="'. check_url($referrer->url) .'">'. check_plain(_statistics_column_width($referrer->url)) .'</a>', t('%time ago', array('%time' => format_interval(time() - $referrer->last))));
}
if ($pager = theme('pager', NULL, 30, 0, tablesort_pager())) {
$rows[] = array(array('data' => $pager, 'colspan' => '3'));
}
return theme('table', $header, $rows);
$output = theme('table', $header, $rows);
$output .= theme('pager', NULL, 30, 0, tablesort_pager());
return $output;
}
/**
......
......@@ -108,14 +108,11 @@ function tracker_page($uid = 0) {
);
}
if ($pager = theme('pager', NULL, 25, 0)) {
$rows[] = array(array('data' => $pager, 'colspan' => '5'));
}
$header = array(t('Type'), t('Post'), t('Author'), t('Replies'), t('Last post'));
$output .= '<div id="tracker">';
$output .= theme('table', $header, $rows);
$output .= theme('pager', NULL, 25, 0);
$output .= '</div>';
return $output;
......
......@@ -108,14 +108,11 @@ function tracker_page($uid = 0) {
);
}
if ($pager = theme('pager', NULL, 25, 0)) {
$rows[] = array(array('data' => $pager, 'colspan' => '5'));
}
$header = array(t('Type'), t('Post'), t('Author'), t('Replies'), t('Last post'));
$output .= '<div id="tracker">';
$output .= theme('table', $header, $rows);
$output .= theme('pager', NULL, 25, 0);
$output .= '</div>';
return $output;
......
......@@ -1722,11 +1722,9 @@ function user_admin_account() {
l(t('edit'), "user/$account->uid/edit", array(), $destination));
}
$pager = theme('pager', NULL, 50, 0, tablesort_pager());
if (!empty($pager)) {
$rows[] = array(array('data' => $pager, 'colspan' => '5'));
}
return theme('table', $header, $rows);
$output = theme('table', $header, $rows);
$output .= theme('pager', NULL, 50, 0, tablesort_pager());
return $output;
}
function user_configure() {
......
......@@ -1722,11 +1722,9 @@ function user_admin_account() {
l(t('edit'), "user/$account->uid/edit", array(), $destination));
}
$pager = theme('pager', NULL, 50, 0, tablesort_pager());
if (!empty($pager)) {
$rows[] = array(array('data' => $pager, 'colspan' => '5'));
}
return theme('table', $header, $rows);
$output = theme('table', $header, $rows);
$output .= theme('pager', NULL, 50, 0, tablesort_pager());
return $output;
}
function user_configure() {
......
......@@ -117,13 +117,9 @@ function watchdog_overview() {
$rows[] = array(array('data' => t('No log messages available.'), 'colspan' => '7'));
}
$pager = theme('pager', NULL, 50, 0, tablesort_pager());
if (!empty($pager)) {
$rows[] = array(array('data' => $pager, 'colspan' => '7'));
}
$output = '<div class="container-inline">'. form($form) .'</div>';
$output .= theme('table', $header, $rows);
$output .= theme('pager', NULL, 50, 0, tablesort_pager());
return $output;
}
......
......@@ -117,13 +117,9 @@ function watchdog_overview() {
$rows[] = array(array('data' => t('No log messages available.'), 'colspan' => '7'));
}
$pager = theme('pager', NULL, 50, 0, tablesort_pager());
if (!empty($pager)) {
$rows[] = array(array('data' => $pager, 'colspan' => '7'));
}
$output = '<div class="container-inline">'. form($form) .'</div>';
$output .= theme('table', $header, $rows);
$output .= theme('pager', NULL, 50, 0, tablesort_pager());
return $output;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment