function og_subgroups_outline_submit in Subgroups for Organic groups 5
Same name and namespace in other branches
- 5.4 og_subgroups.module \og_subgroups_outline_submit()
Handles subgroups form submissions.
File
- ./
og_subgroups.module, line 412 - Maintains subgroups hierarchy created by the orgainc groups module.
Code
function og_subgroups_outline_submit($form_id, $form_values) {
$op = $form_values['op'];
$node = node_load($form_values['nid']);
switch ($op) {
case t('Set subgroups'):
if ($form_values['parent']) {
og_subgroups_set_hierarchy('insert', $node, $form_values['parent'], FALSE, $form_values['log']);
}
drupal_set_message(t('The subgroup has been set.'));
break;
case t('Update subgroups'):
if ($form_values['parent']) {
og_subgroups_set_hierarchy('update', $node, $form_values['parent'], FALSE, $form_values['log']);
}
else {
og_subgroups_remove_hierarchy($node);
}
drupal_set_message(t('The subgroup has been updated.'));
break;
case t('Remove group from subgroups'):
og_subgroups_remove_hierarchy($node);
drupal_set_message(t('Group has been removed from subgroups.'));
break;
}
return "node/{$node->nid}";
}