diff options
| author | spiderr <spider@viovio.com> | 2013-03-27 16:56:52 -0400 |
|---|---|---|
| committer | spiderr <spider@viovio.com> | 2013-03-27 16:56:52 -0400 |
| commit | 991fb491c49f1b0676df4f5edb9bd34fde9d428c (patch) | |
| tree | b7e7395f7dab2d5b386d9e632743a16e45c4ed30 /smartyplugins/block.jstab.php | |
| parent | 5b49d335739b13a0ebe47b7c3b1a0452b5c9acdf (diff) | |
| download | themes-991fb491c49f1b0676df4f5edb9bd34fde9d428c.tar.gz themes-991fb491c49f1b0676df4f5edb9bd34fde9d428c.tar.bz2 themes-991fb491c49f1b0676df4f5edb9bd34fde9d428c.zip | |
bootstrap conversions
Diffstat (limited to 'smartyplugins/block.jstab.php')
| -rw-r--r-- | smartyplugins/block.jstab.php | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/smartyplugins/block.jstab.php b/smartyplugins/block.jstab.php index 7c8ccc9..d0306a0 100644 --- a/smartyplugins/block.jstab.php +++ b/smartyplugins/block.jstab.php @@ -14,20 +14,25 @@ * Abstract: Used to enclose a set of tabs */ -function smarty_block_jstab( $pParams, $pContent, &$gBitSmarty ) { +function smarty_block_jstab( $pParams, $pContent, &$gBitSmarty, $pRepeat ) { + if( empty( $pRepeat ) ){ + global $jsTabLinks; + // if this is modified, please adjust the preg_match_all() pattern in block.jstabs.php + $pClass = isset( $pParams['class'] ) ? ' '.$pParams['class'] : ''; - // if this is modified, please adjust the preg_match_all() pattern in block.jstabs.php - $pClass = isset( $pParams['class'] ) ? ' '.$pParams['class'] : ''; + $tClass = isset( $pParams['class'] ) ? ' '.$pParams['class'] : ''; + $tClick = isset( $pParams['onclick'] ) ? ' onclick="'.$pParams['onclick'].'"' : ''; + $tTitle = tra( isset( $pParams['title'] ) ? $pParams['title'] : 'No Title' ); - $tClass = isset( $pParams['class'] ) ? ' '.$pParams['class'] : ''; - $tClick = isset( $pParams['onclick'] ) ? ' onclick="'.$pParams['onclick'].'"' : ''; - $tTitle = tra( isset( $pParams['title'] ) ? $pParams['title'] : 'No Title' ); + $tabId = strtolower( isset( $pParams['id'] ) ? $pParams['id'] : 'tab'.preg_replace("/[^A-Za-z0-9]/", '', $tTitle) ); - $ret = '<div class="tabpage' . $pClass . '">'; - $ret .= '<h4 class="tab' . $tClass . '"' . $tClick . '>' . $tTitle . '</h4>'; - $ret .= $pContent; - $ret .= '</div>'; + array_unshift( $jsTabLinks, '<li><a href="#'.$tabId.'" data-toggle="tab">' . htmlspecialchars( $tTitle ) . '</a></li>' ); - return $ret; + $ret = '<div class="tab-pane" id="'.$tabId.'">'; + $ret .= $pContent; + $ret .= '</div>'; + + return $ret; + } } ?> |
