summaryrefslogtreecommitdiff
path: root/smartyplugins/function.required.php
diff options
context:
space:
mode:
Diffstat (limited to 'smartyplugins/function.required.php')
-rw-r--r--smartyplugins/function.required.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/smartyplugins/function.required.php b/smartyplugins/function.required.php
new file mode 100644
index 0000000..05f6767
--- /dev/null
+++ b/smartyplugins/function.required.php
@@ -0,0 +1,25 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * smarty_function_required
+ */
+function smarty_function_required( $pParams, &$gBitSmarty ) {
+ require_once $gBitSmarty->_get_plugin_filepath('function','biticon');
+ $biticon = array(
+ 'ipackage' => 'icons',
+ 'iname' => 'emblem-important',
+ 'iexplain' => 'Required',
+ );
+ $ret = smarty_function_biticon( $biticon, $gBitSmarty );
+
+ if( !empty( $pParams['legend'] )) {
+ $ret = "<p>$ret ".tra( "Elements marked with this symbol are required." )."</p>";
+ }
+ return $ret;
+}
+?>