summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2006-03-07 11:28:22 +0000
committerDries Buytaert <dries@buytaert.net>2006-03-07 11:28:22 +0000
commit6d9e5084d8e6c49f3607e5153f963b4a8f835434 (patch)
tree665411866e7dc8140e2dae4bd801f14fe390619c
parentf51bc544f28366071d3e9a9f5c3c77f55efb76d7 (diff)
downloadbrdo-6d9e5084d8e6c49f3607e5153f963b4a8f835434.tar.gz
brdo-6d9e5084d8e6c49f3607e5153f963b4a8f835434.tar.bz2
- Patch #52508 by TDobes: fixed theme system regressions.
-rw-r--r--includes/theme.inc6
-rw-r--r--modules/system.module19
-rw-r--r--modules/system/system.module19
-rw-r--r--themes/chameleon/chameleon.theme2
4 files changed, 18 insertions, 28 deletions
diff --git a/includes/theme.inc b/includes/theme.inc
index 80164a36a..ee499b65a 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -53,7 +53,7 @@ function init_theme() {
// If we're using a style, load its appropriate theme,
// which is stored in the style's description field.
- // Also load the stylesheet using drupal_set_html_head().
+ // Also load the stylesheet using theme_add_style().
// Otherwise, load the theme.
if (strpos($themes[$theme]->filename, '.css')) {
// File is a style; loads its CSS.
@@ -70,12 +70,12 @@ function init_theme() {
}
if (strpos($themes[$theme]->filename, '.theme')) {
- // file is a theme; include it
+ // file is a theme; include it
include_once './' . $themes[$theme]->filename;
}
elseif (strpos($themes[$theme]->description, '.engine')) {
// file is a template; include its engine
- include_once './' . $themes[$theme]->description;
+ include_once './' . $themes[$theme]->description;
$theme_engine = basename($themes[$theme]->description, '.engine');
if (function_exists($theme_engine .'_init')) {
call_user_func($theme_engine .'_init', $themes[$theme]);
diff --git a/modules/system.module b/modules/system.module
index e93684cdb..51712beba 100644
--- a/modules/system.module
+++ b/modules/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('<br /> <em>(site default theme)</em>') : ''));
+ $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'] : '');
}
}
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('<br /> <em>(site default theme)</em>') : ''));
+ $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'] : '');
}
}
diff --git a/themes/chameleon/chameleon.theme b/themes/chameleon/chameleon.theme
index 44965ef06..3753e3b28 100644
--- a/themes/chameleon/chameleon.theme
+++ b/themes/chameleon/chameleon.theme
@@ -35,7 +35,7 @@ function chameleon_page($content) {
$output .= "<head>\n";
$output .= " <title>". ($title ? strip_tags($title) ." | ". variable_get("site_name", "drupal") : variable_get("site_name", "drupal") ." | ". variable_get("site_slogan", "")) ."</title>\n";
$output .= drupal_get_html_head();
- theme('add_style', 'themes/chameleon/common.css');
+ $output .= theme('stylesheet_import', base_path() . path_to_theme() ."/common.css");
$output .= theme_get_styles();
$output .= "</head>";
$output .= "<body>\n";