function maxlength_node_type in Maxlength 5.2
Same name and namespace in other branches
- 5 maxlength.module \maxlength_node_type()
- 6.2 maxlength.module \maxlength_node_type()
- 6 maxlength.module \maxlength_node_type()
Implementation of hook_node_type().
File
- ./
maxlength.module, line 267
Code
function maxlength_node_type($op, $info) {
$labels = array(
'title',
'js_title',
'text_title',
'body',
'js_body',
'text_body',
);
switch ($op) {
case 'delete':
foreach ($labels as $label) {
variable_del(MAXLENGTH_NODE_TYPE . $label . $info->type);
}
break;
case 'update':
if (!empty($info->old_type) && $info->old_type != $info->type) {
foreach ($labels as $label) {
$old_var = variable_get(MAXLENGTH_NODE_TYPE . $label . $info->old_type, '');
variable_set(MAXLENGTH_NODE_TYPE . $label . $info->type, $old_var);
variable_del(MAXLENGTH_NODE_TYPE . $label . $info->old_type);
}
}
break;
}
}