| 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 |
}
|