disabled check can now be done via (pearl) regular expressions, eg. /^(val1|val2)$/ to check for two values

This commit is contained in:
Ralf Becker 2006-04-24 20:42:42 +00:00
parent 9c9b127de6
commit 58cd8de0ce

View File

@ -111,7 +111,7 @@
{ {
$check_val = $this->get_array($content,substr($check_val,1)); $check_val = $this->get_array($content,substr($check_val,1));
} }
$result = count($vals) == 1 ? $val != '' : $val == $check_val; $result = count($vals) == 1 ? $val != '' : ($check_val{0} == '/' ? preg_match($check_val,$val) : $val == $check_val);
if ($not) $result = !$result; if ($not) $result = !$result;
//echo "<p>check_disabled: '".($not?'!':'')."$disabled' = '$val' ".(count($vals) == 1 ? '' : ($not?'!':'=')."= '$check_val'")." = ".($result?'True':'False')."</p>\n"; //echo "<p>check_disabled: '".($not?'!':'')."$disabled' = '$val' ".(count($vals) == 1 ? '' : ($not?'!':'=')."= '$check_val'")." = ".($result?'True':'False')."</p>\n";
return $result; return $result;