You are here

function spaces_og_spaces_node_links_alter in Spaces 5.2

Implementation of hook_spaces_node_links_alter().

File

./spaces_og.module, line 936

Code

function spaces_og_spaces_node_links_alter(&$links) {
  $space = spaces_get_space();

  // If we are not in an OG space, remove all node links for OG
  // enabled content types to prevent users from submitting nodes
  // outside of a group context.
  if ($space && $space->type != 'og' || !$space) {
    foreach ($links as $type => $link) {
      if (!og_is_omitted_type($type) && !og_is_group_type($type)) {
        unset($links[$type]);
      }
    }
  }
}