diff options
-rw-r--r-- | app/class/form.class.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/class/form.class.php b/app/class/form.class.php index 9f103ba..e748afc 100644 --- a/app/class/form.class.php +++ b/app/class/form.class.php @@ -13,6 +13,7 @@ class Form $this->textFields = array(); $this->numbFields = array(); $this->enumFields = array(); + $this->fileFields = array(); $this->errorlist = array(); } @@ -86,6 +87,22 @@ class Form } /* + * Add new file field to the form + */ + function field_file($name, $maxsize, $allowed_mime = null, $req = false) + { + if ($req !== true) + $req = false; + + $this->fileFields[] = array( + 'name' => $name, + 'maxsize' => $maxsize, + 'mime' => $allowed_mime, + 'req' => $req + ); + } + + /* * Populate the form with input data from web page */ function populate($input) |