/[corp_html]/inc/Smarty.local.php
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /inc/Smarty.local.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by dpavlin, Sun Mar 18 18:18:14 2001 UTC revision 1.5 by dpavlin, Sun Mar 18 23:36:26 2001 UTC
# Line 134  function smarty_mod_filesize($file,$dir, Line 134  function smarty_mod_filesize($file,$dir,
134          }          }
135  }  }
136    
137    // input functions (input, rinput)
138    
139    function smarty_func_input() {
140            extract(func_get_arg(0));
141            print "<input name=\"$name\" size=\"$size\" value=\"".$GLOBALS[$name]."\">";
142            print "<input type=\"hidden\" name=\"inputs_required[]\" value=\"$name\">";
143            if ($type) print "<input type=\"hidden\" name=\"inputs_required_type[$name]\" value=\"$type\">";
144    }
145    
146    function smarty_func_rinput() {
147            extract(func_get_arg(0));
148            global $inputs_required_type;
149            $ok=1;
150            if (! isset($GLOBALS[$name]) || $GLOBALS[$name] == "") {
151                    $ok=0;
152            } else {
153                    switch($inputs_required_type[$name]) {
154                            case 'email':
155                                    if (!strstr($GLOBALS[$name],'@')) $ok=0;
156                    }
157            }
158            if ($ok) {
159                    print "$desc";
160            } else {
161                    print "<b>$desc</b>";
162            }
163    }
164  ?>  ?>
165    

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.26