summaryrefslogtreecommitdiff
path: root/smartyplugins/block.jstab.php
diff options
context:
space:
mode:
Diffstat (limited to 'smartyplugins/block.jstab.php')
-rw-r--r--smartyplugins/block.jstab.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/smartyplugins/block.jstab.php b/smartyplugins/block.jstab.php
new file mode 100644
index 0000000..7c8ccc9
--- /dev/null
+++ b/smartyplugins/block.jstab.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty {jstab} block plugin
+ *
+ * Type: block
+ * Name: jstab
+ * Input:
+ * Abstract: Used to enclose a set of tabs
+ */
+
+function smarty_block_jstab( $pParams, $pContent, &$gBitSmarty ) {
+
+ // 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' );
+
+ $ret = '<div class="tabpage' . $pClass . '">';
+ $ret .= '<h4 class="tab' . $tClass . '"' . $tClick . '>' . $tTitle . '</h4>';
+ $ret .= $pContent;
+ $ret .= '</div>';
+
+ return $ret;
+}
+?>