Commit 231c473d authored by anarcat's avatar anarcat Committed by anarcat

#791262 - update color and theme paths during deploy

parent ef36954b
......@@ -20,3 +20,27 @@ db_query("UPDATE {users} SET picture = replace(picture, 'sites/%s', 'sites/%s')"
variable_set('file_directory_path', "sites/$new_url/files");
variable_set('file_directory_temp', "sites/$new_url/files/tmp");
// Global theme settings paths.
if ($var = variable_get('theme_settings', FALSE)) {
$var['logo_path'] = str_replace($old_url, $new_url, $var['logo_path']);
$var['favicon_path'] = str_replace($old_url, $new_url, $var['favicon_path']);
variable_set('theme_settings', $var);
}
$themes = list_themes();
foreach (array_keys($themes) as $theme) {
// Update logo and favicon paths for each theme.
if ($var = variable_get('theme_'. $theme .'_settings', FALSE)) {
$var['logo_path'] = str_replace($old_url, $new_url, $var['logo_path']);
$var['favicon_path'] = str_replace($old_url, $new_url, $var['favicon_path']);
variable_set('theme_'. $theme .'_settings', $var);
}
// Update color module paths.
if (module_exists('color')) {
foreach (array('_files', '_logo', '_screenshot', '_stylesheets') as $suffix) {
if ($var = variable_get('color_'. $theme . $suffix, FALSE)) {
variable_set('color_'. $theme . $suffix, str_replace($old_url, $new_url, $var));
}
}
}
}
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