You are here

function node_configuration_enable in Configuration Management 7

Implements hook_configuration_enable().

When a configuration module is enabled, modify any node types it provides so they can no longer be deleted manually through the content types UI.

Parameters

$module: Name of module that has been enabled.

File

includes/configuration.node.inc, line 190

Code

function node_configuration_enable($module) {
  if ($default_types = configuration_get_default('node', $module)) {
    foreach ($default_types as $type_name => $type_info) {

      // Ensure the type exists.
      if ($type_info = node_type_load($type_name)) {
        $type_info->module = $module;
        $type_info->custom = 0;
        $type_info->modified = 0;
        $type_info->locked = 1;
        node_type_save($type_info);
      }
    }
  }
}