Smutty

MVC Framework

View Code: function.tabgroup

Browse: All · Classes · Plugins

1
<?php
2
3
function smutty_function_tabgroup( $params, $smarty ) {
4
5
$smarty->depend( 'modifier', 'escape' );
6
$smarty->depend( 'function', 'ajax_libs' );
7
8
$pages = v( $params, 'pages' );
9
if ( !is_array($pageData) )
10
$pages = Smutty_Utils::strToHash( $pages );
11
$class = v( $params, 'class' );
12
$linkStyle = $class ? ''
13
: 'background-color:#ddd;' .
14
'margin-right:10px;' .
15
'padding:5px 10px 1px 10px;' .
16
'border:1px #ddd solid;' .
17
'border-bottom:none;' .
18
'font-size:1.3em;';
19
$html = '';
20
21
$html .= smutty_function_ajax_libs( array(), $smarty );
22
23
if ( !$class )
24
$html .= '<style type="text/css">A.currentTab{font-weight:bold;}</style>';
25
26
$html .= Smutty_Smarty::htmlElement( 'div', array(
27
'id' => v( $params, 'id' ),
28
'class' => $class
29
), $smarty );
30
31
foreach ( $pages as $id => $name )
32
$html .= Smutty_Smarty::htmlElement( 'a', array(
33
'id' => 'TabPageLink' . $id,
34
'href' => 'javascript:smutty_tabPageShow(\'' . $id . '\');',
35
'style' => $linkStyle
36
), $smarty ) .
37
smarty_modifier_escape($name) . '</a>';
38
39
return $html .= '</div>';
40
41
}
42
43
function smarty_function_tabgroup( $params, $smarty ) {
44
echo smutty_function_tabgroup( $params, $smarty );
45
}
46
47
?>

The code shown here is the code that is currently running this site. If you want to view the latest SVN version of the code then go to the Subversion repository.