185 |
} |
} |
186 |
print "<input type=\"hidden\" name=\"inputs_required[]\" value=\"$name\">"; |
print "<input type=\"hidden\" name=\"inputs_required[]\" value=\"$name\">"; |
187 |
} |
} |
188 |
|
|
189 |
|
// not strictly smarty, but it should be here and not in common.inc |
190 |
|
|
191 |
|
function check_required() { |
192 |
|
global $inputs_required; |
193 |
|
global $inputs_required_type; |
194 |
|
$ok=1; |
195 |
|
if (isset($inputs_required)) { |
196 |
|
foreach ($inputs_required as $i) { |
197 |
|
if (! isset($GLOBALS[$i]) || $GLOBALS[$i] == "") $ok=0; |
198 |
|
switch (strtolower($inputs_required_type[$i])) { |
199 |
|
case 'email': |
200 |
|
if (!strstr($GLOBALS[$i],'@')) $ok=0; |
201 |
|
} |
202 |
|
// print "$i: $GLOBALS[$i] type: $inputs_required_type[$i] $ok -- "; |
203 |
|
|
204 |
|
} |
205 |
|
} else { |
206 |
|
print "<!-- no inputs required -->"; |
207 |
|
} |
208 |
|
return $ok; |
209 |
|
} |
210 |
|
|
211 |
?> |
?> |