View source
<?php
require_once 'maxlength.inc';
function maxlength_update_1() {
foreach (node_get_types() as $type => $name) {
$code_old = 'maxlength_node_type_' . $type;
$code_new = MAXLENGTH_NODE_TYPE . $type;
$max_title = variable_get($code_old . '_maxlength_title', '');
$max_body = variable_get($code_old . '_maxlength_body', '');
variable_set($code_new . '_t', $max_title);
variable_set($code_new . '_b', $max_body);
variable_del($code_old . '_maxlength_title');
variable_del($code_old . '_maxlength_body');
variable_del($code_old . '_limit');
variable_del($code_old . '_maxlength');
}
return array();
}
function maxlength_uninstall() {
foreach (node_get_types() as $type => $name) {
$code = MAXLENGTH_NODE_TYPE . $type;
variable_del($code . '_t');
variable_del($code . '_b');
}
}