Commit bca91310 authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

#201577 by Pasqualle: let the admin theme be configured even if it is disabled...

#201577 by Pasqualle: let the admin theme be configured even if it is disabled (mirror blocks admin behavior)
parent fc8b22c6
...@@ -207,13 +207,18 @@ function system_themes_form() { ...@@ -207,13 +207,18 @@ function system_themes_form() {
'#value' => $theme->info, '#value' => $theme->info,
); );
$options[$theme->name] = ''; $options[$theme->name] = '';
if (!empty($theme->status)) {
$status[] = $theme->name; if (!empty($theme->status) || $theme->name == variable_get('admin_theme', '0')) {
$form[$theme->name]['operations'] = array('#value' => l(t('configure'), 'admin/build/themes/settings/'. $theme->name) ); $form[$theme->name]['operations'] = array('#value' => l(t('configure'), 'admin/build/themes/settings/'. $theme->name) );
} }
else { else {
// Dummy element for drupal_render. Cleaner than adding a check in the theme function. // Dummy element for drupal_render. Cleaner than adding a check in the theme function.
$form[$theme->name]['operations'] = array(); $form[$theme->name]['operations'] = array();
}
if (!empty($theme->status)) {
$status[] = $theme->name;
}
else {
// Ensure this theme is compatible with this version of core. // Ensure this theme is compatible with this version of core.
if (!isset($theme->info['core']) || $theme->info['core'] != DRUPAL_CORE_COMPATIBILITY) { if (!isset($theme->info['core']) || $theme->info['core'] != DRUPAL_CORE_COMPATIBILITY) {
$incompatible_core[] = $theme->name; $incompatible_core[] = $theme->name;
......
...@@ -293,13 +293,13 @@ function system_menu() { ...@@ -293,13 +293,13 @@ function system_menu() {
); );
foreach (list_themes() as $theme) { foreach (list_themes() as $theme) {
if ($theme->status) { $items['admin/build/themes/settings/'. $theme->name] = array(
$items['admin/build/themes/settings/'. $theme->name] = array( 'title' => $theme->info['name'],
'title' => $theme->info['name'], 'page arguments' => array('system_theme_settings', $theme->name),
'page arguments' => array('system_theme_settings', $theme->name), 'type' => MENU_LOCAL_TASK,
'type' => MENU_LOCAL_TASK, 'access callback' => '_system_themes_access',
); 'access arguments' => array($theme),
} );
} }
// Modules: // Modules:
...@@ -500,6 +500,13 @@ function system_menu() { ...@@ -500,6 +500,13 @@ function system_menu() {
return $items; return $items;
} }
/**
* 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(). * Implementation of hook_init().
*/ */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment