2 require_once('HTML/QuickForm/file.php');
5 * HTML class for a form element to upload a file
10 class MoodleQuickForm_file
extends HTML_QuickForm_file
{
12 * html for help button, if empty then no help
17 function MoodleQuickForm_file($elementName=null, $elementLabel=null, $attributes=null) {
18 debugging('file forms element is deprecated, please use new filepicker instead');
19 parent
::HTML_QuickForm_file($elementName, $elementLabel, $attributes);
22 * set html for help button
25 * @param array $help array of arguments to make a help button
26 * @param string $function function name to call to get html
28 function setHelpButton($helpbuttonargs, $function='helpbutton'){
29 debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
32 * set html for help button
35 * @param array $help array of arguments to make a help button
36 * @param string $function function name to call to get html
38 function getHelpButton(){
39 return $this->_helpbutton
;
43 * Override createElement event to add max files
45 function onQuickFormEvent($event, $arg, &$caller)
47 if ($event == 'createElement') {
48 $className = get_class($this);
49 $this->$className($arg[0], $arg[1].' ('.get_string('maxsize', '', display_size($caller->getMaxFileSize())).')', $arg[2]);
52 return parent
::onQuickFormEvent($event, $arg, $caller);
53 } // end func onQuickFormEvent
55 * Slightly different container template when frozen.
59 function getElementTemplateType(){
60 if ($this->_flagFrozen
){