You are here

function spaces_og_context_page_reaction in Spaces 7.3

Same name and namespace in other branches
  1. 6.3 spaces_og/spaces_og.module \spaces_og_context_page_reaction()
  2. 7 spaces_og/spaces_og.module \spaces_og_context_page_reaction()

Implements hook_context_page_reaction(). Allows Spaces OG to set the breadcrumb just prior to theme('page') taking over.

File

spaces_og/spaces_og.module, line 511

Code

function spaces_og_context_page_reaction() {
  $space = spaces_get_space();
  if ($space && $space->type === 'og') {
    $item = menu_get_item();

    // Only set the breadcrumb if user has access to this page.
    if ($item['access']) {

      // TODO, og_get_breadcrumb() no longer exists, but may not be needed.
      // $bc = og_get_breadcrumb('node', $space->group);
      $bc[0] = l(t('Home'), '', array(
        'purl' => array(
          'disabled' => TRUE,
        ),
      ));
      drupal_alter('spaces_og_breadcrumb', $bc);
      drupal_set_breadcrumb($bc);
    }
  }
}