Stripping CVS keywords
[project/panels.git] / plugins / styles / list.inc
1 <?php
2
3
4 /**
5 * @file
6 * Definition of the 'list' panel style.
7 */
8
9 // Plugin definition
10 $plugin = array(
11 'title' => t('List'),
12 'description' => t('Presents the panes in the form of an HTML list.'),
13 'render region' => 'panels_list_style_render_region',
14 'settings form' => 'panels_list_style_settings_form',
15 );
16
17 /**
18 * Render callback.
19 *
20 * @ingroup themeable
21 */
22 function theme_panels_list_style_render_region($display, $region_id, $panes, $settings) {
23 $items = array();
24
25 foreach ($panes as $pane_id => $item) {
26 if (isset($item)) {
27 $items[] = $item;
28 }
29 }
30
31 if (empty($settings['list_type'])) {
32 $settings['list_type'] = 'ul';
33 }
34
35 return theme('item_list', $items, NULL, $settings['list_type']);
36 }
37
38 /**
39 * Settings form callback.
40 */
41 function panels_list_style_settings_form($style_settings) {
42 $form['list_type'] = array(
43 '#type' => 'select',
44 '#title' => t('List type'),
45 '#options' => array(
46 'ul' => t('Unordered'),
47 'ol' => t('Ordered'),
48 ),
49 '#default_value' => (isset($style_settings['list_type'])) ? $style_settings['list_type'] : 'ul',
50 );
51
52 return $form;
53 }
54