summaryrefslogtreecommitdiff
path: root/modules/statistics
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2007-07-03 20:10:50 +0000
committerDries Buytaert <dries@buytaert.net>2007-07-03 20:10:50 +0000
commite1994751db3f36e9243313c945162c208f067ba7 (patch)
treead42ac560cc21c3d462a315c2c7cf4fb99dc5aff /modules/statistics
parent20093d5fc84378634c4b21efb73c867a56cbbc47 (diff)
downloadbrdo-e1994751db3f36e9243313c945162c208f067ba7.tar.gz
brdo-e1994751db3f36e9243313c945162c208f067ba7.tar.bz2
- Patch #119821 by Zen and Dave Trainer: properly theme the statistics log table.
Diffstat (limited to 'modules/statistics')
-rw-r--r--modules/statistics/statistics.module37
1 files changed, 28 insertions, 9 deletions
diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module
index ce12dd15a..759f7dccd 100644
--- a/modules/statistics/statistics.module
+++ b/modules/statistics/statistics.module
@@ -175,15 +175,34 @@ function statistics_user($op, &$edit, &$user) {
function statistics_access_log($aid) {
$result = db_query('SELECT a.*, u.name FROM {accesslog} a LEFT JOIN {users} u ON a.uid = u.uid WHERE aid = %d', $aid);
if ($access = db_fetch_object($result)) {
- $output = '<table border="1" cellpadding="2" cellspacing="2">';
- $output .= ' <tr><th>'. t('URL') ."</th><td>". l(url($access->path, array('absolute' => TRUE)), $access->path) ."</td></tr>";
- $output .= ' <tr><th>'. t('Title') .'</th><td>'. $access->title .'</td></tr>'; // safe because it comes from drupal_get_title()
- $output .= ' <tr><th>'. t('Referrer') ."</th><td>". ($access->url ? l($access->url, $access->url) : '') ."</td></tr>";
- $output .= ' <tr><th>'. t('Date') .'</th><td>'. format_date($access->timestamp, 'large') .'</td></tr>';
- $output .= ' <tr><th>'. t('User') .'</th><td>'. theme('username', $access) .'</td></tr>';
- $output .= ' <tr><th>'. t('Hostname') .'</th><td>'. check_plain($access->hostname) .'</td></tr>';
- $output .= '</table>';
- return $output;
+ $rows[] = array(
+ array('data' => t('URL'), 'header' => TRUE),
+ l(url($access->path, array('absolute' => TRUE)), $access->path)
+ );
+ // It is safe to avoid filtering $access->title through check_plain because
+ // it comes from drupal_get_title().
+ $rows[] = array(
+ array('data' => t('Title'), 'header' => TRUE),
+ $access->title
+ );
+ $rows[] = array(
+ array('data' => t('Referrer'), 'header' => TRUE),
+ ($access->url ? l($access->url, $access->url) : '')
+ );
+ $rows[] = array(
+ array('data' => t('Date'), 'header' => TRUE),
+ format_date($access->timestamp, 'large')
+ );
+ $rows[] = array(
+ array('data' => t('User'), 'header' => TRUE),
+ theme('username', $access)
+ );
+ $rows[] = array(
+ array('data' => t('Hostname'), 'header' => TRUE),
+ check_plain($access->hostname)
+ );
+
+ return theme('table', array(), $rows);
}
else {
drupal_not_found();