class Editor extends JObject

Editor class to handle WYSIWYG editors

Methods

__construct( string $editor = 'none')

Constructor

static  Editor
getInstance( string $editor = 'none')

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

mixed
getState()

Get the state of the Editor object

void
attach( array|object $observer)

Attach an observer object

boolean
detach( object $observer)

Detach an observer object

void
initialise()

Initialise the editor

string
display( string $name, string $html, string $width, string $height, integer $col, integer $row, boolean $buttons = true, string $id = null, string $asset = null, object $author = null, array $params = array())

Display the editor area.

string
save( string $editor)

Save the editor content

string
getContent( string $editor)

Get the editor contents

string
setContent( string $editor, string $html)

Set the editor contents

array
getButtons( string $editor, mixed $buttons = true)

Get the editor extended buttons (usually from plugins)

Details

__construct( string $editor = 'none')

Constructor

Parameters

string $editor The editor name

static Editor getInstance( string $editor = 'none')

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

Parameters

string $editor The editor to use.

Return Value

Editor The Editor object.

mixed getState()

Get the state of the Editor object

Return Value

mixed The state of the object.

void attach( array|object $observer)

Attach an observer object

Parameters

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

Return Value

void

boolean detach( object $observer)

Detach an observer object

Parameters

object $observer An observer object to detach.

Return Value

boolean True if the observer object was detached.

void initialise()

Initialise the editor

Return Value

void

string display( string $name, string $html, string $width, string $height, integer $col, integer $row, boolean $buttons = true, string $id = null, string $asset = null, object $author = null, array $params = array())

Display the editor area.

Parameters

string $name The control name.
string $html The contents of the text area.
string $width The width of the text area (px or %).
string $height The height of the text area (px or %).
integer $col The number of columns for the textarea.
integer $row The number of rows for the textarea.
boolean $buttons True and the editor buttons will be displayed.
string $id An optional ID for the textarea (note: since 1.6). If not supplied the name is used.
string $asset The object asset
object $author The author.
array $params Associative array of editor parameters.

Return Value

string

string save( string $editor)

Save the editor content

Parameters

string $editor The name of the editor control

Return Value

string

string getContent( string $editor)

Get the editor contents

Parameters

string $editor The name of the editor control

Return Value

string

string setContent( string $editor, string $html)

Set the editor contents

Parameters

string $editor The name of the editor control
string $html The contents of the text area

Return Value

string

array getButtons( string $editor, mixed $buttons = true)

Get the editor extended buttons (usually from plugins)

Parameters

string $editor The name of the editor.
mixed $buttons Can be boolean or array, if boolean defines if the buttons are displayed, if array defines a list of buttons not to show.

Return Value

array