You are here

function system_node_type in Drupal 6

Same name and namespace in other branches
  1. 5 modules/system/system.module \system_node_type()

Implementation of hook_node_type().

Updates theme settings after a node type change.

File

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