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/locale | |
parent | 6f0fd3aa55659f8bd6b023e8e82e990326c1b788 (diff) | |
download | brdo-5c7983c4deae55ad41b85ca99db54d3fce283fd9.tar.gz brdo-5c7983c4deae55ad41b85ca99db54d3fce283fd9.tar.bz2 |
- Patch #8179 by JonBob: reintroduced menu caching.
Diffstat (limited to 'modules/locale')
-rw-r--r-- | modules/locale/locale.module | 81 |
1 files changed, 42 insertions, 39 deletions
diff --git a/modules/locale/locale.module b/modules/locale/locale.module index 6669f1df0..d7caf6d56 100644 --- a/modules/locale/locale.module +++ b/modules/locale/locale.module @@ -62,46 +62,49 @@ function locale_help($section = "admin/help#locale") { /** * Implementation of hook_menu(). */ -function locale_menu() { - +function locale_menu($may_cache) { $items = array(); - $access = user_access('administer locales'); - - // Main admin menu item - $items[] = array('path' => 'admin/locale', 'title' => t('localization'), - 'callback' => 'locale_admin_manage', 'access' => $access); - - // Top level tabs - $items[] = array('path' => 'admin/locale/language', 'title' => t('manage languages'), - 'access' => $access, 'weight' => -10, 'type' => MENU_DEFAULT_LOCAL_TASK); - $items[] = array('path' => 'admin/locale/string/search', 'title' => t('manage strings'), - 'callback' => 'locale_admin_string', 'access' => $access, 'weight' => 10, - 'type' => MENU_LOCAL_TASK); - - // Manage languages subtabs - $items[] = array('path' => 'admin/locale/language/overview', 'title' => t('list'), - 'callback' => 'locale_admin_manage', 'access' => $access, "weight" => 0, - 'type' => MENU_DEFAULT_LOCAL_TASK); - $items[] = array('path' => 'admin/locale/language/add', 'title' => t('add language'), - 'callback' => 'locale_admin_manage_add', 'access' => $access, "weight" => 5, - 'type' => MENU_LOCAL_TASK); - $items[] = array('path' => 'admin/locale/language/import', 'title' => t('import'), - 'callback' => 'locale_admin_import', 'access' => $access, 'weight' => 10, - 'type' => MENU_LOCAL_TASK); - $items[] = array('path' => 'admin/locale/language/export', 'title' => t('export'), - 'callback' => 'locale_admin_export', 'access' => $access, 'weight' => 20, - 'type' => MENU_LOCAL_TASK); - - // Language related callbacks - $items[] = array('path' => 'admin/locale/language/delete', 'title' => t('confirm'), - 'callback' => 'locale_admin_manage_delete_screen', 'access' => $access, - 'type' => MENU_CALLBACK); - - // String related callbacks - $items[] = array('path' => 'admin/locale/string/edit', 'title' => t('edit'), - 'callback' => 'locale_admin_string', 'access' => $access, 'type' => MENU_CALLBACK); - $items[] = array('path' => 'admin/locale/string/delete', 'title' => t('delete'), - 'callback' => 'locale_admin_string', 'access' => $access, 'type' => MENU_CALLBACK); + + if ($may_cache) { + $access = user_access('administer locales'); + + // Main admin menu item + $items[] = array('path' => 'admin/locale', 'title' => t('localization'), + 'callback' => 'locale_admin_manage', 'access' => $access); + + // Top level tabs + $items[] = array('path' => 'admin/locale/language', 'title' => t('manage languages'), + 'access' => $access, 'weight' => -10, 'type' => MENU_DEFAULT_LOCAL_TASK); + $items[] = array('path' => 'admin/locale/string/search', 'title' => t('manage strings'), + 'callback' => 'locale_admin_string', 'access' => $access, 'weight' => 10, + 'type' => MENU_LOCAL_TASK); + + // Manage languages subtabs + $items[] = array('path' => 'admin/locale/language/overview', 'title' => t('list'), + 'callback' => 'locale_admin_manage', 'access' => $access, "weight" => 0, + 'type' => MENU_DEFAULT_LOCAL_TASK); + $items[] = array('path' => 'admin/locale/language/add', 'title' => t('add language'), + 'callback' => 'locale_admin_manage_add', 'access' => $access, "weight" => 5, + 'type' => MENU_LOCAL_TASK); + $items[] = array('path' => 'admin/locale/language/import', 'title' => t('import'), + 'callback' => 'locale_admin_import', 'access' => $access, 'weight' => 10, + 'type' => MENU_LOCAL_TASK); + $items[] = array('path' => 'admin/locale/language/export', 'title' => t('export'), + 'callback' => 'locale_admin_export', 'access' => $access, 'weight' => 20, + 'type' => MENU_LOCAL_TASK); + + // Language related callbacks + $items[] = array('path' => 'admin/locale/language/delete', 'title' => t('confirm'), + 'callback' => 'locale_admin_manage_delete_screen', 'access' => $access, + 'type' => MENU_CALLBACK); + + // String related callbacks + $items[] = array('path' => 'admin/locale/string/edit', 'title' => t('edit'), + 'callback' => 'locale_admin_string', 'access' => $access, 'type' => MENU_CALLBACK); + $items[] = array('path' => 'admin/locale/string/delete', 'title' => t('delete'), + 'callback' => 'locale_admin_string', 'access' => $access, 'type' => MENU_CALLBACK); + } + return $items; } |