function og_subgroups_get_eligable_groups in Subgroups for Organic groups 5
Same name and namespace in other branches
- 5.4 og_subgroups.module \og_subgroups_get_eligable_groups()
Helper function to get the accessibale and inaccessiable groups.
Parameters
$op: The operation
3 calls to og_subgroups_get_eligable_groups()
- og_subgroups_block in ./
og_subgroups.module - Implementation of hook_block().
- og_subgroups_outline in ./
og_subgroups.module - Implementation of function og_subgroups_outline() Handles all subgroups outline operations.
- og_subgroups_set_hierarchy in ./
og_subgroups.module - API function to set/ update groups hierarchy.
File
- ./
og_subgroups.module, line 335 - Maintains subgroups hierarchy created by the orgainc groups module.
Code
function og_subgroups_get_eligable_groups($op) {
$eligable_groups = og_node_groups_distinguish(og_all_groups_options(), FALSE);
$return = array();
switch ($op) {
case 'accessibale':
// Get all accessible groups for the user.
foreach ($eligable_groups['accessible'] as $key => $group) {
$return[$key] = $group['title'];
}
break;
case 'inaccessibale':
// Get excluded groups.
foreach ($eligable_groups['inaccessible'] as $group) {
$return[$group] = $group;
}
}
return $return;
}