diff options
author | Dries Buytaert <dries@buytaert.net> | 2004-09-16 07:17:56 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2004-09-16 07:17:56 +0000 |
commit | 5c7983c4deae55ad41b85ca99db54d3fce283fd9 (patch) | |
tree | 59801cd96a36c390586752c58d6cf5ba50c230ce /modules/statistics/statistics.module | |
parent | 6f0fd3aa55659f8bd6b023e8e82e990326c1b788 (diff) | |
download | brdo-5c7983c4deae55ad41b85ca99db54d3fce283fd9.tar.gz brdo-5c7983c4deae55ad41b85ca99db54d3fce283fd9.tar.bz2 |
- Patch #8179 by JonBob: reintroduced menu caching.
Diffstat (limited to 'modules/statistics/statistics.module')
-rw-r--r-- | modules/statistics/statistics.module | 62 |
1 files changed, 33 insertions, 29 deletions
diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module index 10029d9d3..4df088ed2 100644 --- a/modules/statistics/statistics.module +++ b/modules/statistics/statistics.module @@ -153,36 +153,40 @@ function statistics_link($type, $node = 0, $main = 0) { /** * Implementation of hook_menu(). */ -function statistics_menu() { +function statistics_menu($may_cache) { $items = array(); - $items[] = array('path' => 'statistics', 'title' => t('most popular content'), - 'callback' => 'statistics_page', - 'access' => user_access('access content'), - 'type' => MENU_SUGGESTED_ITEM); - - $access = user_access('administer statistics module') || user_access('administer statistics'); - $items[] = array('path' => 'admin/logs/hits', 'title' => t('hits'), - 'callback' => 'statistics_admin_displaylog', 'access' => $access, - 'weight' => 3); - $items[] = array('path' => 'admin/logs/hits/posts', 'title' => t('posts'), - 'callback' => 'statistics_admin_content', 'access' => $access, - 'weight' => 1); - $items[] = array('path' => 'admin/logs/hits/pages', 'title' => t('pages'), - 'callback' => 'statistics_top_titles', 'access' => $access, - 'weight' => 1); - $items[] = array('path' => 'admin/logs/hits/users', 'title' => t('users'), - 'callback' => 'statistics_top_users', 'access' => $access, - 'weight' => 2); - $items[] = array('path' => 'admin/logs/hits/hostnames', - 'title' => t('hostnames'), 'callback' => 'statistics_top_hostnames', - 'access' => $access, 'weight' => 3); - $items[] = array('path' => 'admin/logs/referrers', - 'title' => t('referrers'), 'callback' => 'statistics_top_referrers', - 'access' => $access, 'weight' => 4); - $items[] = array('path' => 'admin/logs/referrers/internal', - 'title' => t('internal'), 'access' => $access); - $items[] = array('path' => 'admin/logs/referrers/external', - 'title' => t('external'), 'access' => $access); + + if ($may_cache) { + $items[] = array('path' => 'statistics', 'title' => t('most popular content'), + 'callback' => 'statistics_page', + 'access' => user_access('access content'), + 'type' => MENU_SUGGESTED_ITEM); + + $access = user_access('administer statistics module') || user_access('administer statistics'); + $items[] = array('path' => 'admin/logs/hits', 'title' => t('hits'), + 'callback' => 'statistics_admin_displaylog', 'access' => $access, + 'weight' => 3); + $items[] = array('path' => 'admin/logs/hits/posts', 'title' => t('posts'), + 'callback' => 'statistics_admin_content', 'access' => $access, + 'weight' => 1); + $items[] = array('path' => 'admin/logs/hits/pages', 'title' => t('pages'), + 'callback' => 'statistics_top_titles', 'access' => $access, + 'weight' => 1); + $items[] = array('path' => 'admin/logs/hits/users', 'title' => t('users'), + 'callback' => 'statistics_top_users', 'access' => $access, + 'weight' => 2); + $items[] = array('path' => 'admin/logs/hits/hostnames', + 'title' => t('hostnames'), 'callback' => 'statistics_top_hostnames', + 'access' => $access, 'weight' => 3); + $items[] = array('path' => 'admin/logs/referrers', + 'title' => t('referrers'), 'callback' => 'statistics_top_referrers', + 'access' => $access, 'weight' => 4); + $items[] = array('path' => 'admin/logs/referrers/internal', + 'title' => t('internal'), 'access' => $access); + $items[] = array('path' => 'admin/logs/referrers/external', + 'title' => t('external'), 'access' => $access); + } + return $items; } |