document.onFileManagerSelect = function(path) { window.opener.CKEDITOR.tools.callFunction(' . (int) $_REQUEST['CKEditorFuncNum'] . ',path); window.close(); }; ' . "\n"; } public static function getHandledDataType() { return 'html'; } public function resetCSSClass() { $this->setCSSClass('html'); } public function generate($parent) { $system = \MCMS\System::getInstance(); $db = $system->getDB(); $id = $this->getID(); $name = $this->getName(); $css = $this->getCSSClass(); $value = $this->getValue(); $instanceName = $system->getTarget('instance'); $cssfile = false; $site = $db->getObject("SELECT * FROM websites WHERE id=" . $system->getSiteId()); $this->layout = $system->getSiteParam($system->getSiteId(), '', 'layout', 'default'); $filebase = __DS__ . $this->layout . __DS__; $urlbase = '/' . $this->layout . '/'; $paths = array( array( _LAYOUTPATHX_ . $filebase . 'css' . __DS__ . 'editor.css', _LAYOUTURLX_ . $urlbase . 'css/editor.css'), array( _LAYOUTPATHX_ . $filebase . 'editor.css', _LAYOUTURLX_ . $urlbase . 'editor.css'), array( _LAYOUTPATH_ . $filebase . 'css' . __DS__ . 'editor.css', _LAYOUTURL_ . $urlbase . 'css/editor.css'), array(_LAYOUTPATH_ . $filebase . 'editor.css',_LAYOUTURL_ . $urlbase . 'editor.css'), array( _LAYOUTPATH_ . __DS__ . 'default' . __DS__ . 'editor.css', _LAYOUTURL_ . '/default/editor.css')); foreach($paths as $csspath) { if(file_exists($csspath[0])) { $cssfile = $csspath[1]; break; } } require_once (implode(__DS__, array( __DIR__,'_js_',self::VERSION,'ckeditor_php5.php'))); $editor = new \CKEditor(); $editor->BasePath = implode('/', array( _COMURL_,'editor','html','ckeditor','_js_',self::VERSION)) . '/'; $editor->returnOutput = true; $editor->textareaAttributes['id'] = $id; $config = array(); $config['skin'] = 'office2003'; if(!empty($cssfile)) { $config['extraPlugins'] = 'stylesheetparser'; $config['contentsCss'] = $cssfile; $config['stylesSet'] = '[]'; // config.stylesheetParser_validSelectors = /\^(p|span)\.\w+/; // config.stylesheetParser_skipSelectors = /(^body\.|^caption\.|\.high|^\.)/i; } $config['toolbar'] = array( array( 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo','-', 'Find','Replace','-','SelectAll','RemoveFormat','-','Preview','Templates', '-','Maximize','ShowBlocks','Source'),'/', array( 'Bold','Italic','Underline','Strike','-','Subscript','Superscript','-', 'NumberedList','BulletedList','-','Outdent','Indent','Blockquote','-', 'JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','Link', 'Unlink','Anchor','-','Image','Flash','Table','HorizontalRule','SpecialChar'), '/',array('Format','Font','FontSize','-','TextColor','BGColor')); // $config['toolbar'] = 'Basic'; $config['filebrowserBrowseUrl'] = _SELF_SERVICE_ . '?mod=*mm&target=' . $instanceName . '&mode=file&id=' . $id; $config['filebrowserImageBrowseUrl'] = _SELF_SERVICE_ . '?mod=*mm&target=' . $instanceName . '&mode=image&id=' . $id; $config['filebrowserFlashBrowseUrl'] = _SELF_SERVICE_ . '?mod=*mm&target=' . $instanceName . '&mode=flash&id=' . $id; return array( 'html' => $editor->editor($this->getName(), (string) $value, $config), 'js_import' => array($editor->BasePath . '/ckeditor.js')); } }