You are here

function _og_subgroups_prop_groups_by_direction in Subgroups for Organic groups 6

Retrieve all groups from the hierarchy of a given group in a given direction

Parameters

$group: The group object, or group ID

$direction: The direction to move along the tree (parents, children, siblings)

Return value

An array of groups located in the desired direction in the tree

3 calls to _og_subgroups_prop_groups_by_direction()
og_subgroups_prop_confirm_unsubscribe in modules/og_subgroups_prop/includes/pages.inc
Menu callback function. Override OG's unsubscribe confirm form
og_subgroups_prop_propagate_content in modules/og_subgroups_prop/og_subgroups_prop.module
Propagates content along the subgroups tree.
og_subgroups_prop_propagate_user in modules/og_subgroups_prop/og_subgroups_prop.module
Propagate user memberships along a groups tree

File

modules/og_subgroups_prop/og_subgroups_prop.module, line 243

Code

function _og_subgroups_prop_groups_by_direction($group, $direction) {

  // Load tree functions
  og_subgroups_include('tree');

  // Determine necessary function to use
  $function = "og_subgroups_get_group_{$direction}";

  // Make sure the function exists
  if (function_exists($function)) {

    // Retrieve the tree in the given direction
    $groups = $function($group, FALSE);
  }
  return $groups ? $groups : array();
}