diff options
Diffstat (limited to 'modules/system/system.module')
-rw-r--r-- | modules/system/system.module | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/modules/system/system.module b/modules/system/system.module index 198d61206..573562c11 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -293,13 +293,13 @@ function system_menu() { ); foreach (list_themes() as $theme) { - if ($theme->status) { - $items['admin/build/themes/settings/'. $theme->name] = array( - 'title' => $theme->info['name'], - 'page arguments' => array('system_theme_settings', $theme->name), - 'type' => MENU_LOCAL_TASK, - ); - } + $items['admin/build/themes/settings/'. $theme->name] = array( + 'title' => $theme->info['name'], + 'page arguments' => array('system_theme_settings', $theme->name), + 'type' => MENU_LOCAL_TASK, + 'access callback' => '_system_themes_access', + 'access arguments' => array($theme), + ); } // Modules: @@ -501,6 +501,13 @@ function system_menu() { } /** + * Menu item access callback - only admin or enabled themes can be accessed. + */ +function _system_themes_access($theme) { + return $theme->status || $theme->name == variable_get('admin_theme', '0'); +} + +/** * Implementation of hook_init(). */ function system_init() { |