diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-12-02 14:56:32 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-12-02 14:56:32 +0000 |
commit | 92760988b9decb01831ba89bcc54056a702c3836 (patch) | |
tree | 4a27865ed1737d832e82a575521940503147cd43 /modules/statistics | |
parent | e7dedc4330f3d7bbc4fd861a4e5619d780bcca6c (diff) | |
download | brdo-92760988b9decb01831ba89bcc54056a702c3836.tar.gz brdo-92760988b9decb01831ba89bcc54056a702c3836.tar.bz2 |
- Patch #648410 by Dave Reid: standardize add 'empty' row functionality to all tables.
Diffstat (limited to 'modules/statistics')
-rw-r--r-- | modules/statistics/statistics.admin.inc | 20 | ||||
-rw-r--r-- | modules/statistics/statistics.pages.inc | 14 |
2 files changed, 8 insertions, 26 deletions
diff --git a/modules/statistics/statistics.admin.inc b/modules/statistics/statistics.admin.inc index 9227e2787..845918883 100644 --- a/modules/statistics/statistics.admin.inc +++ b/modules/statistics/statistics.admin.inc @@ -35,14 +35,11 @@ function statistics_recent_hits() { l(t('details'), "admin/reports/access/$log->aid")); } - if (empty($rows)) { - $rows[] = array(array('data' => t('No statistics available.'), 'colspan' => 4)); - } - $build['statistics_table'] = array( '#theme' => 'table', '#header' => $header, '#rows' => $rows, + '#empty' => t('No statistics available.'), ); $build['statistics_pager'] = array('#theme' => 'pager'); return $build; @@ -82,15 +79,12 @@ 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 (empty($rows)) { - $rows[] = array(array('data' => t('No statistics available.'), 'colspan' => 4)); - } - drupal_set_title(t('Top pages in the past %interval', array('%interval' => format_interval(variable_get('statistics_flush_accesslog_timer', 259200)))), PASS_THROUGH); $build['statistics_top_pages_table'] = array( '#theme' => 'table', '#header' => $header, '#rows' => $rows, + '#empty' => t('No statistics available.'), ); $build['statistics_top_pages_pager'] = array('#theme' => 'pager'); return $build; @@ -136,15 +130,12 @@ function statistics_top_visitors() { $rows[] = array($account->hits, ($account->uid ? theme('username', array('account' => $account)) : $account->hostname), format_interval(round($account->total / 1000)), (user_access('block IP addresses') && !$account->uid) ? $ban_link : ''); } - if (empty($rows)) { - $rows[] = array(array('data' => t('No statistics available.'), 'colspan' => 4)); - } - drupal_set_title(t('Top visitors in the past %interval', array('%interval' => format_interval(variable_get('statistics_flush_accesslog_timer', 259200)))), PASS_THROUGH); $build['statistics_top_visitors_table'] = array( '#theme' => 'table', '#header' => $header, '#rows' => $rows, + '#empty' => t('No statistics available.'), ); $build['statistics_top_visitors_pager'] = array('#theme' => 'pager'); return $build; @@ -186,14 +177,11 @@ function statistics_top_referrers() { $rows[] = array($referrer->hits, _statistics_link($referrer->url), t('@time ago', array('@time' => format_interval(REQUEST_TIME - $referrer->last)))); } - if (empty($rows)) { - $rows[] = array(array('data' => t('No statistics available.'), 'colspan' => 3)); - } - $build['statistics_top_referrers_table'] = array( '#theme' => 'table', '#header' => $header, '#rows' => $rows, + '#empty' => t('No statistics available.'), ); $build['statistics_top_referrers_pager'] = array('#theme' => 'pager'); return $build; diff --git a/modules/statistics/statistics.pages.inc b/modules/statistics/statistics.pages.inc index 048b8fa09..5dc6f8962 100644 --- a/modules/statistics/statistics.pages.inc +++ b/modules/statistics/statistics.pages.inc @@ -38,15 +38,12 @@ function statistics_node_tracker() { ); } - if (empty($rows)) { - $rows[] = array(array('data' => t('No statistics available.'), 'colspan' => 4)); - } - drupal_set_title($node->title[FIELD_LANGUAGE_NONE][0]['value']); $build['statistics_table'] = array( '#theme' => 'table', '#header' => $header, - '#rows' => $rows + '#rows' => $rows, + '#empty' => t('No statistics available.'), ); $build['statistics_pager'] = array('#theme' => 'pager'); return $build; @@ -79,15 +76,12 @@ function statistics_user_tracker() { l(t('details'), "admin/reports/access/$log->aid")); } - if (empty($rows)) { - $rows[] = array(array('data' => t('No statistics available.'), 'colspan' => 3)); - } - drupal_set_title(format_username($account)); $build['statistics_table'] = array( '#theme' => 'table', '#header' => $header, - '#rows' => $rows + '#rows' => $rows, + '#empty' => t('No statistics available.'), ); $build['statistics_pager'] = array('#theme' => 'pager'); return $build; |