diff --git a/_config.php b/_config.php index 962298c6..91ed9372 100644 --- a/_config.php +++ b/_config.php @@ -23,7 +23,6 @@ HtmlEditorConfig::get('cms')->setOptions(array( 'priority' => '50', 'mode' => 'none', 'language' => i18n::get_tinymce_lang(), - 'content_css' => 'cms/css/editor.css, '.(SSViewer::current_theme() ? THEMES_DIR . "/" . SSViewer::current_theme() : project()) . "/css/editor.css", 'body_class' => 'typography', 'document_base_url' => Director::absoluteBaseURL(), @@ -41,7 +40,6 @@ HtmlEditorConfig::get('cms')->setOptions(array( 'extended_valid_elements' => "img[class|src|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|usemap],iframe[src|name|width|height|align|frameborder|marginwidth|marginheight|scrolling],object[width|height|data|type],param[name|value],map[class|name|id],area[shape|coords|href|target|alt]" )); - HtmlEditorConfig::get('cms')->enablePlugins('media', 'fullscreen'); HtmlEditorConfig::get('cms')->enablePlugins(array('ssbuttons' => '../../../cms/javascript/tinymce_ssbuttons/editor_plugin_src.js')); diff --git a/code/LeftAndMain.php b/code/LeftAndMain.php index f3a20308..21ab51ea 100644 --- a/code/LeftAndMain.php +++ b/code/LeftAndMain.php @@ -160,6 +160,19 @@ class LeftAndMain extends Controller { // Set the members html editor config HtmlEditorConfig::set_active(Member::currentUser()->getHtmlEditorConfigForCMS()); + + + // Set default values in the config if missing. These things can't be defined in the config + // file because insufficient information exists when that is being processed + $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'; + else if(project()) $cssFiles .= ', ' . project() . '/css/editor.css'; + + $htmlEditorConfig->setOption('content_css', $cssFiles); + } + Requirements::css(CMS_DIR . '/css/typography.css'); Requirements::css(CMS_DIR . '/css/layout.css');