Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 310 and 401] [Versions 311 and 401] [Versions 39 and 401] [Versions 400 and 401] [Versions 401 and 403]

FileManager form element Contains HTML class for a filemanager form element

Copyright: 2009 Dongsheng Cai <dongsheng@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 484 lines (16 kb)
Included or required:0 times
Referenced: 1 time
Includes or requires: 1 file
 lib/form/templatable_form_element.php

Defines 3 classes

MoodleQuickForm_filemanager:: (2 methods):
  __construct()
  MoodleQuickForm_filemanager()

name:: (18 methods):
  onQuickFormEvent()
  setName()
  getName()
  setValue()
  getValue()
  getMaxbytes()
  setMaxbytes()
  getAreamaxbytes()
  setAreamaxbytes()
  getSubdirs()
  setSubdirs()
  getMaxfiles()
  setMaxfiles()
  getHelpButton()
  getElementTemplateType()
  toHtml()
  export_for_template()
  validateSubmitValue()

form_filemanager:: (2 methods):
  __construct()
  get_nonjsurl()


Class: MoodleQuickForm_filemanager  - X-Ref

Filemanager form element

FilemaneManager lets user to upload/manage multiple files
__construct($elementName=null, $elementLabel=null, $attributes=null, $options=null)   X-Ref
Constructor

param: string $elementName (optional) name of the filemanager
param: string $elementLabel (optional) filemanager label
param: array $attributes (optional) Either a typical HTML attribute string
param: array $options set of options to initalize filemanager

MoodleQuickForm_filemanager($elementName=null, $elementLabel=null, $attributes=null, $options=null)   X-Ref
Old syntax of class constructor. Deprecated in PHP7.


Class: name  - X-Ref

onQuickFormEvent($event, $arg, &$caller)   X-Ref
Called by HTML_QuickForm whenever form event is made on this element

param: string $event Name of event
param: mixed $arg event arguments
param: object $caller calling object
return: bool

setName($name)   X-Ref
Sets name of filemanager

param: string $name name of the filemanager

getName()   X-Ref
Returns name of filemanager

return: string

setValue($value)   X-Ref
Updates filemanager attribute value

param: string $value value to set

getValue()   X-Ref
Returns filemanager attribute value

return: string

getMaxbytes()   X-Ref
Returns maximum file size which can be uploaded

return: int

setMaxbytes($maxbytes)   X-Ref
Sets maximum file size which can be uploaded

param: int $maxbytes file size

getAreamaxbytes()   X-Ref
Returns the maximum size of the area.

return: int

setAreamaxbytes($areamaxbytes)   X-Ref
Sets the maximum size of the area.

param: int $areamaxbytes size limit

getSubdirs()   X-Ref
Returns true if subdirectoy can be created, else false

return: bool

setSubdirs($allow)   X-Ref
Set option to create sub directory, while uploading  file

param: bool $allow true if sub directory can be created.

getMaxfiles()   X-Ref
Returns maximum number of files which can be uploaded

return: int

setMaxfiles($num)   X-Ref
Sets maximum number of files which can be uploaded.

param: int $num number of files

getHelpButton()   X-Ref
Returns html for help button.

return: string html for help button

getElementTemplateType()   X-Ref
Returns type of filemanager element

return: string

toHtml()   X-Ref
Returns HTML for filemanager form element.

return: string

export_for_template(renderer_base $output)   X-Ref
No description

validateSubmitValue($value)   X-Ref
Check that all files have the allowed type.

param: int $value Draft item id with the uploaded files.
return: string|null Validation error message or null.

Class: form_filemanager  - X-Ref

Data structure representing a file manager.

This class defines the data structure for file mnager

__construct(stdClass $options)   X-Ref
Constructor

param: stdClass $options options for filemanager

get_nonjsurl()   X-Ref
No description