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 |
|
|