Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

BUGFIX #5255 LeftAndMain should include the correct editor.css file s…

…o 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
  • Loading branch information...
commit 963fd45c913f88ac58149c5f4445425ea684c9ed 1 parent 1d25985
@halkyon halkyon authored sminnee committed
Showing with 12 additions and 2 deletions.
  1. +12 −2 code/LeftAndMain.php
View
14 code/LeftAndMain.php
@@ -162,7 +162,17 @@ function init() {
$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 @@ function init() {
// 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) {
Please sign in to comment.
Something went wrong with that request. Please try again.