function og_subgroups_update_6000 in Subgroups for Organic groups 6
Convert existing propagation variables
File
- ./
og_subgroups.install, line 62 - Installs and updates the necessary tables required by the OG Subgroups module.
Code
function og_subgroups_update_6000() {
// The propagation portion of this package has been moved
// to a separate submodule
// The variable values have also changed, so to be safe, we
// need to check for existing values and modify them accordingly
$vars = array(
'og_subgroups_propagate_content',
'og_subgroups_propagate_members',
'og_subgroups_propagate_demote',
);
foreach ($vars as $var) {
if ($setting = variable_get($var, NULL)) {
$new_setting = array();
foreach ($setting as $key => $value) {
switch ($key) {
case 'up':
$new_setting['parents'] = 'parents';
break;
case 'down':
$new_setting['children'] = 'children';
break;
case 'side':
$new_setting['siblings'] = 'siblings';
break;
}
}
variable_set($var, $new_setting);
}
}
// Remove variable no longer in use
variable_del('og_subgroups_propagate_demote');
}