JEditor
Extends \JObjectJEditor class to handle WYSIWYG editors
This class allows for simple but smart objects with get and set methods and an internal error handler.
package |
Joomla.Platform |
---|---|
subpackage |
HTML |
since |
11.1 |
Methods
__construct
Class constructor, overridden in descendant classes.
__construct(mixed $properties = null)
since |
11.1 |
---|
Arguments
- $properties
mixed
Either and associative array or another object to set the initial properties of the object.
__toString
Magic method to convert the object to a string gracefully.
__toString() : string
since |
11.1 |
---|---|
deprecated |
12.3 Classes should provide their own __toString() implementation. |
Response
string
The classname.
_loadEditor
Load the editor
_loadEditor(array $config = array()) : mixed
since |
11.1 |
---|
Arguments
- $config
array
Associative array of editor config paramaters
Response
mixed
attach
Attach an observer object
attach(object $observer) : void
since |
11.1 |
---|
Arguments
- $observer
object
An observer object to attach
def
Sets a default value if not alreay assigned
def(string $property, mixed $default = null) : mixed
since |
11.1 |
---|
Arguments
- $property
string
The name of the property.- $default
mixed
The default value.
Response
mixed
detach
Detach an observer object
detach(object $observer) : boolean
since |
11.1 |
---|
Arguments
- $observer
object
An observer object to detach.
Response
boolean
True if the observer object was detached.
display
Display the editor area.
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()) : string
since |
11.1 |
---|
Arguments
- $name
string
The control name.- $html
string
The contents of the text area.- $width
string
The width of the text area (px or %).- $height
string
The height of the text area (px or %).- $col
integer
The number of columns for the textarea.- $row
integer
The number of rows for the textarea.- $buttons
boolean
True and the editor buttons will be displayed.- $id
string
An optional ID for the textarea (note: since 1.6). If not supplied the name is used.- $asset
string
The object asset- $author
object
The author.- $params
array
Associative array of editor parameters.
Response
string
get
Returns a property of the object or the default value if the property is not set.
get(string $property, mixed $default = null) : mixed
since |
11.1 |
---|---|
see | \JObject::getProperties() |
Arguments
- $property
string
The name of the property.- $default
mixed
The default value.
Response
mixed
The value of the property.
getButtons
Get the editor extended buttons (usually from plugins)
getButtons(string $editor, mixed $buttons = true) : array
since |
11.1 |
---|
Arguments
- $editor
string
The name of the editor.- $buttons
mixed
Can 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
since |
11.1 |
---|
Arguments
- $editor
string
The name of the editor control
Response
string
getError
Get the most recent error message.
getError(integer $i = null, boolean $toString = true) : string
since |
11.1 |
---|---|
see | \JError |
deprecated |
12.3 JError has been deprecated |
Arguments
- $i
integer
Option error index.- $toString
boolean
Indicates if JError objects should return their error message.
Response
string
Error message
getErrors
Return all errors, if any.
getErrors() : array
since |
11.1 |
---|---|
see | \JError |
deprecated |
12.3 JError has been deprecated |
Response
array
Array of error messages or JErrors.
getInstance
Returns the global Editor object, only creating it if it doesn't already exist.
getInstance(string $editor = 'none') : object
since |
11.1 |
---|
Arguments
- $editor
string
The editor to use.
Response
object
JEditor The Editor object.
getProperties
Returns an associative array of object properties.
getProperties(boolean $public = true) : array
since |
11.1 |
---|---|
see | \JObject::get() |
Arguments
- $public
boolean
If true, returns only the public properties.
Response
array
getState
Get the state of the JEditor object
getState() : mixed
since |
11.1 |
---|
Response
mixed
The state of the object.
initialise
Initialise the editor
initialise() : void
since |
11.1 |
---|
save
Save the editor content
save(string $editor) : string
since |
11.1 |
---|
Arguments
- $editor
string
The name of the editor control
Response
string
set
Modifies a property of the object, creating it if it does not already exist.
set(string $property, mixed $value = null) : mixed
since |
11.1 |
---|
Arguments
- $property
string
The name of the property.- $value
mixed
The value of the property to set.
Response
mixed
Previous value of the property.
setContent
Set the editor contents
setContent(string $editor, string $html) : string
since |
11.1 |
---|
Arguments
- $editor
string
The name of the editor control- $html
string
The contents of the text area
Response
string
setError
Add an error message.
setError(string $error) : void
since |
11.1 |
---|---|
see | \JError |
deprecated |
12.3 JError has been deprecated |
Arguments
- $error
string
Error message.
setProperties
Set the object properties based on a named array/hash.
setProperties(mixed $properties) : boolean
since |
11.1 |
---|---|
see | \JObject::set() |
Arguments
- $properties
mixed
Either an associative array or another object.
Response
boolean
toString
Converts the object to a string (the class name).
toString() : string
Properties
_observers
An array of Observer objects to notify
since |
11.1 |
---|
Type(s)
array
_state
The state of the observable object
since |
11.1 |
---|
Type(s)
mixed
_methods
A multi dimensional array of [function][] = key for observers
since |
11.1 |
---|
Type(s)
array
_editor
Editor Plugin object
Type(s)
object
_name
Editor Plugin name
Type(s)
string
asset
Object asset
Type(s)
string
author
Object author
Type(s)
string
instances
JEditor instances container.
since |
11.3 |
---|
Type(s)
array
_errors
An array of error messages or Exception objects.