function noderelationships_node_type in Node Relationships 6
Implementation of hook_node_type().
File
- ./
noderelationships.module, line 309 - This is the main script for the noderelationships module. It merely contains the implementation of hooks invoked by Drupal core, CCK, Views, etc. All common functions are externalized into several scripts that are included on demand.
Code
function noderelationships_node_type($op, $info) {
module_load_include('inc', 'noderelationships');
if ($op == 'update') {
// Deal with content type name changes.
if (!empty($info->old_type) && $info->old_type != $info->type) {
noderelationships_settings_rename_type($info->old_type, $info->type);
}
}
elseif ($op == 'delete') {
// Delete relationship settings related to the content type being deleted.
noderelationships_settings_delete("type_name = '%s' OR related_type = '%s'", array(
$info->type,
$info->type,
));
}
// Clear cached information about relationships (all operations).
noderelationships_cache_clear();
}