BUGFIX: Fix default inclusion of (theme|project)/css/editor.css into the WYSWIWYG editor.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@94350 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-12-03 03:53:40 +00:00
parent 2eea820daf
commit f17dd0c37e
2 changed files with 13 additions and 2 deletions

View File

@ -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'));

View File

@ -153,6 +153,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');