function system_update_7017 in Drupal 7
Change the theme setting 'toggle_node_info' into a per content type variable.
Related topics
File
- modules/
system/ system.install, line 2192 - Install, update and uninstall functions for the system module.
Code
function system_update_7017() {
// Get the global theme settings.
$settings = variable_get('theme_settings', array());
// Get the settings of the default theme.
$settings = array_merge($settings, variable_get('theme_' . variable_get('theme_default', 'garland') . '_settings', array()));
$types = _update_7000_node_get_types();
foreach ($types as $type) {
if (isset($settings['toggle_node_info_' . $type->type])) {
variable_set('node_submitted_' . $type->type, $settings['toggle_node_info_' . $type->type]);
}
}
// Unset deprecated 'toggle_node_info' theme settings.
$theme_settings = variable_get('theme_settings', array());
foreach ($theme_settings as $setting => $value) {
if (substr($setting, 0, 16) == 'toggle_node_info') {
unset($theme_settings[$setting]);
}
}
variable_set('theme_settings', $theme_settings);
}