Skip to content

Commit 478dfba

Browse files
authored
Merge pull request #32 from ivanhrytsaim/12062-TinyMCE-support-upgrade
12062-TinyMCE-support-upgrade
2 parents 1cd88c6 + 8661436 commit 478dfba

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Plugin/Magento/Ui/Component/Wysiwyg/ConfigPlugin.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ public function afterGetConfig(
9494
// Get current wysiwyg adapter's path
9595
$editor = $this->activeEditor->getWysiwygAdapterPath();
9696

97-
// Is the current wysiwyg tinymce v4 or v5?
98-
if (strpos($editor, 'tinymce4Adapter') || strpos($editor, 'tinymce5Adapter')) {
97+
// Is the current wysiwyg tinymce v4 or v5 or v7?
98+
if (strpos($editor, 'tinymce4Adapter') || strpos($editor, 'tinymce5Adapter') || strpos($editor, 'tinymceAdapter')) {
9999

100100
if (($result->getDataByPath('settings/menubar')) || ($result->getDataByPath('settings/toolbar')) || ($result->getDataByPath('settings/plugins'))) {
101101
// do not override ui_element config (unsure if this is needed)
@@ -112,11 +112,16 @@ public function afterGetConfig(
112112
$settings['menubar'] = true;
113113
$settings['image_advtab'] = true;
114114

115-
$settings['plugins'] = 'advlist autolink code colorpicker directionality hr imagetools link media noneditable paste print table textcolor toc visualchars anchor charmap codesample contextmenu help image insertdatetime lists nonbreaking pagebreak preview searchreplace template textpattern visualblocks wordcount magentovariable magentowidget emoticons';
115+
if (strpos($editor, 'tinymceAdapter')) {
116+
$settings['plugins'] = 'advlist autolink code colorpicker directionality hr imagetools link media noneditable paste print table toc visualchars anchor charmap codesample contextmenu help image insertdatetime lists nonbreaking pagebreak preview searchreplace template textpattern visualblocks wordcount magentovariable magentowidget emoticons';
117+
$settings['toolbar1'] = 'magentovariable magentowidget | blocks | styles | fontfamily | fontsize | lineheight | forecolor backcolor | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent';
118+
} else {
119+
$settings['plugins'] = 'advlist autolink code colorpicker directionality hr imagetools link media noneditable paste print table textcolor toc visualchars anchor charmap codesample contextmenu help image insertdatetime lists nonbreaking pagebreak preview searchreplace template textpattern visualblocks wordcount magentovariable magentowidget emoticons';
120+
$settings['toolbar1'] = 'magentovariable magentowidget | formatselect | styleselect | fontselect | fontsizeselect | lineheight | forecolor backcolor | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent';
121+
$settings['force_p_newlines'] = false;
122+
}
116123

117-
$settings['toolbar1'] = 'magentovariable magentowidget | formatselect | styleselect | fontselect | fontsizeselect | lineheight | forecolor backcolor | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent';
118124
$settings['toolbar2'] = ' undo redo | link anchor table charmap | image media insertdatetime | widget | searchreplace visualblocks help | hr pagebreak | emoticons';
119-
$settings['force_p_newlines'] = false;
120125

121126
$settings['valid_children'] = '+body[style]';
122127

0 commit comments

Comments
 (0)