diff options
Diffstat (limited to 'smartyplugins/function.minifind.php')
| -rw-r--r-- | smartyplugins/function.minifind.php | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/smartyplugins/function.minifind.php b/smartyplugins/function.minifind.php new file mode 100644 index 0000000..8615349 --- /dev/null +++ b/smartyplugins/function.minifind.php @@ -0,0 +1,33 @@ +<?php +/** + * Smarty plugin + * @package Smarty + * @subpackage plugins + */ + +/** + * Smarty {minifind} function plugin + * + * Type: function + * Name: minifind + * Input: all parameters (except legend) that are passed in will be added as <input type="hidden" name=$name value=$value>. The 'legend' parameter will be used as the form legend, a string is expected. + * Output: a small form that allows you to search your table using $_REQUEST['find'] as search value + */ +function smarty_function_minifind($params, &$gBitSmarty) { + + if(isset($params['legend'])) { + $legend = $params['legend']; + unset($params['legend']); + } else { + $legend = 'find in entries'; + } + + if( !empty( $params['prompt'] ) ) { + $gBitSmarty->assign( 'prompt', tra( $params['prompt'] ) ); + } + + $gBitSmarty->assign( 'legend',$legend ); + $gBitSmarty->assign( 'hidden',$params ); + $gBitSmarty->display( 'bitpackage:kernel/minifind.tpl' ); +} +?> |
