Index: branches/RC/core/kernel/db/db_tag_processor.php =================================================================== diff -u -N -r11758 -r11760 --- branches/RC/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 11758) +++ branches/RC/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 11760) @@ -2135,6 +2135,7 @@ function FCKEditor($params) { $params['no_special'] = 1; + $params['format'] = array_key_exists('format', $params) ? $params['format'] . ';fck_ready' : 'fck_ready'; $value = $this->Field($params); $name = array_key_exists('name', $params) ? $params['name'] : $this->InputName($params); @@ -2151,16 +2152,19 @@ $bgcolor = '#ffffff'; } - $url = ''; - $st_id = $this->Application->GetVar('st_id'); - if ($st_id) { + $preview_url = ''; + $page_id = $this->Application->GetVar('c_id'); + $content_id = $this->Application->GetVar('content_id'); + if ($page_id && $content_id) { + // editing content block from Front-End, not category in admin $sql = 'SELECT NamedParentPath - FROM ' . $this->Application->getUnitOption('st', 'TableName') . ' - WHERE ' . $this->Application->getUnitOption('st', 'IDField') . ' = ' . $st_id; - $tpl = $this->Conn->GetOne($sql); + FROM ' . $this->Application->getUnitOption('c', 'TableName') . ' + WHERE ' . $this->Application->getUnitOption('c', 'IDField') . ' = ' . $page_id; + $template = strtolower( $this->Conn->GetOne($sql) ); - $url_params = Array ('pass' => 'm', 'm_cat_id' => $st_id, 'index_file' => 'index.php'); - $url = $this->Application->HREF($tpl, '_FRONT_END_', $url_params); + $url_params = Array ('m_cat_id' => $page_id, 'no_amp' => 1, 'editing_mode' => EDITING_MODE_CMS, 'pass' => 'm'); + $preview_url = $this->Application->HREF($template, '_FRONT_END_', $url_params, 'index.php'); + $preview_url = preg_replace('/&(admin|editing_mode)=[\d]/', '', $preview_url); } include_once(FULL_PATH . EDITOR_PATH . 'fckeditor.php'); @@ -2171,9 +2175,9 @@ $oFCKeditor->BasePath = BASE_PATH . EDITOR_PATH; $oFCKeditor->Width = $params['width'] ; $oFCKeditor->Height = $params['height'] ; - $oFCKeditor->ToolbarSet = $st_id ? 'Advanced' : 'Default'; + $oFCKeditor->ToolbarSet = $page_id && $content_id ? 'Advanced' : 'Default'; $oFCKeditor->Value = $value; - $oFCKeditor->PreviewUrl = $url; + $oFCKeditor->PreviewUrl = $preview_url; $oFCKeditor->DefaultLanguage = $this->SetFCKDefaultLanguage(); $oFCKeditor->LateLoad = array_key_exists('late_load', $params) && $params['late_load']; $oFCKeditor->Config = Array ( @@ -2187,7 +2191,7 @@ 'Admin' => 1, 'K4' => 1, 'newBgColor' => $bgcolor, - 'PreviewUrl' => $url, + 'PreviewUrl' => $preview_url, 'BaseUrl' => BASE_PATH . '/', 'DefaultLanguage' => $this->SetFCKDefaultLanguage(), 'EditorAreaStyles' => 'body { background-color: '.$bgcolor.' }',