Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.
/lib/ -> editorlib.php (source)

Differences Between: [Versions 400 and 402] [Versions 400 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

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

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

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

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