You are here

function spaces_og_context_page_reaction in Spaces 6.3

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

Implementation of 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 471

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']) {
      $bc = og_get_breadcrumb($space->group);
      $bc[0] = l(t('Home'), "", array(
        'purl' => array(
          'disabled' => TRUE,
        ),
      ));
      drupal_alter('spaces_og_breadcrumb', $bc);
      drupal_set_breadcrumb($bc);
    }
  }
}