You are here

default.inc in Panels 5.2

Same filename and directory in other branches
  1. 6.2 styles/default.inc

styles/block.inc Definition of the 'default' panel style.

File

styles/default.inc
View source
<?php

/**
 * @file styles/block.inc
 * Definition of the 'default' panel style.
 */

// ---------------------------------------------------------------------------
// Panels hooks.

/**
 * Implementation of hook_panels_style_info().
 */
function panels_default_panels_styles() {
  return array(
    'default' => array(
      'title' => t('Default'),
      'description' => t('The default panel rendering style; displays each pane with a separator.'),
      'render panel' => 'panels_default_style_render_panel',
    ),
  );
}

// ---------------------------------------------------------------------------
// Panels style plugin callbacks.

/**
 * Render callback.
 *
 * @ingroup themeable
 */
function theme_panels_default_style_render_panel($display, $panel_id, $panes, $settings) {
  $output = '';
  $print_separator = FALSE;
  foreach ($panes as $pane_id => $content) {

    // Add the separator if we've already displayed a pane.
    if ($print_separator) {
      $output .= '<div class="panel-separator"></div>';
    }
    $output .= $text = panels_render_pane($content, $display->content[$pane_id], $display);

    // If we displayed a pane, this will become true; if not, it will become
    // false.
    $print_separator = (bool) $text;
  }
  return $output;
}

Functions

Namesort descending Description
panels_default_panels_styles Implementation of hook_panels_style_info().
theme_panels_default_style_render_panel Render callback.