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 39 and 401]

Filepicker form element Contains HTML class for a single filepicker form element

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

Defines 2 classes

MoodleQuickForm_filepicker:: (2 methods):
  __construct()
  MoodleQuickForm_filepicker()

name:: (6 methods):
  getHelpButton()
  getElementTemplateType()
  toHtml()
  exportValue()
  export_for_template()
  validateSubmitValue()


Class: MoodleQuickForm_filepicker  - X-Ref

Filepicker form element

HTML class for a single filepicker element (based on button)

__construct($elementName=null, $elementLabel=null, $attributes=null, $options=null)   X-Ref
Constructor

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

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


Class: name  - X-Ref

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

return: string html for help button

getElementTemplateType()   X-Ref
Returns type of filepicker element

return: string

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

return: string

exportValue(&$submitValues, $assoc = false)   X-Ref
export uploaded file

param: array $submitValues values submitted.
param: bool $assoc specifies if returned array is associative
return: array

export_for_template(renderer_base $output)   X-Ref
No description

validateSubmitValue($value)   X-Ref
Check that the file has the allowed type.

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