summaryrefslogtreecommitdiff
path: root/smartyplugins
diff options
context:
space:
mode:
authorspiderr <spiderr@bitweaver.org>2022-06-01 20:58:56 -0400
committerspiderr <spiderr@bitweaver.org>2022-06-01 20:58:56 -0400
commit9a4552876a22ab2466ac9297af11db59e7857af9 (patch)
tree83704a427f2bf6538cb1f37696d4ba98cb4e68a6 /smartyplugins
parent4349987f08fb536fa8b9b51e81d1723171e3cc8e (diff)
downloadthemes-9a4552876a22ab2466ac9297af11db59e7857af9.tar.gz
themes-9a4552876a22ab2466ac9297af11db59e7857af9.tar.bz2
themes-9a4552876a22ab2466ac9297af11db59e7857af9.zip
add fieldset smarty plugin
Diffstat (limited to 'smartyplugins')
-rw-r--r--smartyplugins/block.fieldset.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/smartyplugins/block.fieldset.php b/smartyplugins/block.fieldset.php
new file mode 100644
index 0000000..642c075
--- /dev/null
+++ b/smartyplugins/block.fieldset.php
@@ -0,0 +1,30 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty {form} block plugin
+ *
+ * Type: block
+ * Name: form
+ * Input:
+ * - fieldset (optional) - text that appears in the legend
+ */
+function smarty_block_fieldset($params, $content, &$gBitSmarty) {
+ if( $content ) {
+ $attributes = '';
+ $attributes .= !empty( $params['class'] ) ? ' class="'.$params['class'].'" ' : '' ;
+ $attributes .= !empty( $params['id'] ) ? ' id="'.$params['id'].'" ' : '' ;
+ $ret = '<fieldset '.$attributes.'>';
+ if( !empty( $params['legend'] ) ) {
+ $ret .= '<legend>'.tra( $params['legend'] ).'</legend>';
+ }
+ $ret .= $content;
+ $ret .= '</fieldset>';
+ return $ret;
+ }
+}
+?>