Index: trunk/admin/editor/editor_new.php =================================================================== diff -u -r1735 -r1759 --- trunk/admin/editor/editor_new.php (.../editor_new.php) (revision 1735) +++ trunk/admin/editor/editor_new.php (.../editor_new.php) (revision 1759) @@ -137,14 +137,42 @@ $oFCKeditor->ToolbarSet = 'Advanced' ; $oFCKeditor->Value = '' ; $oFCKeditor->Config = Array( - 'UserFilesPath' => $pathtoroot.'kernel/user_files', + //'UserFilesPath' => $pathtoroot.'kernel/user_files', 'ProjectPath' => $objConfig->Get("Site_Path"), 'CustomConfigurationsPath' => $rootURL.'admin/editor/inp_fckconfig.js', - 'EditorAreaCSS' => $rootURL.'themes/site/inc/style.css', - 'StylesXmlPath' => '../../inp_styles.xml', + 'EditorAreaCSS' => GetThemeCSS(), + //'StylesXmlPath' => '../../inp_styles.xml', //'Debug' => 1, ); + function GetThemeCSS() + { + $query = 'SELECT LastCompiled, '.GetTablePrefix().'Stylesheets.Name as StyleName FROM '.GetTablePrefix().'Theme + LEFT JOIN '.GetTablePrefix().'Stylesheets + ON '.GetTablePrefix().'Theme.StylesheetId = '.GetTablePrefix().'Stylesheets.StylesheetId + WHERE ThemeId = 4'; + + $conn =& GetADODBConnection(); + + $res = $conn->GetRow($query); + + $last_compiled = $res['LastCompiled']; + + $style_name = strtolower( $res['StyleName'] ); + + global $pathtoroot,$rootURL; + + $css_path = $pathtoroot.'kernel/stylesheets'; + + $css_url = $rootURL.'kernel/stylesheets'; + + if( file_exists($css_path.'/'.$style_name.'-'.$last_compiled.'.css') ) + { + $ret = $css_url.'/'.$style_name.'-'.$last_compiled.'.css'; + } + return $ret; + } + echo $oFCKeditor->CreateHtml() ; ?>