default.inc

Go to the documentation of this file.
00001 <?php
00002 // $Id: default.inc,v 1.1.2.7 2008/07/08 00:25:43 merlinofchaos Exp $
00003 
00004 /**
00005  * @file styles/block.inc
00006  * Definition of the 'default' panel style.
00007  */
00008 
00009 // ---------------------------------------------------------------------------
00010 // Panels hooks.
00011 
00012 /**
00013  * Implementation of hook_panels_style_info().
00014  */
00015 function panels_default_panels_styles() {
00016   return array(
00017     'default' => array(
00018       'title' => t('Default'),
00019       'description' => t('The default panel rendering style; displays each pane with a separator.'),
00020       'render panel' => 'panels_default_style_render_panel',
00021     ),
00022   );
00023 }
00024 
00025 // ---------------------------------------------------------------------------
00026 // Panels style plugin callbacks.
00027 
00028 /**
00029  * Render callback.
00030  *
00031  * @ingroup themeable
00032  */
00033 function theme_panels_default_style_render_panel($display, $panel_id, $panes, $settings) {
00034   $output = '';
00035 
00036   $print_separator = FALSE;
00037   foreach ($panes as $pane_id => $content) {
00038     // Add the separator if we've already displayed a pane.
00039     if ($print_separator) {
00040       $output .= '<div class="panel-separator"></div>';
00041     }
00042     $output .= $text = panels_render_pane($content, $display->content[$pane_id], $display);
00043 
00044     // If we displayed a pane, this will become true; if not, it will become
00045     // false.
00046     $print_separator = (bool) $text;
00047   }
00048 
00049   return $output;
00050 }
00051 

Generated on Sun Sep 5 05:00:14 2010 for Panels 2 by  doxygen 1.5.6