You are here

function spaces_og_menu in Spaces 5.2

Same name and namespace in other branches
  1. 6.3 spaces_og/spaces_og.module \spaces_og_menu()
  2. 6 spaces_og/spaces_og.module \spaces_og_menu()
  3. 6.2 spaces_og/spaces_og.module \spaces_og_menu()
  4. 7.3 spaces_og/spaces_og.module \spaces_og_menu()
  5. 7 spaces_og/spaces_og.module \spaces_og_menu()

Implementation of hook_menu().

File

./spaces_og.module, line 457

Code

function spaces_og_menu($may_cache) {
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => "member-list",
      'callback' => 'spaces_og_wrapper',
      'callback arguments' => array(
        'member-list',
      ),
      'title' => t('Members'),
      'type' => MENU_CALLBACK,
      'access' => user_access('administer organic groups') || og_is_node_admin($group),
    );
    $items[] = array(
      'path' => "member-add",
      'callback' => 'spaces_og_wrapper',
      'callback arguments' => array(
        'member-add',
      ),
      'title' => t('Add Members'),
      'type' => MENU_CALLBACK,
      'access' => user_access('administer organic groups') || og_is_node_admin($group),
    );
  }
  else {
    if (arg(0) == 'node' && is_numeric(arg(1)) && ($node = node_load(arg(1)))) {
      if (og_is_group_type($node->type) && ($space = spaces_get_space())) {
        $spaces_items = spaces_active_space_menu($space, true, 'node/' . arg(1));
        unset($spaces_items['spaces/settings']);
        $items = $items + $spaces_items;
      }
    }
  }
  return $items;
}