load('plg_editors_jce', JPATH_ADMINISTRATOR); $language->load('com_jce', JPATH_ADMINISTRATOR); $app->triggerEvent('onBeforeWfEditorLoad'); // load base file require_once JPATH_ADMINISTRATOR . '/components/com_jce/includes/base.php'; // create editor $editor = new WFEditor(); $settings = $editor->getSettings(); $app->triggerEvent('onBeforeWfEditorRender', array(&$settings)); $editor->render($settings); foreach ($editor->getScripts() as $script) { $document->addScript($script, array('version' => 'auto')); } foreach ($editor->getStyleSheets() as $style) { $document->addStylesheet($style, array('version' => 'auto')); } $document->addScriptDeclaration(implode("\n", $editor->getScriptDeclaration())); } /** * JCE WYSIWYG Editor - get the editor content. * * @vars string The name of the editor */ public function onGetContent($editor) { return $this->onSave($editor); } /** * JCE WYSIWYG Editor - set the editor content. * * @vars string The name of the editor */ public function onSetContent($editor, $html) { return "WFEditor.setContent('" . $editor . "','" . $html . "');"; } /** * JCE WYSIWYG Editor - copy editor content to form field. * * @vars string The name of the editor */ public function onSave($editor) { return "WFEditor.getContent('" . $editor . "');"; } /** * JCE WYSIWYG Editor - display the editor. * * @vars string The name of the editor area * @vars string The content of the field * @vars string The width of the editor area * @vars string The height of the editor area * @vars int The number of columns for the editor area * @vars int The number of rows for the editor area * @vars mixed Can be boolean or array. */ public function onDisplay($name, $content, $width, $height, $col, $row, $buttons = true, $id = null, $asset = null, $author = null) { if (empty($id)) { $id = $name; } // Only add "px" to width and height if they are not given as a percentage if (is_numeric($width)) { $width .= 'px'; } if (is_numeric($height)) { $height .= 'px'; } if (empty($id)) { $id = $name; } $editor = '