function cpn_update_7000 in Code per Node 7
Upgrade CPN settings from D6 to D7.
File
- ./
cpn.install, line 284 - Installation, schema and update hook implementations.
Code
function cpn_update_7000() {
// Fix the path variable.
if ($path = variable_get('cpn_path', FALSE)) {
variable_set('cpn_path', file_default_scheme() . $path);
}
// Update variables to new format.
foreach (array_keys(node_type_get_types()) as $node_type) {
foreach (array(
'css',
'js',
) as $type) {
if (variable_get('cpn_' . $type . '_' . $node_type, FALSE)) {
variable_set('cpn_' . $type . '_enabled_' . $node_type, TRUE);
variable_del('cpn_' . $type . '_' . $node_type);
}
}
}
}