Skip to content

Commit

Permalink
MDL-6914 max upload file size now printed automatically as part of up…
Browse files Browse the repository at this point in the history
…load label
  • Loading branch information
skodak committed Nov 22, 2006
1 parent d01a38c commit 3f3944b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/form/file.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,19 @@ function setHelpButton($helpbuttonargs, $function='helpbutton'){
function getHelpButton(){
return $this->_helpbutton;
}

/**
* Override createElement event to add max files
*/
function onQuickFormEvent($event, $arg, &$caller)
{
if ($event == 'createElement') {
$className = get_class($this);
$this->$className($arg[0], $arg[1].' ('.get_string('maxsize', '', display_size($caller->getMaxFileSize())).')', $arg[2]);
return true;
}
return parent::onQuickFormEvent($event, $arg, $caller);
} // end func onQuickFormEvent

}
?>

0 comments on commit 3f3944b

Please sign in to comment.