Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.
/lib/ -> editorlib.php (source)

Differences Between: [Versions 39 and 402] [Versions 39 and 403]

Utility classes and functions for text editor integration.

Copyright: 2009 Petr Skoda {@link http://skodak.org}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 245 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

texteditor:: (3 methods):
  set_text()
  get_text()
  head_setup()

Defines 3 functions


Class: texteditor  - X-Ref

Base abstract text editor class.

set_text($text)   X-Ref
Set the text set for this form field. Will be called before "use_editor".

param: string $text The text for the form field.

get_text()   X-Ref
Get the text set for this form field. Can be called from "use_editor".

return: string

head_setup()   X-Ref
Setup all JS and CSS needed for editor.

return: void

Functions that are not part of a class:

editors_get_preferred_editor($format = NULL)   X-Ref
Returns users preferred editor for given format

param: int $format text format or null of none
return: texteditor object

editors_get_preferred_format()   X-Ref
Returns users preferred text format.

return: int standard text format

editors_get_enabled()   X-Ref
Returns list of enabled text editors

return: array of name=>texteditor

get_texteditor($editorname)   X-Ref
Returns instance of text editor

param: string $editorname name of editor (textarea, tinymce, ...)
return: object|bool texeditor instance or false if does not exist

editors_get_available()   X-Ref
Get the list of available editors

return: array Array ('editorname'=>'localised editor name')

editors_head_setup()   X-Ref
Setup all JS and CSS needed for editors.

return: void