summaryrefslogtreecommitdiff
path: root/modules/locale
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-04-21 13:56:38 +0000
committerDries Buytaert <dries@buytaert.net>2004-04-21 13:56:38 +0000
commit7231c88a326f92bdc2b1579ac6afb8f7f568170b (patch)
treeb7586493410910be188d97440dbdf1d44b084b91 /modules/locale
parent7976678719f6e04ecda315a6088ee0eb3cfb0318 (diff)
downloadbrdo-7231c88a326f92bdc2b1579ac6afb8f7f568170b.tar.gz
brdo-7231c88a326f92bdc2b1579ac6afb8f7f568170b.tar.bz2
- Added support for 403 handling. Patch by JonBob. As a side benefit,
administrators will be able to define a custom 403 page, just as they can define 404 pages now. This needs to be documented in the "Changes since / migrating to ..." pages.
Diffstat (limited to 'modules/locale')
-rw-r--r--modules/locale/locale.module27
1 files changed, 14 insertions, 13 deletions
diff --git a/modules/locale/locale.module b/modules/locale/locale.module
index 47706292f..a86ad5d65 100644
--- a/modules/locale/locale.module
+++ b/modules/locale/locale.module
@@ -51,23 +51,24 @@ function locale_perm() {
return array('administer locales');
}
+/**
+ * Implementation of hook_link().
+ */
function locale_link($type) {
global $languages;
- if ($type == "system") {
- if (user_access('administer locales')) {
+ if ($type == 'system') {
+ $access = user_access('administer locales');
+ menu('admin/locale', t('localization'), $access ? 'locale_admin' : MENU_DENIED, 5);
+ menu('admin/locale/search', t('search string'), $access ? 'locale_admin' : MENU_DENIED, 8);
+ menu('admin/locale/help', t('help'), $access ? 'locale_help_page' : MENU_DENIED, 9);
+ menu('admin/locale/edit', t('edit string'), $access ? 'locale_admin' : MENU_DENIED, 0, MENU_HIDE, MENU_LOCKED);
+ menu('admin/locale/delete', t('delete string'), $access ? 'locale_admin' : MENU_DENIED, 0, MENU_HIDE, MENU_LOCKED);
- menu("admin/locale", t("localization"), "locale_admin", 5);
- menu("admin/locale/search", t("search string"), "locale_admin", 8);
- menu("admin/locale/help", t("help"), "locale_help_page", 9);
- menu("admin/locale/edit", t("edit string"), "locale_admin", 0, MENU_HIDE, MENU_LOCKED);
- menu("admin/locale/delete", t("delete string"), "locale_admin", 0, MENU_HIDE, MENU_LOCKED);
-
- foreach ($languages as $key => $value) {
- menu("admin/locale/$key", "$value", "locale_admin");
- menu("admin/locale/$key/translated", t("translated strings"), "locale_admin");
- menu("admin/locale/$key/untranslated", t("untranslated strings"), "locale_admin");
- }
+ foreach ($languages as $key => $value) {
+ menu("admin/locale/$key", "$value", $access ? 'locale_admin' : MENU_DENIED);
+ menu("admin/locale/$key/translated", t('translated strings'), $access ? 'locale_admin' : MENU_DENIED);
+ menu("admin/locale/$key/untranslated", t('untranslated strings'), $access ? 'locale_admin' : MENU_DENIED);
}
}
}