You are here

function panels_panels_page in Panels 5

1 string reference to 'panels_panels_page'
panels_menu in ./panels.module
Implementation of hook_menu()

File

./panels.module, line 737

Code

function panels_panels_page($did) {
  $panels = panels_load_panels($did);
  if (!$panels) {
    return drupal_not_found();
  }
  $layouts = panels_get_layouts();
  $layout = $layouts[$panels->layout];
  $layout['css_id'] = $panels->css_id;
  if (!$layout) {
    watchdog('panels', t('Unable to find requested layout %s', array(
      '%s' => check_plain($panels->layout),
    )));
    return drupal_not_found();
  }
  panels_is_panels_page(TRUE);
  $content_types = panels_get_content_types();
  foreach ($panels->content as $location => $list) {
    foreach ($list as $area) {
      $function = $content_types[$area->type]['callback'];
      if (function_exists($function)) {
        $content[$area->area] .= $function($area->configuration);
      }
    }
  }
  $output = panels_get_layout($layout, $content);
  drupal_set_title(filter_xss_admin($panels->title));
  return $output;
}