Commit dd823989 authored by Steven Wittens's avatar Steven Wittens

#77366: make 'system default' the default administration theme

parent 858bb7f0
......@@ -296,7 +296,7 @@ function system_menu($may_cache) {
*/
if (arg(0) == 'admin') {
global $custom_theme;
$custom_theme = variable_get('admin_theme', 'bluemarine');
$custom_theme = variable_get('admin_theme', '0');
drupal_add_css(drupal_get_path('module', 'system') .'/admin.css', 'core');
}
......@@ -417,7 +417,7 @@ function system_admin_theme_settings() {
'#options' => $options,
'#title' => t('Administration theme'),
'#description' => t('Choose which theme the administration pages should display in. If you choose "System default" the administration pages theme will display in the same theme the rest of the site uses.'),
'#default_value' => variable_get('admin_theme', 'bluemarine'),
'#default_value' => variable_get('admin_theme', '0'),
);
// In order to give it our own submit, we have to give it the default submit
......@@ -431,7 +431,7 @@ function system_admin_theme_settings() {
function system_admin_theme_submit($form_id, $form_values) {
// If we're changing themes, make sure the theme has its blocks initialized.
if ($form_values['admin_theme'] != variable_get('admin_theme', 'bluemarine')) {
if ($form_values['admin_theme'] != variable_get('admin_theme', '0')) {
$result = db_query("SELECT status FROM {blocks} WHERE theme = '%s'", $form_values['admin_theme']);
if (!db_num_rows($result)) {
system_initialize_theme_blocks($form_values['admin_theme']);
......@@ -1215,6 +1215,13 @@ function system_themes_submit($form_id, $form_values) {
}
}
}
if (($admin_theme = variable_get('admin_theme', '0')) != '0') {
drupal_set_message(t('Please note that the <a href="!admin_theme_page">administration theme</a> is still set to the %admin_theme theme; consequently, the theme on this page remains unchanged. All non-administrative sections of the site, however, will show the selected %selected_theme theme by default.', array(
'!admin_theme_page' => url('admin/settings/admin'),
'%admin_theme' => $admin_theme,
'%selected_theme' => $values['theme_default'],
)));
}
variable_set('theme_default', $form_values['theme_default']);
}
else {
......
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