Skip to content

Commit

Permalink
fix htmleditorfield content_css not getting set
Browse files Browse the repository at this point in the history
  • Loading branch information
sheadawson committed Oct 26, 2015
1 parent 941f529 commit c54a9b7
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions code/extensions/MultisitesCmsMainExtension.php
Expand Up @@ -19,21 +19,19 @@ public function getCMSTreeTitle() {
public function init(){
// set the htmleditor "content_css" based on the active site
$htmlEditorConfig = HtmlEditorConfig::get_active();
if(!$htmlEditorConfig->getOption('content_css')){
$site = Multisites::inst()->getActiveSite();
$theme = $site->getSiteTheme();
if($theme){
$cssFile = THEMES_DIR . "/$theme/css/editor.css";
if(file_exists(BASE_PATH . '/' . $cssFile)){
$htmlEditorConfig->setOption('content_css', $cssFile);

if($this->owner->getRequest()->isAjax() && $this->owner->class == 'CMSPageEditController'){
// Add editor css path to header so javascript can update ssTinyMceConfig.content_css
$this->owner->getResponse()->addHeader('X-HTMLEditor_content_css', $cssFile);
}

}
}
$site = Multisites::inst()->getActiveSite();
$theme = $site->getSiteTheme();
if($theme){
$cssFile = THEMES_DIR . "/$theme/css/editor.css";
if(file_exists(BASE_PATH . '/' . $cssFile)){
$htmlEditorConfig->setOption('content_css', $cssFile);

if($this->owner->getRequest()->isAjax() && $this->owner->class == 'CMSPageEditController'){
// Add editor css path to header so javascript can update ssTinyMceConfig.content_css
$this->owner->getResponse()->addHeader('X-HTMLEditor_content_css', $cssFile);
}

}
}
}

Expand Down

0 comments on commit c54a9b7

Please sign in to comment.