|
Moodle
2.2.1
http://www.collinsharper.com
|


Public Member Functions | |
| HTML_QuickForm_file ($elementName=null, $elementLabel=null, $attributes=null) | |
| setSize ($size) | |
| getSize () | |
| freeze () | |
| setValue ($value) | |
| getValue () | |
| onQuickFormEvent ($event, $arg, &$caller) | |
| moveUploadedFile ($dest, $fileName= '') | |
| isUploadedFile () | |
| _ruleIsUploadedFile ($elementValue) | |
| _ruleCheckMaxFileSize ($elementValue, $maxSize) | |
| _ruleCheckMimeType ($elementValue, $mimeType) | |
| _ruleCheckFileName ($elementValue, $regex) | |
| _findValue () | |
Data Fields | |
| $_value = null | |
HTML class for a file type element
| _findValue | ( | ) |
Tries to find the element value from the values array
Needs to be redefined here as $_FILES is populated differently from other arrays when element name is of the form foo[bar]
private
Definition at line 320 of file file.php.


| _ruleCheckFileName | ( | $ | elementValue, |
| $ | regex | ||
| ) |
| _ruleCheckMaxFileSize | ( | $ | elementValue, |
| $ | maxSize | ||
| ) |
| _ruleCheckMimeType | ( | $ | elementValue, |
| $ | mimeType | ||
| ) |
Checks if the given element contains an uploaded file of the right mime type
| array | Uploaded file info (from $_FILES) |
| mixed | Mime Type (can be an array of allowed types) private |
Definition at line 278 of file file.php.

| _ruleIsUploadedFile | ( | $ | elementValue | ) |
| freeze | ( | ) |
Freeze the element so that only its value is returned
public
Reimplemented from HTML_QuickForm_element.
| getSize | ( | ) |
| getValue | ( | ) |
Returns information about the uploaded file
Reimplemented from HTML_QuickForm_input.
| HTML_QuickForm_file | ( | $ | elementName = null, |
| $ | elementLabel = null, |
||
| $ | attributes = null |
||
| ) |
Class constructor
| string | Input field name attribute |
| string | Input field label |
| mixed | (optional)Either a typical HTML attribute string or an associative array |
Definition at line 64 of file file.php.


| isUploadedFile | ( | ) |
| moveUploadedFile | ( | $ | dest, |
| $ | fileName = '' |
||
| ) |
| onQuickFormEvent | ( | $ | event, |
| $ | arg, | ||
| &$ | caller | ||
| ) |
Called by HTML_QuickForm whenever form event is made on this element
| string | Name of event |
| mixed | event arguments |
| object | calling object |
Reimplemented from HTML_QuickForm_input.
Reimplemented in MoodleQuickForm_file.
Definition at line 163 of file file.php.

| setSize | ( | $ | size | ) |
| setValue | ( | $ | value | ) |
Sets value for file element.
Actually this does nothing. The function is defined here to override HTML_Quickform_input's behaviour of setting the 'value' attribute. As no sane user-agent uses <input type="file">'s value for anything (because of security implications) we implement file's value as a read-only property with a special meaning.
| mixed | Value for file element |
Reimplemented from HTML_QuickForm_input.