Index: branches/RC/core/kernel/db/db_tag_processor.php =================================================================== diff -u -N -r10975 -r11067 --- branches/RC/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 10975) +++ branches/RC/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 11067) @@ -2039,51 +2039,64 @@ if (file_exists(FULL_PATH.EDITOR_PATH.'/editor/lang/'.$lang_file)) { return $lang_prefix; - } + } $aLangPrefix = explode("-",$lang_prefix); if (file_exists(FULL_PATH.EDITOR_PATH.'/editor/lang/'.$aLangPrefix[0].'.js')) { return $aLangPrefix[0]; - } + } return 'en'; } - - - function FCKEditor($params) { + + + function FCKEditor($params) + { $params['no_special'] = 1; $value = $this->Field($params); - $name = isset($params['name']) ? $params['name'] : $this->InputName($params); + $name = array_key_exists('name', $params) ? $params['name'] : $this->InputName($params); - $theme_path = substr($this->Application->GetFrontThemePath(), 1).'/inc/'; - if (!file_exists(FULL_PATH.'/'.$theme_path.'style.css')) { + $theme_path = substr($this->Application->GetFrontThemePath(), 1) . '/inc/'; + if (!file_exists(FULL_PATH . '/' . $theme_path . 'style.css')) { $theme_path = EDITOR_PATH; } - $styles_xml = $this->Application->BaseURL().$theme_path.'styles.xml'; - $styles_css = $this->Application->BaseURL().$theme_path.'style.css'; - $bgcolor = isset($params['bgcolor']) ? $params['bgcolor'] : $this->Application->GetVar('bgcolor'); - if (!$bgcolor) $bgcolor = '#ffffff'; + $styles_xml = $this->Application->BaseURL() . $theme_path . 'styles.xml'; + $styles_css = $this->Application->BaseURL() . $theme_path . 'style.css'; + + $bgcolor = array_key_exists('bgcolor', $params) ? $params['bgcolor'] : $this->Application->GetVar('bgcolor'); + if (!$bgcolor) { + $bgcolor = '#ffffff'; + } + + $url = ''; $st_id = $this->Application->GetVar('st_id'); if ($st_id) { - $tpl = $this->Conn->GetRow('SELECT NamedParentPath, CategoryId FROM '.TABLE_PREFIX.'Category WHERE CategoryId = '.$st_id); - $url = $this->Application->HREF($tpl['NamedParentPath'], '_FRONT_END_', array('pass'=>'m', 'm_cat_id' => $st_id, 'index_file' => 'index.php')); + $sql = 'SELECT NamedParentPath + FROM ' . $this->Application->getUnitOption('st', 'TableName') . ' + WHERE ' . $this->Application->getUnitOption('st', 'IDField') . ' = ' . $st_id; + $tpl = $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); } - include_once(FULL_PATH.EDITOR_PATH.'fckeditor.php'); + + include_once(FULL_PATH . EDITOR_PATH . 'fckeditor.php'); + $oFCKeditor = new FCKeditor($name); $oFCKeditor->FullUrl = $this->Application->BaseURL(); - $oFCKeditor->BaseUrl = BASE_PATH.'/'; - $oFCKeditor->BasePath = BASE_PATH.EDITOR_PATH; + $oFCKeditor->BaseUrl = BASE_PATH . '/'; + $oFCKeditor->BasePath = BASE_PATH . EDITOR_PATH; $oFCKeditor->Width = $params['width'] ; $oFCKeditor->Height = $params['height'] ; - $oFCKeditor->ToolbarSet = $st_id ? 'Advanced' : 'Default' ; + $oFCKeditor->ToolbarSet = $st_id ? 'Advanced' : 'Default'; $oFCKeditor->Value = $value; $oFCKeditor->PreviewUrl = $url; $oFCKeditor->DefaultLanguage = $this->SetFCKDefaultLanguage(); - $oFCKeditor->LateLoad = isset($params['late_load']) && $params['late_load']; - $oFCKeditor->Config = Array( + $oFCKeditor->LateLoad = array_key_exists('late_load', $params) && $params['late_load']; + $oFCKeditor->Config = Array ( //'UserFilesPath' => $pathtoroot.'kernel/user_files', - 'ProjectPath' => BASE_PATH.'/', - 'CustomConfigurationsPath' => $this->Application->BaseURL().'core/admin_templates/js/inp_fckconfig.js', + 'ProjectPath' => BASE_PATH . '/', + 'CustomConfigurationsPath' => $this->Application->BaseURL() . 'core/admin_templates/js/inp_fckconfig.js', 'StylesXmlPath' => $styles_xml, 'EditorAreaCSS' => $styles_css, 'DefaultStyleLabel' => $this->Application->Phrase('la_editor_default_style'), @@ -2092,9 +2105,10 @@ 'K4' => 1, 'newBgColor' => $bgcolor, 'PreviewUrl' => $url, - 'BaseUrl' => BASE_PATH.'/', + 'BaseUrl' => BASE_PATH . '/', 'DefaultLanguage' => $this->SetFCKDefaultLanguage(), ); + return $oFCKeditor->CreateHtml(); }