From 47ed60c6572a2c5acf16e6db524757c843e27a66 Mon Sep 17 00:00:00 2001 From: Jared Dreyer Date: Fri, 12 Aug 2022 17:12:39 +1200 Subject: [PATCH] Removed custom tinymce helper Was not required because SilverStripe can allow the developer to set their own `TinyMCEConfig::class` with any endpoint they see fit e.g. DataExtensions . This helps negate overriding configs on existing projects and means we do not need to force custom tinymce configs. --- .../ContentReviewDefaultSettings.php | 37 +------------------ 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/src/Extensions/ContentReviewDefaultSettings.php b/src/Extensions/ContentReviewDefaultSettings.php index 19c4b63..327f90d 100644 --- a/src/Extensions/ContentReviewDefaultSettings.php +++ b/src/Extensions/ContentReviewDefaultSettings.php @@ -165,7 +165,7 @@ class ContentReviewDefaultSettings extends DataExtension TextField::create('ReviewFrom', _t(__CLASS__ . '.EMAILFROM', 'From email address')) ->setDescription(_t(__CLASS__ . '.EMAILFROM_RIGHTTITLE', 'e.g: do-not-reply@site.com')), TextField::create('ReviewSubject', _t(__CLASS__ . '.EMAILSUBJECT', 'Subject line')), - $wysiwygConfig = HTMLEditorField::create( + HTMLEditorField::create( 'ReviewBody', _t(__CLASS__ . '.EMAILTEMPLATE', 'Email template') ), @@ -175,41 +175,6 @@ class ContentReviewDefaultSettings extends DataExtension ), ] ); - $wysiwygConfig->setEditorConfig($this->getTinyMCEConfig($wysiwygConfig->getEditorConfig())); - } - - /** - * Get the TinyMCEConfig that should be used for the email template preview - * - * @return TinyMCEConfig - */ - private function getTinyMCEConfig( - TinyMCEConfig $config - ): TinyMCEConfig { - $editorButtonsGroupSeparator = '|'; - $allowedEditorButtons = [ - 'undo', - 'redo', - $editorButtonsGroupSeparator, - 'bold', - 'italic', - 'underline', - $editorButtonsGroupSeparator, - 'bullist', - 'numlist', - $editorButtonsGroupSeparator, - 'sslink', - $editorButtonsGroupSeparator, - 'formatselect', - $editorButtonsGroupSeparator, - 'code', - ]; - - $config->setButtonsForLine(1, $allowedEditorButtons); - $config->setButtonsForLine(2, []); - $config->setButtonsForLine(3, []); - - return $config; } /**