Source code for file /joomla/html/editor.php
Documentation is available at editor.php
* @version $Id: editor.php 6762 2007-03-03 08:37:41Z tcp $
* @package Joomla.Framework
* @copyright Copyright (C) 2005 - 2007 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
// Check to ensure this file is within the rest of the framework
jimport('joomla.application.event');
* JEditor class to handle WYSIWYG editors
* @package Joomla.Framework
* @param string The editor name
* Returns a reference to a global Editor object, only creating it
* if it doesn't already exist.
* This method must be invoked as:
* <pre> $editor = &JEditor::getInstance([$editor);</pre>
* @param string $editor The editor to use.
* @return JEditor The Editor object.
if (!isset
($instances)) {
if (empty ($instances[$signature])) {
$instances[$signature] =
new JEditor($editor);
return $instances[$signature];
//check if editor is already loaded
$args['event'] =
'onInit';
$results[] =
$this->_editor->update($args);
foreach ($results as $result) {
$document->addCustomTag($return);
function display($name, $html, $width, $height, $col, $row, $buttons =
true)
//check if editor is already loaded
* Backwards compatibility. Width and height should be passed without a semicolon from now on.
* If editor plugins need a unit like "px" for CSS styling, they need to take care of that
$args['content'] =
$html;
$args['height'] =
$height;
$args['buttons'] =
$buttons;
$args['event'] =
'onDisplay';
$results[] =
$this->_editor->update($args);
foreach ($results as $result) {
* Save the editor content
//check if editor is already loaded
$args['event'] =
'onSave';
$results[] =
$this->_editor->update($args);
foreach ($results as $result) {
* Get the editor contents
$args['event'] =
'onGetContent';
$results[] =
$this->_editor->update($args);
foreach ($results as $result) {
* Set the editor contents
$args['event'] =
'onSetContent';
$results[] =
$this->_editor->update($args);
foreach ($results as $result) {
//check if editor is already loaded
// Build the path to the needed editor plugin
$path =
JPATH_SITE.
DS.
'plugins'.
DS.
'editors'.
DS.
$this->_name.
'.php';
$message =
JText::_('Cannot load the editor');
// Build editor plugin classname
$name =
'plgEditor'.
$this->_name;
if($this->_editor =
new $name ($this))