dbFields = array( 'toolbar1'=>'formatselect bold italic bullist numlist blockquote alignleft aligncenter alignright link pagebreak image removeformat code', 'toolbar2'=>'', 'plugins'=>'code autolink image link pagebreak advlist lists textcolor colorpicker textpattern' ); } public function form() { global $L; $html = '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; return $html; } public function adminHead() { if (!in_array($GLOBALS['ADMIN_CONTROLLER'], $this->loadOnController)) { return false; } return ''; } public function adminBodyEnd() { if (!in_array($GLOBALS['ADMIN_CONTROLLER'], $this->loadOnController)) { return false; } global $L; $toolbar1 = $this->getValue('toolbar1'); $toolbar2 = $this->getValue('toolbar2'); $plugins = $this->getValue('plugins'); $lang = 'en'; if (file_exists($this->phpPath().'tinymce'.DS.'langs'.DS.$L->currentLanguage().'.js')) { $lang = $L->currentLanguage(); } elseif (file_exists($this->phpPath().'tinymce'.DS.'langs'.DS.$L->currentLanguageShortVersion().'.js')) { $lang = $L->currentLanguageShortVersion(); } $script = << // Function required for Media Manager // Insert an image on the editor in the cursor position function editorInsertMedia(filename) { tinymce.activeEditor.insertContent("\"\""); } // Function required for Autosave function // Returns the content of the editor function editorGetContent() { return tinymce.get('jseditor').getContent(); } $("#jseditor").show(); tinymce.init({ selector: "#jseditor", theme: "modern", skin: "bludit", min_height: 500, max_height: 1000, element_format : "html", entity_encoding : "raw", schema: "html5", statusbar: false, menubar:false, remove_script_host: false, branding: false, browser_spellcheck: true, pagebreak_separator: PAGE_BREAK, paste_as_text: true, relative_urls: true, remove_script_host: false, document_base_url: DOMAIN_UPLOADS, plugins: ["$plugins"], toolbar1: "$toolbar1", toolbar2: "$toolbar2", language: "$lang" }); EOF; return $script; } }