You are here

function calendar_og_groups in Calendar 6.2

Same name and namespace in other branches
  1. 5.2 calendar.module \calendar_og_groups()
  2. 5 calendar.module \calendar_og_groups()
  3. 7 calendar.module \calendar_og_groups()
  4. 7.2 calendar.module \calendar_og_groups()

Helper function to figure out a group gid to use in blocks.

@todo this may need more work.

Return value

an array of group nodes that are relevant.

File

./calendar.module, line 326
Adds calendar filtering and displays to Views.

Code

function calendar_og_groups($view) {
  if (!($groupnode = og_get_group_context())) {
    global $user;
    $groupnodes = array_keys($user->og_groups);
  }
  else {
    $groupnodes = array(
      $groupnode->nid,
    );
  }
  return $groupnodes;
}