function maxlength_node_type in Maxlength 5
Same name and namespace in other branches
- 5.2 maxlength.module \maxlength_node_type()
- 6.2 maxlength.module \maxlength_node_type()
- 6 maxlength.module \maxlength_node_type()
File
- ./
maxlength.module, line 207
Code
function maxlength_node_type($op, $info) {
switch ($op) {
case 'delete':
$code = MAXLENGTH_NODE_TYPE . $info->type;
variable_del($code . '_t');
variable_del($code . '_b');
break;
case 'update':
if (!empty($info->old_type) && $info->old_type != $info->type) {
$code_old = MAXLENGTH_NODE_TYPE . $info->old_type;
$code_new = MAXLENGTH_NODE_TYPE . $info->type;
$max_title = variable_get($code_old . '_t', '');
$max_body = variable_get($code_old . '_b', '');
variable_set($code_new . '_t', $max_title);
variable_set($code_new . '_b', $max_body);
variable_del($code_old . '_t');
variable_del($code_old . '_b');
}
break;
}
}