Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Protected Attributes | List of all members
texteditor Class Reference

Base abstract text editor class. More...

Inheritance diagram for texteditor:
atto_texteditor textarea_texteditor tinymce_texteditor

Public Member Functions

 get_preferred_format ()
 Returns main preferred text format. More...
 
 get_supported_formats ()
 Returns list of supported text formats. More...
 
 get_text ()
 Get the text set for this form field. More...
 
 head_setup ()
 Setup all JS and CSS needed for editor. More...
 
 set_text ($text)
 Set the text set for this form field. More...
 
 supported_by_browser ()
 Is editor supported in current browser? More...
 
 supports_repositories ()
 Supports file picker and repos? More...
 
 use_editor ($elementid, array $options=null, $fpoptions=null)
 Add required JS needed for editor. More...
 

Protected Attributes

string $text = ''
 $text The text set to the editor in the form. More...
 

Detailed Description

Base abstract text editor class.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ get_preferred_format()

texteditor::get_preferred_format ( )
abstract

Returns main preferred text format.

Return values
inttext format

Reimplemented in tinymce_texteditor, textarea_texteditor, and atto_texteditor.

◆ get_supported_formats()

texteditor::get_supported_formats ( )
abstract

Returns list of supported text formats.

Return values
arrayArray (FORMAT=>FORMAT)

Reimplemented in tinymce_texteditor, textarea_texteditor, and atto_texteditor.

◆ get_text()

texteditor::get_text ( )

Get the text set for this form field.

Can be called from "use_editor".

Return values
string

◆ head_setup()

texteditor::head_setup ( )

Setup all JS and CSS needed for editor.

Return values
void

Reimplemented in tinymce_texteditor.

◆ set_text()

texteditor::set_text (   $text)

Set the text set for this form field.

Will be called before "use_editor".

Parameters
string$textThe text for the form field.

◆ supported_by_browser()

texteditor::supported_by_browser ( )
abstract

Is editor supported in current browser?

Return values
bool

Reimplemented in tinymce_texteditor, textarea_texteditor, and atto_texteditor.

◆ supports_repositories()

texteditor::supports_repositories ( )
abstract

Supports file picker and repos?

Return values
objectbook object

Reimplemented in tinymce_texteditor, textarea_texteditor, and atto_texteditor.

◆ use_editor()

texteditor::use_editor (   $elementid,
array  $options = null,
  $fpoptions = null 
)
abstract

Add required JS needed for editor.

Valid options may vary by editor. See the individual editor implementations of this function for documentation.

Parameters
string$elementidid of text area to be converted to editor
array$optionsEditor options
obejct$fpoptionsfile picker options
Return values
void

Reimplemented in tinymce_texteditor, textarea_texteditor, and atto_texteditor.

Member Data Documentation

◆ $text

string texteditor::$text = ''
protected

$text The text set to the editor in the form.

Since
3.0

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