diff --git a/form.php b/form.php index b07bd35..bed3583 100644 --- a/form.php +++ b/form.php @@ -52,15 +52,12 @@ class form - [readonly] : put a read-only flag on the field (the user see it but can't interract on it. The value will be sent to next page - - [verify] : Tests to verify with error priority and associated - message (%s is replaced by field selected value). Order - test from main tests to minor tests. - \$tmpfield can be used as a copy of the current field, - to check the defaults per example - [mandatory] : boolean to add a red star at end of label - [hidden] : hide the field (add a style='display:hidden' to the field) - [prefix] : the prefix added to the name (in XXX/YYY/ZZZ form). Will form an array to the result + - [rows] : Number of rows + - [cols] : Number of columns @param array $fields The fields to be displayed */ @@ -116,49 +113,11 @@ class form checked @param array $fieldsVerify The fields to verify @param array|null $valuesVerify The values of the fields to verify + @deprecated 0.17 */ public function verify (&$fieldsVerify, $valuesVerify = NULL) { -// TODO : Remove this function or be cleaner ! -die ("FORM/VERIFY : UNUSED and dirty\n"); - $ret = array (); - if ($this->debug) - echo "
";
- foreach ($fieldsVerify as $field)
- {
- if (!isset ($field->verify))
- continue;
- if (!isset ($valuesVerify[$field->name]))
- throw new Exception ("No value provided for $field->name", 500);
- foreach ($field->verify as $test => $message)
- {
- $func = sprintf ($test, addslashes ($valuesVerify[$field->name]));
- if ($this->debug)
- echo "VERIFY: \"$func\" => ";
- $tmpfield = $field;
- $res = addslashes (serialize ($tmpfield));
- // TODO : http://fr2.php.net/manual/en/reflectionfunction.invokeargs.php
- // to remove eval ?
- $rc = eval ("\$tmpfield=unserialize(stripslashes('$res'));".
- "return $func;");
- if ($this->debug)
- var_dump ($rc);
- if ($rc !== FALSE)
- {
- $ret[$field->name] = $message;
- $field->error = $message;
- break;
- }
- }
- }
- if ($this->debug)
- {
- echo "RESULT: ";
- var_dump ($ret);
- echo "";
- }
-
- return $ret;
+ die ("FORM/VERIFY : UNUSED and deprecated\n");
}
/** Return the fields in HTML code. If $values is provided, use it in place
@@ -199,7 +158,7 @@ die ("FORM/VERIFY : UNUSED and dirty\n");
switch ($field->type)
{
case "checkbox":
- // No $field->multiple
+ // No $field->multiple, $field->rows $field->cols
// values !
$res .= "