You are here

function spaces_og_context_links_alter in Spaces 6.2

Implementation of hook_context_links_alter().

File

spaces_og/spaces_og.module, line 526

Code

function spaces_og_context_links_alter(&$links) {
  $space = spaces_get_space();
  if ($space && $space->type == 'og') {
    return;
  }
  else {

    // Yank any group-enabled node types out of the links array.
    // @TODO: implement this through access callback overrides and menu access checks.
    foreach ($links as $key => $link) {
      $args = explode('/', $link['href']);
      if ($args[0] == 'node' && $args[1] == 'add' && ($type = $args[2])) {
        $type = str_replace('-', '_', $type);
        if (!og_is_omitted_type($type) && !og_is_group_type($type)) {
          unset($links[$key]);
        }
      }
    }
  }
}