You are here

function og_panels_page in Organic groups 6

Same name and namespace in other branches
  1. 5.8 og_panels.module \og_panels_page()
  2. 5 og_panels.module \og_panels_page()
  3. 5.3 og_panels.module \og_panels_page()
  4. 5.7 og_panels.module \og_panels_page()

A menu callback. Renders an og_panel based upon its display ID.

Return value

void

1 string reference to 'og_panels_page'
og_panels_menu in modules/og_panels/og_panels.module

File

modules/og_panels/og_panels.module, line 256

Code

function og_panels_page($did, $group_node, $title = NULL) {
  $og_panel = og_panels_get_one_by_display($did);

  // Set breadcrumb and title on non group nodes
  if ($title) {
    drupal_set_title(check_plain($title));
  }
  if (!$og_panel->default_page) {
    $bc[] = l(t('Home'), "");
    $bc[] = l($group_node->title, "node/{$group_node->nid}");

    // I tried MSL but it let me down. again.
    // menu_set_location($bc);
    drupal_set_breadcrumb($bc);
  }

  // Mark node as read and show feed icon for any group panel page (how to do this better?)
  drupal_add_feed(url("node/{$group_node->nid}/feed"), t('@name at @site', array(
    '@name' => $group_node->title,
    '@site' => variable_get('site_name', 'drupal'),
  )));
  node_tag_new($group_node->nid);
  $allargs = func_get_args();
  $args = array_slice($allargs, 3);
  $display = og_panels_load_display($did, $group_node);
  $display->args = $args;
  $output = panels_render_display($display);

  // We print instead of return in order to allow blocks to be suppressed.
  print theme('page', $output, $og_panel->show_blocks);
}