Public Member Functions | |
| __construct ($name, $uploaddir) | |
| Create a new file upload control. | |
| build_widget () | |
| Render the minimal HTML needed for this control to work. | |
| get_fileinfo () | |
| Returns information about the upload. | |
| get_filename () | |
| Returns the name of the file uploaded by the user. | |
| process () | |
| Process this fileupload. | |
| fill ($values) | |
| Set the value by the filename of the uploaded file, but only if a file is uploaded. | |
Validation methods | |
| is_valid () | |
| Check whether this form control is valid. | |
Static Public Member Functions | |
| static | make_unique ($path, $filename, $max=99) |
| Returns a filename which is unique in the given path. | |
Definition at line 14 of file fileupload.lib.php.
| AnewtFormControlFileUpload::__construct | ( | $ | name, | |
| $ | uploaddir | |||
| ) |
Create a new file upload control.
| $name | The name of this control. | |
| $uploaddir | The directory to upload the files to. |
Definition at line 25 of file fileupload.lib.php.
| AnewtFormControlFileUpload::build_widget | ( | ) |
Render the minimal HTML needed for this control to work.
Form control implementations should implement this method, e.g. for a checkbox a simple input HTML element should be returned.
Reimplemented from AnewtFormControl.
Definition at line 45 of file fileupload.lib.php.
| AnewtFormControlFileUpload::is_valid | ( | ) |
Check whether this form control is valid.
The default is to apply all validators added to this control. Subclasses could also override this method to do something more sensible than applying validators, since some controls don't accept validators, e.g. checkboxes.
Reimplemented from AnewtFormControl.
Definition at line 147 of file fileupload.lib.php.
| AnewtFormControlFileUpload::get_fileinfo | ( | ) |
Returns information about the upload.
This will be the contents of $_FILES[$control_name] or null if that does not exist.
Definition at line 195 of file fileupload.lib.php.
| AnewtFormControlFileUpload::process | ( | ) |
Process this fileupload.
This will put the file in the $uploaddir directory.
Definition at line 226 of file fileupload.lib.php.
| static AnewtFormControlFileUpload::make_unique | ( | $ | path, | |
| $ | filename, | |||
| $ | max = 99 | |||
| ) | [static] |
Returns a filename which is unique in the given path.
FIXME: might not be the proper place for this function.
| $path | The path where to check the file. | |
| $filename | The base filename. | |
| $max | The maximum number of iterations to try. Defaults to 99. |
Definition at line 307 of file fileupload.lib.php.
1.5.9