statistics_menu

Versions
4.6 – 5
statistics_menu($may_cache)
6 – 7
statistics_menu()

Implementation of hook_menu().

Code

modules/statistics.module, line 111

<?php
function statistics_menu($may_cache) {
  $items = array();

  $access = user_access('access statistics');
  if ($may_cache) {
    $items[] = array('path' => 'admin/logs/hits', 'title' => t('recent hits'),
      'callback' => 'statistics_recent_hits', 'access' => $access,
      'weight' => 3);
    $items[] = array('path' => 'admin/logs/pages', 'title' => t('top pages'),
      'callback' => 'statistics_top_pages', 'access' => $access,
      'weight' => 1);
    $items[] = array('path' => 'admin/logs/visitors', 'title' => t('top visitors'),
      'callback' => 'statistics_top_visitors', 'access' => $access,
      'weight' => 2);
    $items[] = array('path' => 'admin/logs/referrers', 'title' => t('referrers'),
      'callback' => 'statistics_top_referrers', 'access' => $access);
    $items[] = array('path' => 'admin/logs/access', 'title' => t('details'),
      'callback' => 'statistics_access_log', 'access' => $access,
      'type' => MENU_CALLBACK);
  }
  else {
    if (arg(0) == 'user' && is_numeric(arg(1)) && variable_get('statistics_enable_access_log', 0)) {
      $items[] = array('path' => 'user/'. arg(1) .'/track/navigation', 'title' => t('track page visits'),
        'callback' => 'statistics_user_tracker', 'access' => $access,
        'type' => MENU_LOCAL_TASK, 'weight' => 2);
    }
    if (arg(0) == 'node' && is_numeric(arg(1)) && variable_get('statistics_enable_access_log', 0)) {
      $items[] = array('path' => 'node/'. arg(1) .'/track', 'title' => t('track'),
        'callback' => 'statistics_node_tracker', 'access' => $access,
        'type' => MENU_LOCAL_TASK, 'weight' => 2);
    }
  }

  return $items;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.