From 6d9e5084d8e6c49f3607e5153f963b4a8f835434 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 7 Mar 2006 11:28:22 +0000 Subject: - Patch #52508 by TDobes: fixed theme system regressions. --- modules/system/system.module | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'modules/system/system.module') diff --git a/modules/system/system.module b/modules/system/system.module index e93684cdb..51712beba 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -173,27 +173,22 @@ function system_user($type, $edit, &$user, $category = NULL) { if (count($themes) > 1) { ksort($themes); - // Reset to follow site default theme if user selects the site default - if ($key == variable_get('theme_default', 'bluemarine')) { - $key = ''; - if ($edit['theme'] == variable_get('theme_default', 'bluemarine')) { - $edit['theme'] = ''; - } - } - $form['themes'] = array( '#type' => 'fieldset', '#title' => t('Theme configuration'), '#description' => t('Selecting a different theme will change the look and feel of the site.'), '#weight' => 2, '#collapsible' => TRUE, '#theme' => 'system_user'); foreach ($themes as $info) { + // For the default theme, revert to an empty string so the user's theme updates when the site theme is changed. + $info->key = $info->name == variable_get('theme_default', 'bluemarine') ? '' : $info->name; + $info->screenshot = dirname($info->filename) . '/screenshot.png'; $screenshot = file_exists($info->screenshot) ? theme('image', $info->screenshot, t('Screenshot for %theme theme', array('%theme' => $info->name)), '', array('class' => 'screenshot'), false) : t('no screenshot'); - $form['themes'][$info->name]['screenshot'] = array('#type' => 'markup', '#value' => $screenshot); - $form['themes'][$info->name]['description'] = array('#type' => 'item', '#title' => $info->name, '#value' => dirname($info->filename)); - $options[$info->name] = ''; + $form['themes'][$info->key]['screenshot'] = array('#type' => 'markup', '#value' => $screenshot); + $form['themes'][$info->key]['description'] = array('#type' => 'item', '#title' => $info->name, '#value' => dirname($info->filename) . ($info->name == variable_get('theme_default', 'bluemarine') ? t('
(site default theme)') : '')); + $options[$info->key] = ''; } - $form['themes']['theme'] = array('#type' => 'radios', '#options' => $options, '#default_value' => $edit['theme'] ? $edit['theme'] : variable_get('theme_default', 'bluemarine')); + $form['themes']['theme'] = array('#type' => 'radios', '#options' => $options, '#default_value' => $edit['theme'] ? $edit['theme'] : ''); } } -- cgit v1.2.3