Index: branches/5.2.x/core/kernel/db/db_tag_processor.php =================================================================== diff -u -N -r15291 -r15325 --- branches/5.2.x/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 15291) +++ branches/5.2.x/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 15325) @@ -1,6 +1,6 @@ Application->BaseURL($theme_path) . 'styles.js'; - $bgcolor = isset($params['bgcolor']) ? $params['bgcolor'] : $this->Application->GetVar('bgcolor'); - if ( !$bgcolor ) { - $bgcolor = '#ffffff'; - } - - $page_id = $this->Application->GetVar('c_id'); + /*$page_id = $this->Application->GetVar('c_id'); $content_id = $this->Application->GetVar('content_id'); + $preview_url = ''; - /*$preview_url = ''; if ($page_id && $content_id) { // editing content block from Front-End, not category in admin $sql = 'SELECT NamedParentPath @@ -2621,6 +2616,11 @@ $config_js = $this->Application->BaseURL() . 'core/admin_templates/js/inp_ckconfig.js'; } + $fck_helper = $this->Application->recallObject('FCKHelper'); + /* @var $fck_helper fckFCKHelper */ + + $transit_params = $fck_helper->getTransitParams($params); + $oCKeditor->config = Array ( 'toolbar' => $this->Application->isDebugMode() ? 'DebugMode' : 'Default', // $page_id && $content_id ? 'Advanced' : 'Default', @@ -2634,19 +2634,34 @@ // 'DefaultStyleLabel' => $this->Application->Phrase('la_editor_default_style'), // not ported to ckeditor 'Admin' => 1, // for custom file browser to work 'K4' => 1, // for custom file browser to work - 'newBgColor' => $bgcolor, // 'PreviewUrl' => $preview_url, // 'BaseUrl' => BASE_PATH . '/', // used by custom document plugin & by file browser 'language' => $this->_getFCKLanguage(), - -// 'EditorAreaStyles' => 'body { background-color: '.$bgcolor.' }', // TODO - 'height' => $height, // editor area height ); + if ( isset($transit_params['bgcolor']) && $transit_params['bgcolor'] ) { + $oCKeditor->config['extraCss'] = 'body { background-color: ' . $transit_params['bgcolor'] . '; }'; + } + + foreach ($transit_params as $param_name => $param_value) { + if ( !$param_value ) { + continue; + } + + $param_key = str_replace(' ', '', ucwords(str_replace('_', ' ', $param_name))); + $param_key[0] = strtolower($param_key[0]); + + $oCKeditor->config[$param_key] = $param_value; + } + $oCKeditor->returnOutput = true; - return $oCKeditor->editor($name, $value); + $events = Array ( + 'configLoaded' => 'function(ev) { ev.editor.addCss(ev.editor.config.extraCss); }', + ); + + return $oCKeditor->editor($name, $value, Array (), $events); } function IsNewItem($params)