Merged from branches/2.3

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@77033 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2009-05-18 00:23:52 +00:00
parent c69994f98f
commit f27122e102
3 changed files with 8 additions and 15 deletions

View File

@ -110,15 +110,9 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
$spellcheckSpec = array(); $spellcheckSpec = array();
foreach($spellcheckLangs as $lang => $title) $spellcheckSpec[] = "{$title}={$lang}"; foreach($spellcheckLangs as $lang => $title) $spellcheckSpec[] = "{$title}={$lang}";
// Set custom options for TinyMCE specific to CMSMain
HtmlEditorConfig::get('cms')->setOption('spellchecker_languages', '+' . implode(',', $spellcheckSpec)); HtmlEditorConfig::get('cms')->setOption('spellchecker_languages', '+' . implode(',', $spellcheckSpec));
// @todo Do we need this - I'm pretty sure not, since HtmlEditorField#Field() will include it on being called.
// The only time you might need it is if you are creating an textarea.htmlfield yourself, in which case bad things are going to happen now we've moved configuration
// We don't want this showing up in every ajax-response, it should always be present in a CMS-environment
if(!Director::is_ajax()) {
Requirements::javascript(MCE_ROOT . "tiny_mce_src.js");
}
Requirements::javascript(CMS_DIR . '/javascript/CMSMain.js'); Requirements::javascript(CMS_DIR . '/javascript/CMSMain.js');
Requirements::javascript(CMS_DIR . '/javascript/CMSMain_left.js'); Requirements::javascript(CMS_DIR . '/javascript/CMSMain_left.js');
Requirements::javascript(CMS_DIR . '/javascript/CMSMain_right.js'); Requirements::javascript(CMS_DIR . '/javascript/CMSMain_right.js');

View File

@ -883,6 +883,9 @@ JS;
} }
public function EditForm() { public function EditForm() {
// Include JavaScript to ensure HtmlEditorField works.
HtmlEditorField::include_js();
$record = $this->currentPage(); $record = $this->currentPage();
if(!$record) return false; if(!$record) return false;

View File

@ -29,13 +29,9 @@ class ReportAdmin extends LeftAndMain {
Requirements::css(CMS_DIR . '/css/ReportAdmin.css'); Requirements::css(CMS_DIR . '/css/ReportAdmin.css');
// We don't want this showing up in every ajax-response, it should // Set custom options for TinyMCE specific to ReportAdmin
// always be present in a CMS environment
if(!Director::is_ajax()) {
Requirements::javascript(MCE_ROOT . "tiny_mce_src.js");
HtmlEditorConfig::get('cms')->setOption('ContentCSS', project() . '/css/editor.css'); HtmlEditorConfig::get('cms')->setOption('ContentCSS', project() . '/css/editor.css');
HtmlEditorConfig::get('cms')->setOption('Lang', i18n::get_tinymce_lang()); HtmlEditorConfig::get('cms')->setOption('Lang', i18n::get_tinymce_lang());
}
// Always block the HtmlEditorField.js otherwise it will be sent with an ajax request // Always block the HtmlEditorField.js otherwise it will be sent with an ajax request
Requirements::block(SAPPHIRE_DIR . '/javascript/HtmlEditorField.js'); Requirements::block(SAPPHIRE_DIR . '/javascript/HtmlEditorField.js');