function og_subgroups_tree_recurse in Subgroups for Organic groups 5
Same name and namespace in other branches
- 5.4 og_subgroups.module \og_subgroups_tree_recurse()
Helper function for og_subgroups_tree().
1 call to og_subgroups_tree_recurse()
- og_subgroups_tree in ./
og_subgroups.module - Returns an array of titles and groups nids in tree hiearachy order.
File
- ./
og_subgroups.module, line 484 - Maintains subgroups hierarchy created by the orgainc groups module.
Code
function og_subgroups_tree_recurse($gid, $exclude, $inaccessibale, $tree, $indent) {
$children = og_subgroups_get_family($gid, 'down');
foreach ($children as $node) {
if ($node->gid != $exclude) {
!in_array($node->gid, $inaccessibale) ? $title = $node->title : ($title = '<private group>');
$tree[$node->gid] = $indent . ' ' . $title;
$tree = og_subgroups_tree_recurse($node->gid, $exclude, $inaccessibale, $tree, $indent . '--');
}
}
return $tree;
}