Editor

Extends JObject

Editor class to handle WYSIWYG editors

since

1.5

package

Joomla CMS

Methods

__construct

Constructor

__construct(string editor = 'none') : mixed

Arguments

editor

stringThe editor name

Response

mixed

_loadEditor

Load the editor

_loadEditor(array config = array()) : mixed
since

1.5

Arguments

config

arrayAssociative array of editor config parameters

Response

mixed

attach

Attach an observer object

attach(array|object observer) : void
since

1.5

Arguments

observer

array|objectAn observer object to attach or an array with handler and event keys

detach

Detach an observer object

detach(object observer) : bool
since

1.5

Arguments

observer

objectAn observer object to detach.

Response

boolTrue if the observer object was detached.

display

Display the editor area.

display(string name, string html, string width, string height, int col, int row, bool buttons = true, string id = null, string asset = null, object author = null, array params = array()) : string
since

1.5

Arguments

name

stringThe control name.

html

stringThe contents of the text area.

width

stringThe width of the text area (px or %).

height

stringThe height of the text area (px or %).

col

intThe number of columns for the textarea.

row

intThe number of rows for the textarea.

buttons

boolTrue and the editor buttons will be displayed.

id

stringAn optional ID for the textarea (note: since 1.6). If not supplied the name is used.

asset

stringThe object asset

author

objectThe author.

params

arrayAssociative array of editor parameters.

Response

string

getButtons

Get the editor extended buttons (usually from plugins)

getButtons(string editor, mixed buttons = true) : array
since

1.5

Arguments

editor

stringThe name of the editor.

buttons

mixedCan be boolean or array, if boolean defines if the buttons are displayed, if array defines a list of buttons not to show.

Response

array

getContent

Get the editor contents

getContent(string editor) : string
deprecated
since

1.5

deprecated

4.0 Use Joomla.editors API, see core.js

Arguments

editor

stringThe name of the editor control

Response

string

getInstance

Returns the global Editor object, only creating it if it doesn't already exist.

getInstance(string editor = 'none') : \Joomla\CMS\Editor\Editor
static
since

1.5

Arguments

editor

stringThe editor to use.

Response

\Joomla\CMS\Editor\EditorThe Editor object.

getState

Get the state of the Editor object

getState() : mixed
since

1.5

Response

mixedThe state of the object.

initialise

Initialise the editor

initialise() : void
deprecated
since

1.5

deprecated

4.0 This function will not load any custom tag from 4.0 forward, use JHtml::script

save

Save the editor content

save(string editor) : string
deprecated
since

1.5

deprecated

4.0 Bind functionality to form submit through javascript

Arguments

editor

stringThe name of the editor control

Response

string

setContent

Set the editor contents

setContent(string editor, string html) : string
deprecated
since

1.5

deprecated

4.0 Use Joomla.editors API, see core.js

Arguments

editor

stringThe name of the editor control

html

stringThe contents of the text area

Response

string

Properties

_observers

An array of Observer objects to notify

since

1.5

Type(s)

array

_state

The state of the observable object

since

1.5

Type(s)

mixed

_methods

A multi dimensional array of [function][] = key for observers

since

1.5

Type(s)

array

_editor

Editor Plugin object

since

1.5

Type(s)

object

_name

Editor Plugin name

since

1.5

Type(s)

string

asset

Object asset

since

1.6

Type(s)

string

author

Object author

since

1.6

Type(s)

string

instances

Editor instances container.

static
since

2.5

Type(s)

\Joomla\CMS\Editor\Editor[]