summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorGábor Hojtsy <gabor@hojtsy.hu>2007-12-20 21:37:42 +0000
committerGábor Hojtsy <gabor@hojtsy.hu>2007-12-20 21:37:42 +0000
commitbca913100a67029a67f4ff86721fe0290db88fc9 (patch)
tree569fe97e9a3abc8312427a92133af1730af66b8a /modules
parentfc8b22c615c119402e49d8f41cec20ea9809a0c1 (diff)
downloadbrdo-bca913100a67029a67f4ff86721fe0290db88fc9.tar.gz
brdo-bca913100a67029a67f4ff86721fe0290db88fc9.tar.bz2
#201577 by Pasqualle: let the admin theme be configured even if it is disabled (mirror blocks admin behavior)
Diffstat (limited to 'modules')
-rw-r--r--modules/system/system.admin.inc9
-rw-r--r--modules/system/system.module21
2 files changed, 21 insertions, 9 deletions
diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc
index af845928e..bdcb97049 100644
--- a/modules/system/system.admin.inc
+++ b/modules/system/system.admin.inc
@@ -207,13 +207,18 @@ function system_themes_form() {
'#value' => $theme->info,
);
$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) );
}
else {
// Dummy element for drupal_render. Cleaner than adding a check in the theme function.
$form[$theme->name]['operations'] = array();
+ }
+ if (!empty($theme->status)) {
+ $status[] = $theme->name;
+ }
+ else {
// Ensure this theme is compatible with this version of core.
if (!isset($theme->info['core']) || $theme->info['core'] != DRUPAL_CORE_COMPATIBILITY) {
$incompatible_core[] = $theme->name;
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() {