/** * FormHandler::uploadField() * * Create a uploadField on the form * * @param string $title: The title of the field * @param string $name: The name of the field * @param array $config: The configuration used for the field * @param string $validator: The validator which should be used to validate the value of the field * @param string $extra: CSS, Javascript or other which are inserted into the HTML tag * @param string $alertOverwrite: Do we have to alert the user when he/she is going to overwrite a file? * @return void * @access public * @author Teye Heimans */ function uploadField($title, $name, $config = array(), $validator = null, $extra = null, $alertOverwrite = null) { require_once FH_INCLUDE_DIR . 'fields/class.UploadField.php'; // create a new uploadfield $fld = new UploadField($this, $name, $config); if (!empty($validator)) { $fld->setValidator($validator); } if (!empty($extra)) { $fld->setExtra($extra); } if (!is_null($alertOverwrite)) { $fld->setAlertOverwrite($alertOverwrite); } // register the field $this->_registerField($name, $fld, $title); // set that this form is using uploadfields $this->_upload[] = $name; }