Editor element.
More...
|
| __construct ($elementName=null, $elementLabel=null, $attributes=null, $options=null) |
| Constructor.
|
|
| export_for_template (renderer_base $output) |
| Function to export the renderer data in a format that is suitable for a mustache template.
|
|
| get_text () |
| Returns editor text content.
|
|
| getAreamaxbytes () |
| Returns the maximum size of the area.
|
|
| getElementTemplateType () |
| Returns type of editor element.
|
|
| getFormat () |
| Returns editor format.
|
|
| getFrozenHtml () |
| Returns the formatted value.
|
|
| getHelpButton () |
| Returns html for help button.
|
|
| getMaxbytes () |
| Returns maximum file size which can be uploaded.
|
|
| getMaxfiles () |
| Returns maximum number of files which can be uploaded.
|
|
| getName () |
| Returns name of element.
|
|
| getSubdirs () |
| Returns true if subdirectoy can be created, else false.
|
|
| getValue () |
| Returns editor values.
|
|
| isRequired () |
| Checks if editor used is a required field.
|
|
| MoodleQuickForm_editor ($elementName=null, $elementLabel=null, $attributes=null, $options=null) |
| Old syntax of class constructor.
|
|
| onQuickFormEvent ($event, $arg, &$caller) |
| Called by HTML_QuickForm whenever form event is made on this element.
|
|
| setAreamaxbytes ($areamaxbytes) |
| Sets the maximum size of the area.
|
|
| setHelpButton ($_helpbuttonargs, $function='_helpbutton') |
|
| setHiddenLabel ($hiddenLabel) |
| Sets label to be hidden.
|
|
| setMaxbytes ($maxbytes) |
| Sets maximum file size which can be uploaded.
|
|
| setMaxfiles ($num) |
| Sets maximum number of files which can be uploaded.
|
|
| setName ($name) |
| Sets name of editor.
|
|
| setSubdirs ($allow) |
| Set option to create sub directory, while uploading file.
|
|
| setValue ($values) |
| Updates editor values, if part of $_values.
|
|
| toHtml () |
| Returns HTML for editor form element.
|
|
|
string | $_helpbutton = '' |
| html for help button, if empty then no help will icon will be dispalyed.
|
|
string | $_type = 'editor' |
| defines the type of editor
|
|
|
bool | $_hiddenLabel = false |
| if true label will be hidden
|
|
array | $_options |
| options provided to initalize filepicker
|
|
array | $_values = array('text'=>null, 'format'=>null, 'itemid'=>null) |
| values for editor
|
|
Editor element.
It creates preffered editor (textbox/Tiny) form element for the format (Text/HTML) selected.
- Copyright
- 2009 Petr Skoda
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- Todo
MDL-29421 element Freezing
MDL-29426 ajax format conversion
◆ __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 | $options | set of options to initalize filepicker |
◆ 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:
- No complex types - only stdClass, array, int, string, float, bool
- Any additional info that is required for the template is pre-calculated (e.g. capability checks).
- Parameters
-
renderer_base | $output | Used to do a final render of any components that need to be rendered for export. |
- Return values
-
Implements templatable.
◆ get_text()
MoodleQuickForm_editor::get_text |
( |
| ) |
|
Returns editor text content.
- Return values
-
◆ getAreamaxbytes()
MoodleQuickForm_editor::getAreamaxbytes |
( |
| ) |
|
Returns the maximum size of the area.
- Return values
-
◆ getElementTemplateType()
MoodleQuickForm_editor::getElementTemplateType |
( |
| ) |
|
Returns type of editor element.
- Return values
-
◆ getFormat()
MoodleQuickForm_editor::getFormat |
( |
| ) |
|
Returns editor format.
- Return values
-
◆ getFrozenHtml()
MoodleQuickForm_editor::getFrozenHtml |
( |
| ) |
|
Returns the formatted value.
The return from parent class is not acceptable.
- Return values
-
◆ getHelpButton()
MoodleQuickForm_editor::getHelpButton |
( |
| ) |
|
Returns html for help button.
- Return values
-
string | html for help button |
◆ getMaxbytes()
MoodleQuickForm_editor::getMaxbytes |
( |
| ) |
|
Returns maximum file size which can be uploaded.
- Return values
-
◆ getMaxfiles()
MoodleQuickForm_editor::getMaxfiles |
( |
| ) |
|
Returns maximum number of files which can be uploaded.
- Return values
-
◆ getName()
MoodleQuickForm_editor::getName |
( |
| ) |
|
Returns name of element.
- Return values
-
◆ getSubdirs()
MoodleQuickForm_editor::getSubdirs |
( |
| ) |
|
Returns true if subdirectoy can be created, else false.
- Return values
-
◆ getValue()
MoodleQuickForm_editor::getValue |
( |
| ) |
|
Returns editor values.
- Return values
-
◆ isRequired()
MoodleQuickForm_editor::isRequired |
( |
| ) |
|
Checks if editor used is a required field.
- Return values
-
bool | true 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 | $event | Name of event |
mixed | $arg | event arguments |
object | $caller | calling object |
- Return values
-
◆ setAreamaxbytes()
MoodleQuickForm_editor::setAreamaxbytes |
( |
| $areamaxbytes | ) |
|
Sets the maximum size of the area.
- Parameters
-
int | $areamaxbytes | size limit |
◆ setHelpButton()
MoodleQuickForm_editor::setHelpButton |
( |
| $_helpbuttonargs, |
|
|
| $function = '_helpbutton' ) |
◆ setHiddenLabel()
MoodleQuickForm_editor::setHiddenLabel |
( |
| $hiddenLabel | ) |
|
Sets label to be hidden.
- Parameters
-
bool | $hiddenLabel | Whether the label should be hidden or not. |
- Return values
-
◆ setMaxbytes()
MoodleQuickForm_editor::setMaxbytes |
( |
| $maxbytes | ) |
|
Sets maximum file size which can be uploaded.
- Parameters
-
◆ setMaxfiles()
MoodleQuickForm_editor::setMaxfiles |
( |
| $num | ) |
|
Sets maximum number of files which can be uploaded.
- Parameters
-
◆ setName()
MoodleQuickForm_editor::setName |
( |
| $name | ) |
|
Sets name of editor.
- Parameters
-
string | $name | name of the editor |
◆ setSubdirs()
MoodleQuickForm_editor::setSubdirs |
( |
| $allow | ) |
|
Set option to create sub directory, while uploading file.
- Parameters
-
bool | $allow | true if sub directory can be created. |
◆ setValue()
MoodleQuickForm_editor::setValue |
( |
| $values | ) |
|
Updates editor values, if part of $_values.
- Parameters
-
array | $values | associative array of values to set |
◆ toHtml()
MoodleQuickForm_editor::toHtml |
( |
| ) |
|
Returns HTML for editor form element.
- Return values
-
◆ $_options
array MoodleQuickForm_editor::$_options |
|
protected |
Initial value:= array('subdirs' => 0, 'maxbytes' => 0, 'maxfiles' => 0, 'changeformat' => 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: