function _og_subgroups_group_select_options_without_family in Subgroups for Organic groups 6
Helper function to generate a list of select options of groups that do not have a hierarchy, meaning they are not in a family
Parameters
$only_enabled: If TRUE, only return groups which are subgroups-enabled. Defaults to FALSE.
2 calls to _og_subgroups_group_select_options_without_family()
- og_subgroups_group_select_options in includes/
form.inc - Create form select options for the subgroup selector
- og_subgroups_hs_hierarchical_select_root_level in modules/
og_subgroups_hs/ og_subgroups_hs.module - Implementation of hook_hierarchical_select_root_level().
File
- includes/
form.inc, line 147
Code
function _og_subgroups_group_select_options_without_family($only_enabled = FALSE) {
og_subgroups_include('tree');
$options = array();
// Fetch the groups not in a family
$groups = og_subgroups_get_groups_without_family();
// Iterate the groups
foreach ($groups as $group) {
// Make sure this type is subgroups-enabled, if we're checking
if ($only_enabled && !og_subgroups_is_subgroup_type($group->type)) {
continue;
}
// Check for access
if (!og_subgroups_mask_group($group, TRUE)) {
$options[$group->nid] = $group->title;
}
}
return $options;
}