function _og_subgroups_propogate_user_get_tree in Subgroups for Organic groups 5
Same name and namespace in other branches
- 5.4 og_subgroups.module \_og_subgroups_propogate_user_get_tree()
Helper function for og_subgroups_propogate_user().
Parameters
$gid: The group id.
Return value
Array with the group nids for propagation.
2 calls to _og_subgroups_propogate_user_get_tree()
- og_subgroups_propogate_user in ./
og_subgroups.module - Propagates members and admins along the subgroups tree.
- og_subgroups_propogate_user_removal in ./
og_subgroups.module
File
- ./
og_subgroups.module, line 640 - Maintains subgroups hierarchy created by the orgainc groups module.
Code
function _og_subgroups_propogate_user_get_tree($gid) {
$tree = array();
$directions = variable_get('og_subgroups_propagate_members', array());
foreach ($directions as $direction) {
if ($direction) {
// Get the groups member should be propagated.
$trees = og_subgroups_get_all_family($gid, $direction);
foreach ($trees as $group) {
$tree[$group->gid] = $group->title;
}
}
}
return $tree;
}