/[drupal]/contributions/modules/panels_tabs/panels_tabs.module
ViewVC logotype

Contents of /contributions/modules/panels_tabs/panels_tabs.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download) (as text)
Wed Aug 15 07:18:33 2007 UTC (2 years, 3 months ago) by wimleers
Branch: MAIN
CVS Tags: DRUPAL-5--1-0, HEAD
Branch point for: DRUPAL-5
File MIME type: text/x-php
Initial commit of panels_tabs.module. This module provides a 'tabs' Panel style that can be used by any Panels module.
1 <?php
2 // $Id $
3
4 /**
5 * @file
6 * This module provides a configurable "tabs" panel style that can be used
7 * by any Panels module.
8 */
9
10 //----------------------------------------------------------------------------
11 // Panels hooks.
12
13 /**
14 * Implementation of hook_panels_panel_style_info().
15 */
16 function panels_tabs_panels_panel_style_info() {
17 return array(
18 'tabs' => array(
19 'label' => t('Tabs'),
20 'panels implementations' => array(),
21 ),
22 );
23 }
24
25 /**
26 * Implementation of hook_panels_panel_style_render().
27 */
28 function panels_tabs_panels_panel_style_render($display, $style, $panel_id, $panes) {
29 $output = '';
30
31 switch ($style) {
32 case 'tabs':
33 $tabs = array();
34
35 $tabs["panels-mini-$panel_id"] = array(
36 '#type' => 'tabset',
37 );
38 foreach ($panes as $pos => $pane) {
39 $tabs["panels-mini-$panel_id"]["tab_$pos"] = array(
40 '#type' => 'tabpage',
41 '#title' => $pane->subject,
42 '#content' => $pane->content,
43 );
44 }
45 $output = tabs_render($tabs);
46 break;
47 }
48
49 return $output;
50 }

  ViewVC Help
Powered by ViewVC 1.1.2