function system_node_type

6.x system.module system_node_type($op, $info)

Implementation of hook_node_type().

Updates theme settings after a node type change.

File

drupal-6.x/modules/system/system.module, line 1171
Configuration system that lets administrators modify the workings of the site.

Code

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);
    }
  }
}