BUGFIX #5255 LeftAndMain should include the correct editor.css file so typography from user selected theme in SiteConfig is shown in TinyMCE

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@102038 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2010-04-01 02:53:05 +00:00 committed by Sam Minnee
parent 1d259855c3
commit 963fd45c91

View File

@ -162,7 +162,17 @@ class LeftAndMain extends Controller {
$htmlEditorConfig = HtmlEditorConfig::get_active();
if(!$htmlEditorConfig->getOption('content_css')) {
$cssFiles = 'cms/css/editor.css';
if(SSViewer::current_theme()) $cssFiles .= ', ' . THEMES_DIR . "/" . SSViewer::current_theme() . '/css/editor.css';
// Use theme from the site config
if(($config = SiteConfig::current_site_config()) && $config->Theme) {
$theme = $config->Theme;
} elseif(SSViewer::current_theme()) {
$theme = SSViewer::current_theme();
} else {
$theme = false;
}
if($theme) $cssFiles .= ', ' . THEMES_DIR . "/{$theme}/css/editor.css";
else if(project()) $cssFiles .= ', ' . project() . '/css/editor.css';
$htmlEditorConfig->setOption('content_css', $cssFiles);
@ -222,7 +232,7 @@ class LeftAndMain extends Controller {
// navigator
Requirements::css(SAPPHIRE_DIR . '/css/SilverStripeNavigator.css');
Requirements::javascript(SAPPHIRE_DIR . '/javascript/SilverStripeNavigator.js');
Requirements::themedCSS('typography');
foreach (self::$extra_requirements['javascript'] as $file) {