diff options
Diffstat (limited to 'modules/system/system.install')
-rw-r--r-- | modules/system/system.install | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/modules/system/system.install b/modules/system/system.install index ccaf437c4..987e7a0e4 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -2766,6 +2766,46 @@ function system_update_7045() { } /** + * Switch from the Minnelli theme if it is the default or admin theme. + */ +function system_update_7046() { + if (variable_get('theme_default') == 'minnelli' || variable_get('admin_theme') == 'minnelli') { + // Make sure Garland is enabled. + db_update('system') + ->fields(array('status' => 1)) + ->condition('type', 'theme') + ->condition('name', 'garland') + ->execute(); + if (variable_get('theme_default') != 'garland') { + // If the default theme isn't Garland, transfer all of Minnelli's old + // settings to Garland. + $settings = variable_get('theme_minnelli_settings', array()); + // Set the theme setting width to "fixed" to match Minnelli's old layout. + $settings['garland_width'] = 'fixed'; + variable_set('theme_garland_settings', $settings); + // Remove Garland's color files since they won't match Minnelli's. + foreach (variable_get('color_garland_files', array()) as $file) { + @unlink($file); + } + if (isset($file) && $file = dirname($file)) { + @rmdir($file); + } + variable_del('color_garland_palette'); + variable_del('color_garland_stylesheets'); + variable_del('color_garland_logo'); + variable_del('color_garland_files'); + variable_del('color_garland_screenshot'); + } + if (variable_get('theme_default') == 'minnelli') { + variable_set('theme_default', 'garland'); + } + if (variable_get('admin_theme') == 'minnelli') { + variable_set('admin_theme', 'garland'); + } + } +} + +/** * @} End of "defgroup updates-6.x-to-7.x" * The next series of updates should start at 8000. */ |