summaryrefslogtreecommitdiff
path: root/modules/system/system.module
diff options
context:
space:
mode:
authorNeil Drumm <drumm@3064.no-reply.drupal.org>2006-11-27 01:55:45 +0000
committerNeil Drumm <drumm@3064.no-reply.drupal.org>2006-11-27 01:55:45 +0000
commit8d655b8c57d8e977898bcf3707d1953f265f86d1 (patch)
tree1f7b2e821b81588d2f5fb901099f00a90a0f651d /modules/system/system.module
parent3ee7ed6a665c614886fea5e8eb044bcdbc199591 (diff)
downloadbrdo-8d655b8c57d8e977898bcf3707d1953f265f86d1.tar.gz
brdo-8d655b8c57d8e977898bcf3707d1953f265f86d1.tar.bz2
#85062 by pwolanin. Update node type names for renamed content types in theme settings.
Diffstat (limited to 'modules/system/system.module')
-rw-r--r--modules/system/system.module19
1 files changed, 19 insertions, 0 deletions
diff --git a/modules/system/system.module b/modules/system/system.module
index 238102924..d4d2df881 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -2054,6 +2054,25 @@ function system_theme_settings($key = '') {
}
/**
+ * Implementation of hook_node_type().
+ *
+ * Updates theme settings after a node type change.
+ */
+function system_node_type($op, $info) {
+ if ($op == 'update' && !empty($info->old_type) && $info->type != $info->old_type) {
+ $old = 'toggle_node_info_'. $info->old_type;
+ $new = 'toggle_node_info_'. $info->type;
+
+ $theme_settings = variable_get('theme_settings', array());
+ if (isset($theme_settings[$old])) {
+ $theme_settings[$new] = $theme_settings[$old];
+ unset($theme_settings[$old]);
+ variable_set('theme_settings', $theme_settings);
+ }
+ }
+}
+
+/**
* Output a confirmation form
*
* This function returns a complete form for confirming an action. A link is