Smarty
[ class tree: Smarty ] [ index: Smarty ] [ all elements ]

Source for file function.minifind.php

Documentation is available at function.minifind.php

  1. <?php
  2. /**
  3.  * Smarty plugin
  4.  * @package Smarty
  5.  * @subpackage plugins
  6.  */
  7.  
  8. /**
  9.  * Smarty {minifind} function plugin
  10.  *
  11.  * Type:     function
  12.  * Name:     minifind
  13.  * 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.
  14.  * Output:   a small form that allows you to search your table using $_REQUEST['find'] as search value
  15.  */
  16. function smarty_function_minifind($params, &$gBitSmarty) {
  17.     
  18.     if(isset($params['legend'])) {
  19.         $legend = $params['legend'];
  20.         unset($params['legend']);
  21.     } else {
  22.         $legend = 'find in entries';
  23.     }
  24.  
  25.     if( !empty( $params['find_name'] ) ) {
  26.         $gBitSmarty->assign( 'find_name', tra( $params['name'] ) );
  27.     }
  28.     
  29.     if( !empty( $params['prompt'] ) ) {
  30.         $gBitSmarty->assign( 'prompt', tra( $params['prompt'] ).'...' );
  31.     }
  32.     
  33.     $gBitSmarty->assign( 'legend',$legend );
  34.     $gBitSmarty->assign( 'hidden',$params );
  35.     $gBitSmarty->display( 'bitpackage:kernel/minifind.tpl' );
  36. }
  37. ?>

Documentation generated on Wed, 29 Jul 2015 13:56:39 +0000 by phpDocumentor 1.5.0-lsces