Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | Public Attributes | Protected Attributes | List of all members
MoodleQuickForm_filepicker Class Reference
Inheritance diagram for MoodleQuickForm_filepicker:
templatable

Public Member Functions

 __construct ($elementName=null, $elementLabel=null, $attributes=null, $options=null)
 Constructor. More...
 
 export_for_template (renderer_base $output)
 Function to export the renderer data in a format that is suitable for a mustache template. More...
 
 exportValue (&$submitValues, $assoc=false)
 export uploaded file More...
 
 getElementTemplateType ()
 Returns type of filepicker element. More...
 
 getHelpButton ()
 Returns html for help button. More...
 
 MoodleQuickForm_filepicker ($elementName=null, $elementLabel=null, $attributes=null, $options=null)
 Old syntax of class constructor. More...
 
 toHtml ()
 Returns HTML for filepicker form element. More...
 
 validateSubmitValue ($value)
 Check that the file has the allowed type. More...
 

Public Attributes

string $_helpbutton = ''
 html for help button, if empty then no help will icon will be dispalyed.
 

Protected Attributes

array $_options = array('maxbytes'=>0, 'accepted_types'=>'*', 'return_types'=>null)
 options provided to initalize filemanager
 

Constructor & Destructor Documentation

◆ __construct()

MoodleQuickForm_filepicker::__construct (   $elementName = null,
  $elementLabel = null,
  $attributes = null,
  $options = null 
)

Constructor.

Parameters
string$elementName(optional) name of the filepicker
string$elementLabel(optional) filepicker label
array$attributes(optional) Either a typical HTML attribute string or an associative array
array$optionsset of options to initalize filepicker

Member Function Documentation

◆ export_for_template()

MoodleQuickForm_filepicker::export_for_template ( renderer_base  $output)

Function to export the renderer data in a format that is suitable for a mustache template.

This means:

  1. No complex types - only stdClass, array, int, string, float, bool
  2. Any additional info that is required for the template is pre-calculated (e.g. capability checks).
Parameters
renderer_base$outputUsed to do a final render of any components that need to be rendered for export.
Return values
stdClass|array

Implements templatable.

◆ exportValue()

MoodleQuickForm_filepicker::exportValue ( $submitValues,
  $assoc = false 
)

export uploaded file

Parameters
array$submitValuesvalues submitted.
bool$assocspecifies if returned array is associative
Return values
array

◆ getElementTemplateType()

MoodleQuickForm_filepicker::getElementTemplateType ( )

Returns type of filepicker element.

Return values
string

◆ getHelpButton()

MoodleQuickForm_filepicker::getHelpButton ( )

Returns html for help button.

Return values
stringhtml for help button

◆ MoodleQuickForm_filepicker()

MoodleQuickForm_filepicker::MoodleQuickForm_filepicker (   $elementName = null,
  $elementLabel = null,
  $attributes = null,
  $options = null 
)

Old syntax of class constructor.

Deprecated in PHP7.

Deprecated:
since Moodle 3.1

◆ toHtml()

MoodleQuickForm_filepicker::toHtml ( )

Returns HTML for filepicker form element.

Return values
string

◆ validateSubmitValue()

MoodleQuickForm_filepicker::validateSubmitValue (   $value)

Check that the file has the allowed type.

Parameters
array$valueDraft item id with the uploaded files.
Return values
string|nullValidation error message or null.

The documentation for this class was generated from the following file: