You are here

dark_blue_background.inc in Panopoly Demo 7

File

plugins/styles/dark_blue_background/dark_blue_background.inc
View source
<?php

/**
 * @file
 * Definition of the 'dark blue background' panel style.
 */
$plugin = array(
  'title' => t('Dark Blue Background'),
  'description' => t('Wraps panes in the Drupal dark blue style.'),
  'render pane' => 'panopoly_demo_dark_blue_background_render_pane',
  'render region' => 'panopoly_demo_dark_blue_background_render_region',
  'weight' => -10,
);

/**
 * Theme function for the pane style.
 */
function theme_panopoly_demo_dark_blue_background_render_pane($vars) {
  $content = $vars['content'];
  $pane = $vars['pane'];
  $display = $vars['display'];
  $plugin = $vars['style'];
  $content->css_class = (!empty($content->css_class) ? $content->css_class . ' ' : '') . 'pane-dark-blue-background';

  // if the style is gone or has no theme of its own, just display the output.
  return theme('panels_pane', array(
    'content' => $content,
    'pane' => $pane,
    'display' => $display,
  ));
}

/**
 * Theme function for the region style.
 */
function theme_panopoly_demo_dark_blue_background_render_region($vars) {
  $display = $vars['display'];
  $region_id = $vars['region_id'];
  $panes = $vars['panes'];
  $settings = $vars['settings'];
  $output = '';
  $output .= '<div class="region region-' . $vars['region_id'] . ' region-dark-blue-background">';
  $output .= implode('<div class="panel-separator"></div>', $panes);
  $output .= '</div>';
  return $output;
}

Functions

Namesort descending Description
theme_panopoly_demo_dark_blue_background_render_pane Theme function for the pane style.
theme_panopoly_demo_dark_blue_background_render_region Theme function for the region style.