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/tracker | |
parent | 6f0fd3aa55659f8bd6b023e8e82e990326c1b788 (diff) | |
download | brdo-5c7983c4deae55ad41b85ca99db54d3fce283fd9.tar.gz brdo-5c7983c4deae55ad41b85ca99db54d3fce283fd9.tar.bz2 |
- Patch #8179 by JonBob: reintroduced menu caching.
Diffstat (limited to 'modules/tracker')
-rw-r--r-- | modules/tracker/tracker.module | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/modules/tracker/tracker.module b/modules/tracker/tracker.module index ef406194f..24951d50e 100644 --- a/modules/tracker/tracker.module +++ b/modules/tracker/tracker.module @@ -21,20 +21,21 @@ function tracker_help($section) { /** * Implementation of hook_menu(). */ -function tracker_menu() { +function tracker_menu($may_cache) { global $user; - $items = array(); - $items[] = array('path' => 'tracker', 'title' => t('recent posts'), - 'callback' => 'tracker_page', 'access' => user_access('access content'), - 'weight' => 1); - - // Tabs: - if ($user->uid) { - $items[] = array('path' => 'tracker/all', 'title' => t('all recent posts'), - 'type' => MENU_DEFAULT_LOCAL_TASK); - $items[] = array('path' => "tracker/$user->uid", 'title' => t('my recent posts'), - 'type' => MENU_LOCAL_TASK); + + if ($may_cache) { + $items[] = array('path' => 'tracker', 'title' => t('recent posts'), + 'callback' => 'tracker_page', 'access' => user_access('access content'), + 'weight' => 1); + + if ($user->uid) { + $items[] = array('path' => 'tracker/all', 'title' => t('all recent posts'), + 'type' => MENU_DEFAULT_LOCAL_TASK); + $items[] = array('path' => 'tracker/'. $user->uid, 'title' => t('my recent posts'), + 'type' => MENU_LOCAL_TASK); + } } return $items; |