list.inc

Go to the documentation of this file.
00001 <?php
00002 // $Id: list.inc,v 1.1.2.9 2008/10/24 00:05:59 merlinofchaos Exp $
00003 
00004 
00005 /**
00006  * @file styles/list.inc
00007  * Definition of the 'list' panel style.
00008  */
00009 
00010 
00011 // ---------------------------------------------------------------------------
00012 // Panels hooks.
00013 
00014 /**
00015  * Implementation of hook_panels_style_info().
00016  */
00017 function panels_list_panels_styles() {
00018   return array(
00019     'list' => array(
00020       'title' => t('List'),
00021       'description' => t('Presents the panes in the form of an HTML list.'),
00022       'render panel' => 'panels_list_style_render_panel',
00023       'settings form' => 'panels_list_style_settings_form',
00024       'settings validate' => 'panels_list_style_settings_validate',
00025     ),
00026   );
00027 }
00028 
00029 
00030 // ---------------------------------------------------------------------------
00031 // Panels style plugin callbacks.
00032 
00033 /**
00034  * Render callback.
00035  *
00036  * @ingroup themeable
00037  */
00038 function theme_panels_list_style_render_panel($display, $panel_id, $panes, $settings) {
00039   $items = array();
00040 
00041   foreach ($panes as $pane_id => $content) {
00042     $item = panels_render_pane($content, $display->content[$pane_id], $display);
00043     if ($item) {
00044       $items[] = $item;
00045     }
00046   }
00047   return theme('item_list', $items, NULL, $settings['list_type']);
00048 }
00049 
00050 /**
00051  * Settings form callback.
00052  */
00053 function panels_list_style_settings_form($style_settings) {
00054   $form['list_type'] = array(
00055     '#type' => 'select',
00056     '#title' => t('List type'),
00057     '#options' => array(
00058       'ul' => t('Unordered'),
00059       'ol' => t('Ordered'),
00060     ),
00061     '#default_value' => (isset($style_settings['list_type'])) ? $style_settings['list_type'] : 'ul',
00062   );
00063 
00064   return $form;
00065 }
00066 

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