diff options
Diffstat (limited to 'smarty_bit/block.jstabs.php')
| -rw-r--r-- | smarty_bit/block.jstabs.php | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/smarty_bit/block.jstabs.php b/smarty_bit/block.jstabs.php index 8124fc1..b34aa85 100644 --- a/smarty_bit/block.jstabs.php +++ b/smarty_bit/block.jstabs.php @@ -13,12 +13,21 @@ * Input: * Abstract: Used to enclose a set of tabs */ -function smarty_block_jstabs($params, $content, &$gBitSmarty) { +function smarty_block_jstabs( $params, $content, &$gBitSmarty ) { global $gBitSystem; - $ret = '<div class="tabpane">'.$content.'</div>'; - if( $gBitSystem->mPrefs['disable_jstabs'] != 'y' ) { - $ret .= "<script type=\"text/javascript\">//<![CDATA[\nsetupAllTabs();\n//]]></script>"; + extract( $params ); + + if( $gBitSystem->mPrefs['disable_jstabs'] == 'y' ) { + $ret .= '<div class="tabpane">'.$content.'</div>'; + } else { + $id = 1000000 * microtime(); + $ret .= '<div class="tabpane" id="id_'.$id.'">'; + $ret .= "<script type=\"text/javascript\">//<![CDATA[\ntabPane = new WebFXTabPane( document.getElementById( 'id_".$id."' ), true );\n//]]></script>"; + $ret .= $content; + $ret .= "<script type=\"text/javascript\">//<![CDATA[\nsetupAllTabs();\nvar tabPane;".( !empty( $tab ) ? "\ntabPane.setSelectedIndex( $tab );" : '' )."\n//]]></script>"; + $ret .= '</div>'; } + return $ret; } ?> |
