diff options
Diffstat (limited to 'app/class/form.class.php')
-rw-r--r-- | app/class/form.class.php | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/app/class/form.class.php b/app/class/form.class.php index e398690..ffee3d7 100644 --- a/app/class/form.class.php +++ b/app/class/form.class.php @@ -11,6 +11,8 @@ class Form function __construct() { $this->textFields = array(); + $this->numbFields = array(); + $this->enumFields = array(); $this->errorlist = array(); $this->warninglist = array(); @@ -30,6 +32,41 @@ class Form 'req' => $req ); } + + /* + * Add new numeric field to the form + */ + function field_numeric($name, $req = true, $integer = true, $min = null, $max = null) + { + if ($req !== true) + $req = false; + + if ($integer !== true) + $integer = false; + + $this->numbFields[] = array( + 'name' => $name, + 'req' => $req, + 'int' => $integer, + 'min' => $min, + 'max' => $max + ); + } + + /* + * Add new enumeration field to the form + */ + function field_enum($name, $req = true, $values) + { + if ($req !== true) + $req = false; + + $this->enumFields[] = array( + 'name' => $name, + 'req' => $req, + 'vals' => $values + ); + } } ?> |