You are here

function panels_get_panel_style_and_settings in Panels 6.3

Same name and namespace in other branches
  1. 5.2 panels.module \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_renderer_legacy::render_region in plugins/display_renderers/panels_renderer_legacy.class.php
Render a single panel region.

File

includes/display-render.inc, line 85
Contains Panels display rendering functions.

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[$panel]['style']) || $panel_settings[$panel]['style'] == -1) {
    if (empty($panel_settings['style'])) {
      return array(
        panels_get_style('default'),
        array(),
      );
    }
    $style = panels_get_style($panel_settings['style']);
    $style_settings = isset($panel_settings['style_settings']['default']) ? $panel_settings['style_settings']['default'] : array();
  }
  else {
    $style = panels_get_style($panel_settings[$panel]['style']);
    $style_settings = isset($panel_settings['style_settings'][$panel]) ? $panel_settings['style_settings'][$panel] : array();
  }
  return array(
    $style,
    $style_settings,
  );
}