You are here

function panels_get_panel_style_and_settings in Panels 5.2

Same name and namespace in other branches
  1. 6.3 includes/display-render.inc \panels_get_panel_style_and_settings()
  2. 6.2 includes/display-render.inc \panels_get_panel_style_and_settings()

Given a display and the id of a panel, get the style in which to render that panel.

1 call to panels_get_panel_style_and_settings()
panels_render_panel in ./panels.module
Render a panel, by storing the content of each pane in an appropriate array and then passing through to the theme function that will render the panel in the configured panel style.

File

./panels.module, line 1150
panels.module Core API for Panels. Provides display editing and rendering capabilities.

Code

function panels_get_panel_style_and_settings($panel_settings, $panel) {
  if (empty($panel_settings)) {
    return array(
      panels_get_style('default'),
      array(),
    );
  }
  if (empty($panel_settings['individual']) || empty($panel_settings['panel'][$panel]['style'])) {
    $style = panels_get_style($panel_settings['style']);
    $style_settings = $panel_settings['style_settings']['default'];
  }
  else {
    $style = panels_get_style($panel_settings['panel'][$panel]['style']);
    $style_settings = $panel_settings['style_settings'][$panel];
  }
  return array(
    $style,
    $style_settings,
  );
}