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 401 and 402] [Versions 401 and 403]

Editor input element Contains class to create preffered editor form element

Copyright: 2009 Petr Skoda {@link http://skodak.org}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 521 lines (18 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 1 file
 lib/form/templatable_form_element.php

Defines 2 classes

MoodleQuickForm_editor:: (2 methods):
  __construct()
  MoodleQuickForm_editor()

name:: (23 methods):
  onQuickFormEvent()
  setName()
  getName()
  setValue()
  getValue()
  getMaxbytes()
  setMaxbytes()
  getAreamaxbytes()
  setAreamaxbytes()
  getMaxfiles()
  setMaxfiles()
  getSubdirs()
  setSubdirs()
  get_text()
  getFormat()
  isRequired()
  setHelpButton()
  getHelpButton()
  getElementTemplateType()
  toHtml()
  export_for_template()
  getFrozenHtml()
  setHiddenLabel()


Class: MoodleQuickForm_editor  - X-Ref

Editor element

It creates preffered editor (textbox/TinyMce) form element for the format (Text/HTML) selected.

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

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

MoodleQuickForm_editor($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 editor

param: string $name name of the editor

getName()   X-Ref
Returns name of element

return: string

setValue($values)   X-Ref
Updates editor values, if part of $_values

param: array $values associative array of values to set

getValue()   X-Ref
Returns editor values

return: array

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

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

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.

get_text()   X-Ref
Returns editor text content

return: string Text content

getFormat()   X-Ref
Returns editor format

return: int.

isRequired()   X-Ref
Checks if editor used is a required field

return: bool true if required field.

setHelpButton($_helpbuttonargs, $function='_helpbutton')   X-Ref


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

return: string html for help button

getElementTemplateType()   X-Ref
Returns type of editor element

return: string

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

return: string

export_for_template(renderer_base $output)   X-Ref
No description

getFrozenHtml()   X-Ref
Returns the formatted value. The return from parent class is not acceptable.

return: string

setHiddenLabel($hiddenLabel)   X-Ref
Sets label to be hidden.

param: bool $hiddenLabel Whether the label should be hidden or not.
return: void