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/block.module | |
parent | 6f0fd3aa55659f8bd6b023e8e82e990326c1b788 (diff) | |
download | brdo-5c7983c4deae55ad41b85ca99db54d3fce283fd9.tar.gz brdo-5c7983c4deae55ad41b85ca99db54d3fce283fd9.tar.bz2 |
- Patch #8179 by JonBob: reintroduced menu caching.
Diffstat (limited to 'modules/block.module')
-rw-r--r-- | modules/block.module | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/modules/block.module b/modules/block.module index 9011c7984..faa21eeb3 100644 --- a/modules/block.module +++ b/modules/block.module @@ -48,26 +48,29 @@ function block_perm() { /** * Implementation of hook_menu(). */ -function block_menu() { +function block_menu($may_cache) { $items = array(); - $items[] = array('path' => 'admin/block', 'title' => t('blocks'), - 'access' => user_access('administer blocks'), - 'callback' => 'block_admin'); - $items[] = array('path' => 'admin/block/list', 'title' => t('list'), - 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10); - $items[] = array('path' => 'admin/block/edit', 'title' => t('edit block'), - 'access' => user_access('administer blocks'), - 'callback' => 'block_box_edit', - 'type' => MENU_CALLBACK); - $items[] = array('path' => 'admin/block/delete', 'title' => t('delete block'), - 'access' => user_access('administer blocks'), - 'callback' => 'block_box_delete', - 'type' => MENU_CALLBACK); - // Tabs: - $items[] = array('path' => 'admin/block/add', 'title' => t('add'), - 'access' => user_access('administer blocks'), - 'callback' => 'block_box_edit', - 'type' => MENU_LOCAL_TASK); + + if ($may_cache) { + $items[] = array('path' => 'admin/block', 'title' => t('blocks'), + 'access' => user_access('administer blocks'), + 'callback' => 'block_admin'); + $items[] = array('path' => 'admin/block/list', 'title' => t('list'), + 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10); + $items[] = array('path' => 'admin/block/edit', 'title' => t('edit block'), + 'access' => user_access('administer blocks'), + 'callback' => 'block_box_edit', + 'type' => MENU_CALLBACK); + $items[] = array('path' => 'admin/block/delete', 'title' => t('delete block'), + 'access' => user_access('administer blocks'), + 'callback' => 'block_box_delete', + 'type' => MENU_CALLBACK); + $items[] = array('path' => 'admin/block/add', 'title' => t('add'), + 'access' => user_access('administer blocks'), + 'callback' => 'block_box_edit', + 'type' => MENU_LOCAL_TASK); + } + return $items; } |