You are here

function theme_panels_block_style_render_pane in Panels 7.3

Same name and namespace in other branches
  1. 5.2 styles/block.inc \theme_panels_block_style_render_pane()
  2. 6.3 plugins/styles/block.inc \theme_panels_block_style_render_pane()
  3. 6.2 styles/block.inc \theme_panels_block_style_render_pane()

Render callback.

File

plugins/styles/block.inc, line 21
Definition of the 'block' panel style.

Code

function theme_panels_block_style_render_pane($vars) {
  $content = $vars['content'];
  $pane = $vars['pane'];
  if (empty($content->content)) {
    return;
  }
  $block = clone $content;
  if (!empty($block->title)) {
    $block->subject = $block->title;
  }
  if (!isset($block->subject)) {
    $block->subject = '';
  }
  $block->region = $pane->panel;
  if (!isset($block->module)) {
    $block->module = $block->type;
  }
  if (!isset($block->delta)) {
    $block->delta = $block->subtype;
  }
  $build = $block->content;
  if (is_string($build)) {
    $build = array(
      '#markup' => $build,
    );
  }
  $build['#block'] = $block;
  $build['#theme_wrappers'][] = 'block';

  // If using per pane classes, $block->css_class will need to be added in your
  // preprocess or template, along with any other Panels specific field you
  // might want to utilize.
  return drupal_render($build);
}