Файловый менеджер - Редактировать - /var/www/iplanru/data/www/intesco.ru/d59ed/plugins.tar
Назад
editors/codemirror/codemirror.xml 0000666 00000007717 15077165755 0013313 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <extension version="3.2" type="plugin" group="editors"> <name>plg_editors_codemirror</name> <version>3.15</version> <creationDate>28 March 2011</creationDate> <author>Marijn Haverbeke</author> <authorEmail>N/A</authorEmail> <authorUrl></authorUrl> <copyright></copyright> <license></license> <description>PLG_CODEMIRROR_XML_DESCRIPTION</description> <files> <filename plugin="codemirror">codemirror.php</filename> <filename>index.html</filename> </files> <languages> <language tag="en-GB">en-GB.plg_editors_codemirror.ini</language> <language tag="en-GB">en-GB.plg_editors_codemirror.sys.ini</language> </languages> <config> <fields name="params"> <fieldset name="basic"> <field name="lineNumbers" type="radio" class="btn-group btn-group-yesno" default="0" description="PLG_CODEMIRROR_FIELD_LINENUMBERS_DESC" label="PLG_CODEMIRROR_FIELD_LINENUMBERS_LABEL" > <option value="1">JON</option> <option value="0">JOFF</option> </field> <field name="lineWrapping" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_CODEMIRROR_FIELD_LINEWRAPPING_DESC" label="PLG_CODEMIRROR_FIELD_LINEWRAPPING_LABEL" > <option value="1">JON</option> <option value="0">JOFF</option> </field> <field name="matchTags" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_CODEMIRROR_FIELD_MATCHTAGS_DESC" label="PLG_CODEMIRROR_FIELD_MATCHTAGS_LABEL" > <option value="1">JON</option> <option value="0">JOFF</option> </field> <field name="matchBrackets" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_CODEMIRROR_FIELD_MATCHBRACKETS_DESC" label="PLG_CODEMIRROR_FIELD_MATCHBRACKETS_LABEL" > <option value="1">JON</option> <option value="0">JOFF</option> </field> <field name="marker-gutter" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_CODEMIRROR_FIELD_MARKERGUTTER_DESC" label="PLG_CODEMIRROR_FIELD_MARKERGUTTER_LABEL" > <option value="1">JON</option> <option value="0">JOFF</option> </field> <field name="autoCloseTags" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_CODEMIRROR_FIELD_AUTOCLOSETAGS_DESC" label="PLG_CODEMIRROR_FIELD_AUTOCLOSETAGS_LABEL" > <option value="1">JON</option> <option value="0">JOFF</option> </field> <field name="autoCloseBrackets" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_CODEMIRROR_FIELD_AUTOCLOSEBRACKET_DESC" label="PLG_CODEMIRROR_FIELD_AUTOCLOSEBRACKET_LABEL" > <option value="1">JON</option> <option value="0">JOFF</option> </field> <field name="autoFocus" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_CODEMIRROR_FIELD_AUTOFOCUS_DESC" label="PLG_CODEMIRROR_FIELD_AUTOFOCUS_LABEL" > <option value="1">JON</option> <option value="0">JOFF</option> </field> <field name="theme" type="list" class="btn-group btn-group-yesno" default="default" description="PLG_CODEMIRROR_FIELD_THEME_DESC" label="PLG_CODEMIRROR_FIELD_THEME_LABEL" > <option value="default">PLG_CODEMIRROR_FIELD_VALUE_THEME_LIGHT</option> <option value="ambiance">PLG_CODEMIRROR_FIELD_VALUE_THEME_DARK</option> </field> <field name="tabmode" type="list" default="indent" description="PLG_CODEMIRROR_FIELD_TABMODE_DESC" label="PLG_CODEMIRROR_FIELD_TABMODE_LABEL" > <option value="indent">PLG_CODEMIRROR_FIELD_VALUE_TABMODE_INDENT</option> <option value="shift">PLG_CODEMIRROR_FIELD_VALUE_TABMODE_SHIFT</option> </field> </fieldset> </fields> </config> </extension> editors/codemirror/index.html 0000666 00000000037 15077165755 0012405 0 ustar 00 <!DOCTYPE html><title></title> editors/codemirror/codemirror.php 0000666 00000024212 15077165755 0013267 0 ustar 00 <?php /** * @package Joomla.Plugin * @subpackage Editors.codemirror * * @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * CodeMirror Editor Plugin. * * @package Joomla.Plugin * @subpackage Editors.codemirror * @since 1.6 */ class PlgEditorCodemirror extends JPlugin { /** * Base path for editor files */ protected $_basePath = 'media/editors/codemirror/'; /** * Initialises the Editor. * * @return string JavaScript Initialization string. */ public function onInit() { JHtml::_('behavior.framework'); JHtml::_('script', $this->_basePath . 'js/codemirror.js', false, false, false, false); JHtml::_('script', $this->_basePath . 'js/fullscreen.js', false, false, false, false); JHtml::_('stylesheet', $this->_basePath . 'css/codemirror.css'); JHtml::_('stylesheet', $this->_basePath . 'css/configuration.css'); return ''; } /** * Copy editor content to form field. * * @param string $id The id of the editor field. * * @return string Javascript */ public function onSave($id) { return "document.getElementById('$id').value = Joomla.editors.instances['$id'].getValue();\n"; } /** * Get the editor content. * * @param string $id The id of the editor field. * * @return string Javascript */ public function onGetContent($id) { return "Joomla.editors.instances['$id'].getValue();\n"; } /** * Set the editor content. * * @param string $id The id of the editor field. * @param string $content The content to set. * * @return string Javascript */ public function onSetContent($id, $content) { return "Joomla.editors.instances['$id'].setValue($content);\n"; } /** * Adds the editor specific insert method. * * @return boolean */ public function onGetInsertMethod() { static $done = false; // Do this only once. if (!$done) { $done = true; $doc = JFactory::getDocument(); $js = "\tfunction jInsertEditorText(text, editor) { Joomla.editors.instances[editor].replaceSelection(text);\n }"; $doc->addScriptDeclaration($js); } return true; } /** * Display the editor area. * * @param string $name The control name. * @param string $content The contents of the text area. * @param string $width The width of the text area (px or %). * @param string $height The height of the text area (px or %). * @param integer $col The number of columns for the textarea. * @param integer $row The number of rows for the textarea. * @param boolean $buttons True and the editor buttons will be displayed. * @param string $id An optional ID for the textarea (note: since 1.6). If not supplied the name is used. * @param string $asset Unused * @param object $author Unused * @param array $params Associative array of editor parameters. * * @return string HTML Output */ public function onDisplay($name, $content, $width, $height, $col, $row, $buttons = true, $id = null, $asset = null, $author = null, $params = array()) { 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'; } // Must pass the field id to the buttons in this editor. $buttons = $this->_displayButtons($id, $buttons, $asset, $author); // Look if we need special syntax coloring. $syntax = $this->params->get('syntax', 'php'); if ($syntax) { switch ($syntax) { case 'css': $parserFile = array('css.js', 'closebrackets.js'); $mode = 'text/css'; $autoCloseBrackets = true; $autoCloseTags = false; $fold = true; $matchTags = false; $matchBrackets = true; JHtml::_('script', $this->_basePath . 'js/brace-fold.js', false, false, false, false); break; case 'ini': $parserFile = array('css.js'); $mode = 'text/css'; $autoCloseBrackets = false; $autoCloseTags = false; $fold = false; $matchTags = false; $matchBrackets = false; break; case 'xml': $parserFile = array('xml.js', 'closetag.js'); $mode = 'application/xml'; $fold = true; $autoCloseBrackets = false; $autoCloseTags = true; $matchTags = true; $matchBrackets = false; JHtml::_('script', $this->_basePath . 'js/xml-fold.js', false, false, false, false); break; case 'js': $parserFile = array('javascript.js', 'closebrackets.js'); $mode = 'text/javascript'; $autoCloseBrackets = true; $autoCloseTags = false; $fold = true; $matchTags = false; $matchBrackets = true; JHtml::_('script', $this->_basePath . 'js/brace-fold.js', false, false, false, false); break; case 'less': $parserFile = array('less.js', 'css.js', 'closebrackets.js'); $mode = 'text/x-less'; $autoCloseBrackets = true; $autoCloseTags = false; $fold = true; $matchTags = false; $matchBrackets = true; JHtml::_('script', $this->_basePath . 'js/brace-fold.js', false, false, false, false); break; case 'php': $parserFile = array('xml.js', 'clike.js', 'css.js', 'javascript.js', 'htmlmixed.js', 'php.js', 'closebrackets.js', 'closetag.js'); $mode = 'application/x-httpd-php'; $autoCloseBrackets = true; $autoCloseTags = true; $fold = true; $matchTags = true; $matchBrackets = true; JHtml::_('script', $this->_basePath . 'js/brace-fold.js', false, false, false, false); JHtml::_('script', $this->_basePath . 'js/xml-fold.js', false, false, false, false); break; default: $parserFile = false; $mode = 'text/plain'; $autoCloseBrackets = false; $autoCloseTags = false; $fold = false; $matchTags = false; $matchBrackets = false; break; } } if ($parserFile) { foreach ($parserFile as $file) { JHtml::_('script', $this->_basePath . 'js/' . $file, false, false, false, false); } } $options = new stdClass; $options->mode = $mode; $options->smartIndent = true; // Enabled the line numbers. if ($this->params->get('lineNumbers') == "1") { $options->lineNumbers = true; } if ($this->params->get('autoFocus') == "1") { $options->autofocus = true; } if ($this->params->get('autoCloseBrackets') == "1") { $options->autoCloseBrackets = $autoCloseBrackets; } if ($this->params->get('autoCloseTags') == "1") { $options->autoCloseTags = $autoCloseTags; } if ($this->params->get('matchTags') == "1") { $options->matchTags = $matchTags; JHtml::_('script', $this->_basePath . 'js/matchtags.js', false, false, false, false); } if ($this->params->get('matchBrackets') == "1") { $options->matchBrackets = $matchBrackets; JHtml::_('script', $this->_basePath . 'js/matchbrackets.js', false, false, false, false); } if ($this->params->get('marker-gutter') == "1") { $options->foldGutter = $fold; $options->gutters = array('CodeMirror-linenumbers', 'CodeMirror-foldgutter', 'breakpoints'); JHtml::_('script', $this->_basePath . 'js/foldcode.js', false, false, false, false); JHtml::_('script', $this->_basePath . 'js/foldgutter.js', false, false, false, false); } if ($this->params->get('theme', '') == 'ambiance') { $options->theme = 'ambiance'; JHtml::_('stylesheet', $this->_basePath . 'css/ambiance.css'); } if ($this->params->get('lineWrapping') == "1") { $options->lineWrapping = true; } if ($this->params->get('tabmode', '') == 'shift') { $options->tabMode = 'shift'; } $html = array(); $html[] = "<textarea name=\"$name\" id=\"$id\" cols=\"$col\" rows=\"$row\">$content</textarea>"; $html[] = $buttons; $html[] = '<script type="text/javascript">'; $html[] = '(function() {'; $html[] = ' var editor = CodeMirror.fromTextArea(document.getElementById("' . $id . '"), ' . json_encode($options) . ');'; $html[] = ' editor.setOption("extraKeys", {'; $html[] = ' "Ctrl-Q": function(cm) {'; $html[] = ' setFullScreen(cm, !isFullScreen(cm));'; $html[] = ' },'; $html[] = ' "Esc": function(cm) {'; $html[] = ' if (isFullScreen(cm)) setFullScreen(cm, false);'; $html[] = ' }'; $html[] = ' });'; $html[] = ' editor.on("gutterClick", function(cm, n) {'; $html[] = ' var info = cm.lineInfo(n)'; $html[] = ' cm.setGutterMarker(n, "breakpoints", info.gutterMarkers ? null : makeMarker())'; $html[] = ' })'; $html[] = ' function makeMarker() {'; $html[] = ' var marker = document.createElement("div")'; $html[] = ' marker.style.color = "#822"'; $html[] = ' marker.innerHTML = "●"'; $html[] = ' return marker'; $html[] = ' }'; $html[] = ' Joomla.editors.instances[\'' . $id . '\'] = editor;'; $html[] = '})()'; $html[] = '</script>'; return implode("\n", $html); } /** * Displays the editor buttons. * * @param string $name The editor name * @param mixed $buttons [array with button objects | boolean true to display buttons] * @param string $asset The object asset * @param object $author The author. * * @return string HTML */ protected function _displayButtons($name, $buttons, $asset, $author) { $return = ''; $args = array( 'name' => $name, 'event' => 'onGetInsertMethod' ); $results = (array) $this->update($args); if ($results) { foreach ($results as $result) { if (is_string($result) && trim($result)) { $return .= $result; } } } if (is_array($buttons) || (is_bool($buttons) && $buttons)) { $buttons = $this->_subject->getButtons($name, $buttons, $asset, $author); $return .= JLayoutHelper::render('joomla.editors.buttons', $buttons); } return $return; } } editors/tinymce/tinymce.xml 0000666 00000031003 15077165755 0012102 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <extension version="3.2" type="plugin" group="editors" method="upgrade"> <name>plg_editors_tinymce</name> <version>4.0.22</version> <creationDate>2005-2013</creationDate> <author>Moxiecode Systems AB</author> <authorEmail>N/A</authorEmail> <authorUrl>tinymce.moxiecode.com</authorUrl> <copyright>Moxiecode Systems AB</copyright> <license>LGPL</license> <description>PLG_TINY_XML_DESCRIPTION</description> <files> <filename plugin="tinymce">tinymce.php</filename> <filename>index.html</filename> </files> <languages> <language tag="en-GB">en-GB.plg_editors_tinymce.ini</language> <language tag="en-GB">en-GB.plg_editors_tinymce.sys.ini</language> </languages> <config> <fields name="params"> <fieldset name="basic"> <field name="mode" type="list" default="2" description="PLG_TINY_FIELD_FUNCTIONALITY_DESC" label="PLG_TINY_FIELD_FUNCTIONALITY_LABEL" > <option value="0">PLG_TINY_FIELD_VALUE_SIMPLE</option> <option value="1">PLG_TINY_FIELD_VALUE_ADVANCED</option> <option value="2">PLG_TINY_FIELD_VALUE_EXTENDED</option> </field> <field name="skin" type="list" default="0" description="PLG_TINY_FIELD_SKIN_DESC" label="PLG_TINY_FIELD_SKIN_LABEL" > <option value="0">PLG_TINY_FIELD_VALUE_DEFAULT</option> </field> <field name="mobile" type="radio" class="btn-group btn-group-yesno" default="0" description="PLG_TINY_FIELD_MOBILE_DESC" label="PLG_TINY_FIELD_MOBILE_LABEL" > <option value="1">JON</option> <option value="0">JOFF</option> </field> <field name="entity_encoding" type="list" default="raw" description="PLG_TINY_FIELD_ENCODING_DESC" label="PLG_TINY_FIELD_ENCODING_LABEL" > <option value="named">PLG_TINY_FIELD_VALUE_NAMED</option> <option value="numeric">PLG_TINY_FIELD_VALUE_NUMERIC</option> <option value="raw">PLG_TINY_FIELD_VALUE_RAW</option> </field> <field name="lang_mode" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_TINY_FIELD_LANGSELECT_DESC" label="PLG_TINY_FIELD_LANGSELECT_LABEL" > <option value="1">JON</option> <option value="0">JOFF</option> </field> <field name="lang_code" type="filelist" class="inputbox" description="PLG_TINY_FIELD_LANGCODE_DESC" label="PLG_TINY_FIELD_LANGCODE_LABEL" stripext="1" directory="media/editors/tinymce/langs/" hide_none="1" default="en" hide_default="1" filter="\.js$" size="10" /> <field name="text_direction" type="list" default="ltr" description="PLG_TINY_FIELD_DIRECTION_DESC" label="PLG_TINY_FIELD_DIRECTION_LABEL" > <option value="ltr">PLG_TINY_FIELD_VALUE_LTR</option> <option value="rtl">PLG_TINY_FIELD_VALUE_RTL</option> </field> <field name="content_css" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_TINY_FIELD_CSS_DESC" label="PLG_TINY_FIELD_CSS_LABEL" > <option value="1">JON</option> <option value="0">JOFF</option> </field> <field name="content_css_custom" type="text" size="30" description="PLG_TINY_FIELD_CUSTOM_CSS_DESC" label="PLG_TINY_FIELD_CUSTOM_CSS_LABEL" /> <field name="relative_urls" type="list" default="1" description="PLG_TINY_FIELD_URLS_DESC" label="PLG_TINY_FIELD_URLS_LABEL" > <option value="0">PLG_TINY_FIELD_VALUE_ABSOLUTE</option> <option value="1">PLG_TINY_FIELD_VALUE_RELATIVE</option> </field> <field name="newlines" type="list" default="0" description="PLG_TINY_FIELD_NEWLINES_DESC" label="PLG_TINY_FIELD_NEWLINES_LABEL" > <option value="1">PLG_TINY_FIELD_VALUE_BR</option> <option value="0">PLG_TINY_FIELD_VALUE_P</option> </field> <field name="invalid_elements" type="textarea" cols="30" default="script,applet,iframe" description="PLG_TINY_FIELD_PROHIBITED_DESC" label="PLG_TINY_FIELD_PROHIBITED_LABEL" rows="2" /> <field name="extended_elements" type="textarea" cols="30" description="PLG_TINY_FIELD_ELEMENTS_DESC" label="PLG_TINY_FIELD_ELEMENTS_LABEL" rows="2" /> </fieldset> <fieldset name="advanced" label="PLG_TINY_FIELD_LABEL_ADVANCEDPARAMS" > <field name="html_height" type="text" default="550" description="PLG_TINY_FIELD_HTMLHEIGHT_DESC" label="PLG_TINY_FIELD_HTMLHEIGHT_LABEL" /> <field name="html_width" type="text" default="750" description="PLG_TINY_FIELD_HTMLWIDTH_DESC" label="PLG_TINY_FIELD_HTMLWIDTH_LABEL" /> <field name="resizing" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_TINY_FIELD_RESIZING_DESC" label="PLG_TINY_FIELD_RESIZING_LABEL" > <option value="1">JON</option> <option value="0">JOFF</option> </field> <field name="element_path" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_TINY_FIELD_PATH_DESC" label="PLG_TINY_FIELD_PATH_LABEL" > <option value="1">JON</option> <option value="0">JOFF</option> </field> <field name="spacer" type="spacer" class="text" label="PLG_TINY_FIELD_NAME_EXTENDED_LABEL" /> <field name="fonts" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_TINY_FIELD_FONTS_DESC" label="PLG_TINY_FIELD_FONTS_LABEL" > <option value="1">JSHOW</option> <option value="0">JHIDE</option> </field> <field name="paste" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_TINY_FIELD_PASTE_DESC" label="PLG_TINY_FIELD_PASTE_LABEL" > <option value="1">JSHOW</option> <option value="0">JHIDE</option> </field> <field name="searchreplace" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_TINY_FIELD_SEARCH-REPLACE_DESC" label="PLG_TINY_FIELD_SEARCH-REPLACE_LABEL" > <option value="1">JSHOW</option> <option value="0">JHIDE</option> </field> <field name="insertdate" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_TINY_FIELD_DATE_DESC" label="PLG_TINY_FIELD_DATE_LABEL" > <option value="1">JSHOW</option> <option value="0">JHIDE</option> </field> <field name="colors" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_TINY_FIELD_COLORS_DESC" label="PLG_TINY_FIELD_COLORS_LABEL" > <option value="1">JSHOW</option> <option value="0">JHIDE</option> </field> <field name="table" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_TINY_FIELD_TABLE_DESC" label="PLG_TINY_FIELD_TABLE_LABEL" > <option value="1">JSHOW</option> <option value="0">JHIDE</option> </field> <field name="smilies" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_TINY_FIELD_SMILIES_DESC" label="PLG_TINY_FIELD_SMILIES_LABEL" > <option value="1">JSHOW</option> <option value="0">JHIDE</option> </field> <field name="hr" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_TINY_FIELD_HR_DESC" label="PLG_TINY_FIELD_HR_LABEL" > <option value="1">JSHOW</option> <option value="0">JHIDE</option> </field> <field name="link" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_TINY_FIELD_LINK_DESC" label="PLG_TINY_FIELD_LINK_LABEL" > <option value="1">JSHOW</option> <option value="0">JHIDE</option> </field> <field name="media" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_TINY_FIELD_MEDIA_DESC" label="PLG_TINY_FIELD_MEDIA_LABEL" > <option value="1">JSHOW</option> <option value="0">JHIDE</option> </field> <field name="print" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_TINY_FIELD_PRINT_DESC" label="PLG_TINY_FIELD_PRINT_LABEL" > <option value="1">JSHOW</option> <option value="0">JHIDE</option> </field> <field name="directionality" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_TINY_FIELD_RTL_DESC" label="PLG_TINY_FIELD_RTL_LABEL" > <option value="1">JSHOW</option> <option value="0">JHIDE</option> </field> <field name="fullscreen" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_TINY_FIELD_FULLSCREEN_DESC" label="PLG_TINY_FIELD_FULLSCREEN_LABEL" > <option value="1">JSHOW</option> <option value="0">JHIDE</option> </field> <field name="alignment" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_TINY_FIELD_ALIGN_DESC" label="PLG_TINY_FIELD_ALIGN_LABEL" > <option value="1">JSHOW</option> <option value="0">JHIDE</option> </field> <field name="visualchars" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_TINY_FIELD_VISUALCHARS_DESC" label="PLG_TINY_FIELD_VISUALCHARS_LABEL" > <option value="1">JSHOW</option> <option value="0">JHIDE</option> </field> <field name="visualblocks" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_TINY_FIELD_VISUALBLOCKS_DESC" label="PLG_TINY_FIELD_VISUALBLOCKS_LABEL" > <option value="1">JSHOW</option> <option value="0">JHIDE</option> </field> <field name="nonbreaking" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_TINY_FIELD_NONBREAKING_DESC" label="PLG_TINY_FIELD_NONBREAKING_LABEL" > <option value="1">JSHOW</option> <option value="0">JHIDE</option> </field> <field name="template" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_TINY_FIELD_TEMPLATE_DESC" label="PLG_TINY_FIELD_TEMPLATE_LABEL" > <option value="1">JSHOW</option> <option value="0">JHIDE</option> </field> <field name="blockquote" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_TINY_FIELD_BLOCKQUOTE_DESC" label="PLG_TINY_FIELD_BLOCKQUOTE_LABEL" > <option value="1">JON</option> <option value="0">JOFF</option> </field> <field name="wordcount" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_TINY_FIELD_WORDCOUNT_DESC" label="PLG_TINY_FIELD_WORDCOUNT_LABEL" > <option value="1">JON</option> <option value="0">JOFF</option> </field> <field name="image_advtab" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_TINY_FIELD_ADVIMAGE_DESC" label="PLG_TINY_FIELD_ADVIMAGE_LABEL" > <option value="1">JON</option> <option value="0">JOFF</option> </field> <field name="advlist" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_TINY_FIELD_ADVLIST_DESC" label="PLG_TINY_FIELD_ADVLIST_LABEL" > <option value="1">JON</option> <option value="0">JOFF</option> </field> <field name="autosave" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_TINY_FIELD_SAVEWARNING_DESC" label="PLG_TINY_FIELD_SAVEWARNING_LABEL" > <option value="1">JON</option> <option value="0">JOFF</option> </field> <field name="contextmenu" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_TINY_FIELD_CONTEXTMENU_DESC" label="PLG_TINY_FIELD_CONTEXTMENU_LABEL" > <option value="1">JON</option> <option value="0">JOFF</option> </field> <field name="inlinepopups" type="radio" class="btn-group btn-group-yesno" default="1" description="PLG_TINY_FIELD_INLINEPOPUPS_DESC" label="PLG_TINY_FIELD_INLINEPOPUPS_LABEL" > <option value="1">JON</option> <option value="0">JOFF</option> </field> <field name="custom_plugin" type="text" description="PLG_TINY_FIELD_CUSTOMPLUGIN_DESC" label="PLG_TINY_FIELD_CUSTOMPLUGIN_LABEL" /> <field name="custom_button" type="text" description="PLG_TINY_FIELD_CUSTOMBUTTON_DESC" label="PLG_TINY_FIELD_CUSTOMBUTTON_LABEL" /> </fieldset> </fields> </config> </extension> editors/tinymce/index.html 0000666 00000000037 15077165755 0011710 0 ustar 00 <!DOCTYPE html><title></title> editors/tinymce/tinymce.php 0000666 00000052400 15077165755 0012075 0 ustar 00 <?php /** * @package Joomla.Plugin * @subpackage Editors.tinymce * * @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * TinyMCE Editor Plugin * * @package Joomla.Plugin * @subpackage Editors.tinymce * @since 1.5 */ class PlgEditorTinymce extends JPlugin { /** * Base path for editor files */ protected $_basePath = 'media/editors/tinymce'; /** * Load the language file on instantiation. * * @var boolean * @since 3.1 */ protected $autoloadLanguage = true; /** * Loads the application object * * @var JApplicationCms * @since 3.2 */ protected $app = null; /** * Initialises the Editor. * * @return string JavaScript Initialization string * * @since 1.5 */ public function onInit() { $language = JFactory::getLanguage(); $mode = (int) $this->params->get('mode', 1); $theme = 'modern'; $skin = $this->params->get('skin', '0'); switch ($skin) { case '0': default: $skin = 'skin : "lightgray",'; } $entity_encoding = $this->params->get('entity_encoding', 'raw'); $langMode = $this->params->get('lang_mode', 0); $langPrefix = $this->params->get('lang_code', 'en'); if ($langMode) { if (file_exists(JPATH_ROOT . "/media/editors/tinymce/langs/" . $language->getTag() . ".js")) { $langPrefix = $language->getTag(); } elseif (file_exists(JPATH_ROOT . "/media/editors/tinymce/langs/" . substr($language->getTag(), 0, strpos($language->getTag(), '-')) . ".js")) { $langPrefix = substr($language->getTag(), 0, strpos($language->getTag(), '-')); } else { $langPrefix = "en"; } } $text_direction = 'ltr'; if ($language->isRTL()) { $text_direction = 'rtl'; } $use_content_css = $this->params->get('content_css', 1); $content_css_custom = $this->params->get('content_css_custom', ''); /* * Lets get the default template for the site application */ $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('template') ->from('#__template_styles') ->where('client_id=0 AND home=' . $db->quote('1')); $db->setQuery($query); $template = $db->loadResult(); $content_css = ''; $templates_path = JPATH_SITE . '/templates'; // Loading of css file for 'styles' dropdown if ( $content_css_custom ) { // If URL, just pass it to $content_css if (strpos($content_css_custom, 'http') !== false) { $content_css = 'content_css : "' . $content_css_custom . '",'; } // If it is not a URL, assume it is a file name in the current template folder else { $content_css = 'content_css : "' . JUri::root() . 'templates/' . $template . '/css/' . $content_css_custom . '",'; // Issue warning notice if the file is not found (but pass name to $content_css anyway to avoid TinyMCE error if (!file_exists($templates_path . '/' . $template . '/css/' . $content_css_custom)) { $msg = sprintf(JText::_('PLG_TINY_ERR_CUSTOMCSSFILENOTPRESENT'), $content_css_custom); JLog::add($msg, JLog::WARNING, 'jerror'); } } } else { // Process when use_content_css is Yes and no custom file given if ($use_content_css) { // First check templates folder for default template // if no editor.css file in templates folder, check system template folder if (!file_exists($templates_path . '/' . $template . '/css/editor.css')) { // If no editor.css file in system folder, show alert if (!file_exists($templates_path . '/system/css/editor.css')) { JLog::add(JText::_('PLG_TINY_ERR_EDITORCSSFILENOTPRESENT'), JLog::WARNING, 'jerror'); } else { $content_css = 'content_css : "' . JUri::root() . 'templates/system/css/editor.css",'; } } else { $content_css = 'content_css : "' . JUri::root() . 'templates/' . $template . '/css/editor.css",'; } } } $relative_urls = $this->params->get('relative_urls', '1'); if ($relative_urls) { // Relative $relative_urls = "true"; } else { // Absolute $relative_urls = "false"; } $newlines = $this->params->get('newlines', 0); if ($newlines) { // Break $forcenewline = "force_br_newlines : true, force_p_newlines : false, forced_root_block : '',"; } else { // Paragraph $forcenewline = "force_br_newlines : false, force_p_newlines : true, forced_root_block : 'p',"; } $invalid_elements = $this->params->get('invalid_elements', 'script,applet,iframe'); $extended_elements = $this->params->get('extended_elements', ''); // Advanced Options $html_height = $this->params->get('html_height', '550'); $html_width = $this->params->get('html_width', '750'); // Image advanced options $image_advtab = $this->params->get('image_advtab', 1); if ($image_advtab) { $image_advtab = "true"; } else { $image_advtab = "false"; } // The param is true false, so we turn true to both rather than showing vertical resize only $resizing = $this->params->get('resizing', '1'); if ($resizing || $resizing == 'true') { $resizing = 'resize: "both",'; } else { $resizing = 'resize: false,'; } $toolbar1_add = array(); $toolbar2_add = array(); $toolbar3_add = array(); $toolbar4_add = array(); $elements = array(); $plugins = array('autolink', 'lists', 'image', 'charmap', 'print', 'preview', 'anchor', 'pagebreak', 'code', 'save', 'textcolor', 'importcss'); $toolbar1_add[] = 'bold'; $toolbar1_add[] = 'italic'; $toolbar1_add[] = 'underline'; $toolbar1_add[] = 'strikethrough'; // Alignment buttons $alignment = $this->params->get('alignment', 1); if ($alignment) { $toolbar1_add[] = '|'; $toolbar1_add[] = 'alignleft'; $toolbar1_add[] = 'aligncenter'; $toolbar1_add[] = 'alignright'; $toolbar1_add[] = 'alignjustify'; } $toolbar1_add[] = '|'; $toolbar1_add[] = 'styleselect'; $toolbar1_add[] = '|'; $toolbar1_add[] = 'formatselect'; // Fonts $fonts = $this->params->get('fonts', 1); if ($fonts) { $toolbar1_add[] = 'fontselect'; $toolbar1_add[] = 'fontsizeselect'; } // Search & replace $searchreplace = $this->params->get('searchreplace', 1); if ($searchreplace) { $plugins[] = 'searchreplace'; $toolbar2_add[] = 'searchreplace'; } $toolbar2_add[] = '|'; $toolbar2_add[] = 'bullist'; $toolbar2_add[] = 'numlist'; $toolbar2_add[] = '|'; $toolbar2_add[] = 'outdent'; $toolbar2_add[] = 'indent'; $toolbar2_add[] = '|'; $toolbar2_add[] = 'undo'; $toolbar2_add[] = 'redo'; $toolbar2_add[] = '|'; // Insert date and/or time plugin $insertdate = $this->params->get('insertdate', 1); if ($insertdate) { $plugins[] = 'insertdatetime'; $toolbar4_add[] = 'inserttime'; } // Link plugin $link = $this->params->get('link', 1); if ($link) { $plugins[] = 'link'; $toolbar2_add[] = 'link'; $toolbar2_add[] = 'unlink'; } $toolbar2_add[] = 'anchor'; $toolbar2_add[] = 'image'; $toolbar2_add[] = '|'; $toolbar2_add[] = 'code'; // Colours $colours = $this->params->get('colours', 1); if ($colours) { $toolbar2_add[] = '|'; $toolbar2_add[] = 'forecolor,backcolor'; } // Fullscreen $fullscreen = $this->params->get('fullscreen', 1); if ($fullscreen) { $plugins[] = 'fullscreen'; $toolbar2_add[] = '|'; $toolbar2_add[] = 'fullscreen'; } // Table $table = $this->params->get('table', 1); if ($table) { $plugins[] = 'table'; $toolbar3_add[] = 'table'; $toolbar3_add[] = '|'; } $toolbar3_add[] = 'subscript'; $toolbar3_add[] = 'superscript'; $toolbar3_add[] = '|'; $toolbar3_add[] = 'charmap'; // Emotions $smilies = $this->params->get('smilies', 1); if ($smilies) { $plugins[] = 'emoticons'; $toolbar3_add[] = 'emoticons'; } // Media plugin $media = $this->params->get('media', 1); if ($media) { $plugins[] = 'media'; $toolbar3_add[] = 'media'; } // Horizontal line $hr = $this->params->get('hr', 1); if ($hr) { $plugins[] = 'hr'; $elements[] = 'hr[id|title|alt|class|width|size|noshade]'; $toolbar3_add[] = 'hr'; } else { $elements[] = 'hr[id|class|title|alt]'; } // RTL/LTR buttons $directionality = $this->params->get('directionality', 1); if ($directionality) { $plugins[] = 'directionality'; $toolbar3_add[] = 'ltr rtl'; } if ($extended_elements != "") { $elements = explode(',', $extended_elements); } $toolbar4_add[] = 'cut'; $toolbar4_add[] = 'copy'; // Paste $paste = $this->params->get('paste', 1); if ($paste) { $plugins[] = 'paste'; $toolbar4_add[] = 'paste'; } $toolbar4_add[] = '|'; // Visualchars $visualchars = $this->params->get('visualchars', 1); if ($visualchars) { $plugins[] = 'visualchars'; $toolbar4_add[] = 'visualchars'; } // Visualblocks $visualblocks = $this->params->get('visualblocks', 1); if ($visualblocks) { $plugins[] = 'visualblocks'; $toolbar4_add[] = 'visualblocks'; } // Non-breaking $nonbreaking = $this->params->get('nonbreaking', 1); if ($nonbreaking) { $plugins[] = 'nonbreaking'; $toolbar4_add[] = 'nonbreaking'; } // Blockquote $blockquote = $this->params->get('blockquote', 1); if ($blockquote) { $toolbar4_add[] = 'blockquote'; } // Template $template = $this->params->get('template', 1); if ($template) { $plugins[] = 'template'; $toolbar4_add[] = 'template'; // Note this check for the template_list.js file will be removed in Joomla 4.0 if (is_file(JPATH_ROOT . "/media/editors/tinymce/templates/template_list.js")) { // If using the legacy file we need to include and input the files the new way $str = file_get_contents(JPATH_ROOT . "/media/editors/tinymce/templates/template_list.js"); // Find from one [ to the last ] preg_match_all('/\[.*\]/', $str, $matches); $templates = "templates: ["; // Set variables foreach ($matches['0'] as $match) { preg_match_all('/\".*\"/', $match, $values); $result = trim($values["0"]["0"], '"'); $final_result = explode(',', $result); $templates .= "{title: '" . trim($final_result['0'], ' " ') . "', description: '" . trim($final_result['2'], ' " ') . "', url: '" . JUri::root() . trim($final_result['1'], ' " ') . "'},"; } $templates .= "],"; } else { $templates = "templates: [ {title: 'Layout', description: 'HTMLLayout', url:'" . JUri::root() . "media/editors/tinymce/templates/layout1.html'}, {title: 'Simple snippet', description: 'Simple HTML snippet', url:'" . JUri::root() . "media/editors/tinymce/templates/snippet1.html'} ],"; } } else { $templates = ''; } // Print $print = $this->params->get('print', 1); if ($print) { $plugins[] = 'print'; $toolbar4_add[] = '|'; $toolbar4_add[] = 'print'; $toolbar4_add[] = 'preview'; } // Spellchecker $spell = $this->params->get('spell', 0); if ($spell) { $plugins[] = 'spellchecker'; $toolbar4_add[] = '|'; $toolbar4_add[] = 'spellchecker'; } // Wordcount $wordcount = $this->params->get('wordcount', 1); if ($wordcount) { $plugins[] = 'wordcount'; } // Advlist $advlist = $this->params->get('advlist', 1); if ($advlist) { $plugins[] = 'advlist'; } // Autosave $autosave = $this->params->get('autosave', 1); if ($autosave) { $plugins[] = 'autosave'; } // Context menu $contextmenu = $this->params->get('contextmenu', 1); if ($contextmenu) { $plugins[] = 'contextmenu'; } $custom_plugin = $this->params->get('custom_plugin', ''); if ($custom_plugin != "") { $plugins[] = $custom_plugin; } $custom_button = $this->params->get('custom_button', ''); if ($custom_button != "") { $toolbar4_add[] = $custom_button; } // Prepare config variables $plugins = implode(',', $plugins); $elements = implode(',', $elements); // Prepare config variables $toolbar1 = implode(' ', $toolbar1_add); $toolbar2 = implode(' ', $toolbar2_add); $toolbar3 = implode(' ', $toolbar3_add); $toolbar4 = implode(' ', $toolbar4_add); // See if mobileVersion is activated $mobileVersion = $this->params->get('mobile', 0); $load = "\t<script type=\"text/javascript\" src=\"" . JUri::root() . $this->_basePath . "/tinymce.min.js\"></script>\n"; /** * Shrink the buttons if not on a mobile or if mobile view is off. * If mobile view is on force into simple mode and enlarge the buttons **/ if (!$this->app->client->mobile) { $smallButtons = 'toolbar_items_size: "small",'; } elseif ($mobileVersion == false) { $smallButtons = ''; } else { $smallButtons = ''; $mode = 0; } switch ($mode) { case 0: /* Simple mode*/ $return = $load . "\t<script type=\"text/javascript\"> tinymce.init({ // General directionality: \"$text_direction\", selector: \"textarea.mce_editable\", language : \"$langPrefix\", mode : \"specific_textareas\", autosave_restore_when_empty: false, $skin theme : \"$theme\", schema: \"html5\", menubar: false, toolbar1: \"bold italics underline strikethrough | undo redo | bullist numlist\", // Cleanup/Output inline_styles : true, gecko_spellcheck : true, entity_encoding : \"$entity_encoding\", $forcenewline $smallButtons // URL relative_urls : $relative_urls, remove_script_host : false, // Layout $content_css document_base_url : \"" . JUri::root() . "\" }); </script>"; break; case 1: default: /* Advanced mode*/ $toolbar1 = "bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | formatselect | bullist numlist"; $toolbar2 = "outdent indent | undo redo | link unlink anchor image code | hr table | subscript superscript | charmap"; $return = $load . "\t<script type=\"text/javascript\"> tinyMCE.init({ // General directionality: \"$text_direction\", language : \"$langPrefix\", mode : \"specific_textareas\", autosave_restore_when_empty: false, $skin theme : \"$theme\", schema: \"html5\", selector: \"textarea.mce_editable\", // Cleanup/Output inline_styles : true, gecko_spellcheck : true, entity_encoding : \"$entity_encoding\", extended_valid_elements : \"$elements\", $forcenewline $smallButtons invalid_elements : \"$invalid_elements\", // Plugins plugins : \"table link image code charmap autolink lists importcss\", // Toolbar toolbar1: \"$toolbar1\", toolbar2: \"$toolbar2\", removed_menuitems: \"newdocument\", // URL relative_urls : $relative_urls, remove_script_host : false, document_base_url : \"" . JUri::root() . "\", // Layout $content_css importcss_append: true, // Advanced Options $resizing height : \"$html_height\", width : \"$html_width\", }); </script>"; break; case 2: /* Extended mode*/ $return = $load . "\t<script type=\"text/javascript\"> tinyMCE.init({ // General directionality: \"$text_direction\", language : \"$langPrefix\", mode : \"specific_textareas\", autosave_restore_when_empty: false, $skin theme : \"$theme\", schema: \"html5\", selector: \"textarea.mce_editable\", // Cleanup/Output inline_styles : true, gecko_spellcheck : true, entity_encoding : \"$entity_encoding\", extended_valid_elements : \"$elements\", $forcenewline $smallButtons invalid_elements : \"$invalid_elements\", // Plugins plugins : \"$plugins\", // Toolbar toolbar1: \"$toolbar1\", toolbar2: \"$toolbar2\", toolbar3: \"$toolbar3\", toolbar4: \"$toolbar4\", removed_menuitems: \"newdocument\", // URL relative_urls : $relative_urls, remove_script_host : false, document_base_url : \"" . JUri::root() . "\", rel_list : [ {title: 'Alternate', value: 'alternate'}, {title: 'Author', value: 'author'}, {title: 'Bookmark', value: 'bookmark'}, {title: 'Help', value: 'help'}, {title: 'License', value: 'license'}, {title: 'Lightbox', value: 'lightbox'}, {title: 'Next', value: 'next'}, {title: 'No Follow', value: 'nofollow'}, {title: 'No Referrer', value: 'noreferrer'}, {title: 'Prefetch', value: 'prefetch'}, {title: 'Prev', value: 'prev'}, {title: 'Search', value: 'search'}, {title: 'Tag', value: 'tag'} ], //Templates " . $templates . " // Layout $content_css importcss_append: true, // Advanced Options $resizing image_advtab: $image_advtab, height : \"$html_height\", width : \"$html_width\", }); </script>"; break; } return $return; } /** * TinyMCE WYSIWYG Editor - get the editor content * * @param string $editor The name of the editor * * @return string */ public function onGetContent($editor) { return 'tinyMCE.get(\'' . $editor . '\').getContent();'; } /** * TinyMCE WYSIWYG Editor - set the editor content * * @param string $editor The name of the editor * @param string $html The html to place in the editor * * @return string */ public function onSetContent($editor, $html) { return 'tinyMCE.get(\'' . $editor . '\').setContent(' . $html . ');'; } /** * TinyMCE WYSIWYG Editor - copy editor content to form field * * @param string $editor The name of the editor * * @return string */ public function onSave($editor) { return 'if (tinyMCE.get("' . $editor . '").isHidden()) {tinyMCE.get("' . $editor . '").show()}; tinyMCE.get("' . $editor . '").save();'; } /** * Inserts html code into the editor * * @param string $name The name of the editor * * @return boolean */ public function onGetInsertMethod($name) { $doc = JFactory::getDocument(); $js = " function isBrowserIE() { return navigator.appName==\"Microsoft Internet Explorer\"; } function jInsertEditorText( text, editor ) { if (isBrowserIE()) { if (window.parent.tinyMCE) { window.parent.tinyMCE.selectedInstance.selection.moveToBookmark(window.parent.global_ie_bookmark); } } tinyMCE.execCommand('mceInsertContent', false, text); } var global_ie_bookmark = false; function IeCursorFix() { if (isBrowserIE()) { tinyMCE.execCommand('mceInsertContent', false, ''); global_ie_bookmark = tinyMCE.activeEditor.selection.getBookmark(false); } return true; }"; $doc->addScriptDeclaration($js); return true; } /** * Display the editor area. * * @param string $name The name of the editor area. * @param string $content The content of the field. * @param string $width The width of the editor area. * @param string $height The height of the editor area. * @param int $col The number of columns for the editor area. * @param int $row The number of rows for the editor area. * @param boolean $buttons True and the editor buttons will be displayed. * @param string $id An optional ID for the textarea. If not supplied the name is used. * @param string $asset The object asset * @param object $author The author. * * @return string */ 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'; } // Data object for the layout $textarea = new stdClass; $textarea->name = $name; $textarea->id = $id; $textarea->cols = $col; $textarea->rows = $row; $textarea->width = $width; $textarea->height = $height; $textarea->content = $content; $editor = '<div class="editor">'; $editor .= JLayoutHelper::render('joomla.tinymce.textarea', $textarea); $editor .= $this->_displayButtons($id, $buttons, $asset, $author); $editor .= $this->_toogleButton($id); $editor .= '</div>'; return $editor; } /** * Displays the editor buttons. * * @param string $name The editor name * @param mixed $buttons [array with button objects | boolean true to display buttons] * @param string $asset The object asset * @param object $author The author. * * @return string HTML */ private function _displayButtons($name, $buttons, $asset, $author) { $return = ''; $args = array( 'name' => $name, 'event' => 'onGetInsertMethod' ); $results = (array) $this->update($args); if ($results) { foreach ($results as $result) { if (is_string($result) && trim($result)) { $return .= $result; } } } if (is_array($buttons) || (is_bool($buttons) && $buttons)) { $buttons = $this->_subject->getButtons($name, $buttons, $asset, $author); $return .= JLayoutHelper::render('joomla.editors.buttons', $buttons); } return $return; } /** * Get the toggle editor button * * @param string $name Editor name * * @return string */ private function _toogleButton($name) { return JLayoutHelper::render('joomla.tinymce.togglebutton', $name); } } editors/index.html 0000666 00000000037 15077165755 0010240 0 ustar 00 <!DOCTYPE html><title></title> editors/jce/jce.php 0000666 00000016022 15077165755 0010257 0 ustar 00 <?php /** * @package JCE * @copyright Copyright (c) 2009-2012 Ryan Demmer. All rights reserved. * @license GNU/GPL 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html * JCE 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. */ // Do not allow direct access defined('_JEXEC') or die('RESTRICTED'); jimport('joomla.plugin.plugin'); /** * JCE WYSIWYG Editor Plugin * @since 1.5 */ class plgEditorJCE extends JPlugin { /** * Constructor * * @access public * @param object $subject The object to observe * @param array $config An array that holds the plugin configuration * @since 1.5 */ public function __construct(& $subject, $config) { parent::__construct($subject, $config); } /** * Method to handle the onInit event. * - Initializes the JCE WYSIWYG Editor * * @access public * @param $toString Return javascript and css as a string * @return string JavaScript Initialization string * @since 1.5 */ public function onInit() { $app = JFactory::getApplication(); $language = JFactory::getLanguage(); $document = JFactory::getDocument(); // set IE mode //$document->setMetaData('X-UA-Compatible', 'IE=Edge', true); // Check for existence of Admin Component if (!is_dir(JPATH_SITE . '/components/com_jce') || !is_dir(JPATH_ADMINISTRATOR . '/components/com_jce')) { JError::raiseWarning('SOME_ERROR_CODE', 'WF_COMPONENT_MISSING'); } $language->load('plg_editors_jce', JPATH_ADMINISTRATOR); $language->load('com_jce', JPATH_ADMINISTRATOR); // load constants and loader require_once(JPATH_ADMINISTRATOR . '/components/com_jce/includes/base.php'); wfimport('admin.models.editor'); $model = new WFModelEditor(); return $model->buildEditor(); } /** * JCE WYSIWYG Editor - get the editor content * * @vars string The name of the editor */ public function onGetContent($editor) { //return "WFEditor.getContent('" . $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 = '<label for="' . $id . '" style="display:none;" aria-visible="false">' . $id . '_textarea</label><textarea id="' . $id . '" name="' . $name . '" cols="' . $col . '" rows="' . $row . '" style="width:' . $width . ';height:' . $height . ';" class="wfEditor mce_editable source" wrap="off">' . $content . '</textarea>'; $editor .= $this->_displayButtons($id, $buttons, $asset, $author); return $editor; } public function onGetInsertMethod($name) { } private function _displayButtons($name, $buttons, $asset, $author) { $return = ''; $args = array( 'name' => $name, 'event' => 'onGetInsertMethod' ); $results = (array) $this->update($args); foreach ($results as $result) { if (is_string($result) && trim($result)) { $return .= $result; } } $version = new JVersion; if (is_array($buttons) || (is_bool($buttons) && $buttons)) { $buttons = $this->_subject->getButtons($name, $buttons, $asset, $author); if ($version->isCompatible('3.0')) { // fix for some buttons that do not include the class foreach($buttons as $button) { if (is_object($button)) { if (isset($button->class)) { if (preg_match('#\bbtn\b#', $button->class) === false) { $button->class .= " btn"; } } else { $button->class = "btn"; } } } $return .= JLayoutHelper::render('joomla.editors.buttons', $buttons); } else { // Load modal popup behavior JHTML::_('behavior.modal', 'a.modal-button'); /* * This will allow plugins to attach buttons or change the behavior on the fly using AJAX */ $return .= "\n<div id=\"editor-xtd-buttons\""; $return .= ">\n"; foreach ($buttons as $button) { /* * Results should be an object */ if ($button->get('name')) { $modal = ($button->get('modal')) ? ' class="btn modal-button"' : ''; $href = ($button->get('link')) ? ' class="btn" href="' . JURI::base() . $button->get('link') . '"' : ''; $onclick = ($button->get('onclick')) ? ' onclick="' . $button->get('onclick') . '"' : ' onclick="IeCursorFix(); return false;"'; $title = ($button->get('title')) ? $button->get('title') : $button->get('text'); $return .= '<div class="button2-left"><div class="' . $button->get('name') . '">'; $return .= '<a' . $modal . ' title="' . $title . '"' . $href . $onclick . ' rel="' . $button->get('options') . '">'; $return .= $button->get('text') . '</a>'; $return .= '</div></div>'; } } $return .= "</div>\n"; } } return $return; } } ?>