Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | Public Attributes | Protected Attributes | List of all members
MoodleQuickForm_editor Class Reference
Inheritance diagram for MoodleQuickForm_editor:
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...
 
 getAreamaxbytes ()
 Returns the maximum size of the area. More...
 
 getElementTemplateType ()
 Returns type of editor element. More...
 
 getFormat ()
 Returns editor format. More...
 
 getFrozenHtml ()
 What to display when element is frozen. More...
 
 getHelpButton ()
 Returns html for help button. More...
 
 getMaxbytes ()
 Returns maximum file size which can be uploaded. More...
 
 getMaxfiles ()
 Returns maximum number of files which can be uploaded. More...
 
 getName ()
 Returns name of element. More...
 
 getSubdirs ()
 Returns true if subdirectoy can be created, else false. More...
 
 getValue ()
 Returns editor values. More...
 
 isRequired ()
 Checks if editor used is a required field. More...
 
 MoodleQuickForm_editor ($elementName=null, $elementLabel=null, $attributes=null, $options=null)
 Old syntax of class constructor. More...
 
 onQuickFormEvent ($event, $arg, &$caller)
 Called by HTML_QuickForm whenever form event is made on this element. More...
 
 setAreamaxbytes ($areamaxbytes)
 Sets the maximum size of the area. More...
 
 setHelpButton ($_helpbuttonargs, $function='_helpbutton')
 
 setMaxbytes ($maxbytes)
 Sets maximum file size which can be uploaded. More...
 
 setMaxfiles ($num)
 Sets maximum number of files which can be uploaded. More...
 
 setName ($name)
 Sets name of editor. More...
 
 setSubdirs ($allow)
 Set option to create sub directory, while uploading file. More...
 
 setValue ($values)
 Updates editor values, if part of $_values. More...
 
 toHtml ()
 Returns HTML for editor form element. More...
 

Public Attributes

string $_helpbutton = ''
 html for help button, if empty then no help will icon will be dispalyed.
 
string $_type = 'editor'
 defines the type of editor
 

Protected Attributes

array $_options
 options provided to initalize filepicker More...
 
array $_values = array('text'=>null, 'format'=>null, 'itemid'=>null)
 values for editor
 

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

Parameters
string$elementName(optional) name of the editor
string$elementLabel(optional) editor 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_editor::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.

◆ getAreamaxbytes()

MoodleQuickForm_editor::getAreamaxbytes ( )

Returns the maximum size of the area.

Return values
int

◆ getElementTemplateType()

MoodleQuickForm_editor::getElementTemplateType ( )

Returns type of editor element.

Return values
string

◆ getFormat()

MoodleQuickForm_editor::getFormat ( )

Returns editor format.

Return values
int.

◆ getFrozenHtml()

MoodleQuickForm_editor::getFrozenHtml ( )

What to display when element is frozen.

Return values
emptystring

◆ getHelpButton()

MoodleQuickForm_editor::getHelpButton ( )

Returns html for help button.

Return values
stringhtml for help button

◆ getMaxbytes()

MoodleQuickForm_editor::getMaxbytes ( )

Returns maximum file size which can be uploaded.

Return values
int

◆ getMaxfiles()

MoodleQuickForm_editor::getMaxfiles ( )

Returns maximum number of files which can be uploaded.

Return values
int

◆ getName()

MoodleQuickForm_editor::getName ( )

Returns name of element.

Return values
string

◆ getSubdirs()

MoodleQuickForm_editor::getSubdirs ( )

Returns true if subdirectoy can be created, else false.

Return values
bool

◆ getValue()

MoodleQuickForm_editor::getValue ( )

Returns editor values.

Return values
array

◆ isRequired()

MoodleQuickForm_editor::isRequired ( )

Checks if editor used is a required field.

Return values
booltrue if required field.

◆ MoodleQuickForm_editor()

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

Old syntax of class constructor.

Deprecated in PHP7.

Deprecated:
since Moodle 3.1

◆ onQuickFormEvent()

MoodleQuickForm_editor::onQuickFormEvent (   $event,
  $arg,
$caller 
)

Called by HTML_QuickForm whenever form event is made on this element.

Parameters
string$eventName of event
mixed$argevent arguments
object$callercalling object
Return values
bool

◆ setAreamaxbytes()

MoodleQuickForm_editor::setAreamaxbytes (   $areamaxbytes)

Sets the maximum size of the area.

Parameters
int$areamaxbytessize limit

◆ setHelpButton()

MoodleQuickForm_editor::setHelpButton (   $_helpbuttonargs,
  $function = '_helpbutton' 
)
Deprecated:
since Moodle 2.0

◆ setMaxbytes()

MoodleQuickForm_editor::setMaxbytes (   $maxbytes)

Sets maximum file size which can be uploaded.

Parameters
int$maxbytesfile size

◆ setMaxfiles()

MoodleQuickForm_editor::setMaxfiles (   $num)

Sets maximum number of files which can be uploaded.

Parameters
int$numnumber of files

◆ setName()

MoodleQuickForm_editor::setName (   $name)

Sets name of editor.

Parameters
string$namename of the editor

◆ setSubdirs()

MoodleQuickForm_editor::setSubdirs (   $allow)

Set option to create sub directory, while uploading file.

Parameters
bool$allowtrue if sub directory can be created.

◆ setValue()

MoodleQuickForm_editor::setValue (   $values)

Updates editor values, if part of $_values.

Parameters
array$valuesassociative array of values to set

◆ toHtml()

MoodleQuickForm_editor::toHtml ( )

Returns HTML for editor form element.

Return values
string

Member Data Documentation

◆ $_options

array MoodleQuickForm_editor::$_options
protected
Initial value:
= array('subdirs' => 0, 'maxbytes' => 0, 'maxfiles' => 0, 'changeformat' => 0,
'areamaxbytes' => FILE_AREA_MAX_BYTES_UNLIMITED, 'context' => null, 'noclean' => 0, 'trusttext' => 0,
'return_types' => 15, 'enable_filemanagement' => true, 'removeorphaneddrafts' => false, 'autosave' => true)
const FILE_AREA_MAX_BYTES_UNLIMITED
Unlimited area size constant.
Definition: filelib.php:41

options provided to initalize filepicker


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