From e499b4bc9111211dd0c0e17051f1bd2cfeea2162 Mon Sep 17 00:00:00 2001 From: jyothigayathri Date: Fri, 14 Jun 2024 16:46:43 +0530 Subject: [PATCH 1/2] Added froala options --- src/Form/Type/FroalaEditorType.php | 2 +- src/Service/PluginProvider.php | 1 + src/Utility/UConfiguration.php | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Form/Type/FroalaEditorType.php b/src/Form/Type/FroalaEditorType.php index 67ce649..c1f574c 100644 --- a/src/Form/Type/FroalaEditorType.php +++ b/src/Form/Type/FroalaEditorType.php @@ -95,7 +95,7 @@ public function buildView(FormView $view, FormInterface $form, array $options): $arrPlugin = $this->pluginProvider->obtainArrPluginToInclude($arrPluginEnabled, $arrPluginDisabled); - $view->vars['froala_arrOption']['pluginsEnabled'] = $this->pluginProvider->obtainArrPluginCamelized($arrPlugin); + $view->vars['froala_arrOption']['pluginsEnabled'] = array_map(fn (string $plugin): string => 'trackChanges' === $plugin ? 'track_changes' : $plugin, $this->pluginProvider->obtainArrPluginCamelized($arrPlugin)); $view->vars['froala_arrPluginJS'] = $this->pluginProvider->obtainArrPluginJS($arrPlugin); $view->vars['froala_arrPluginCSS'] = $this->pluginProvider->obtainArrPluginCSS($arrPlugin); $view->vars['froala_events'] = $arrEvent; diff --git a/src/Service/PluginProvider.php b/src/Service/PluginProvider.php index 10b9bd2..39edb12 100644 --- a/src/Service/PluginProvider.php +++ b/src/Service/PluginProvider.php @@ -55,6 +55,7 @@ class PluginProvider 'save' => [self::KEY_CSS => 0, self::KEY_FOLDER => self::VALUE_PLUGINS], 'special_characters' => [self::KEY_CSS => 1, self::KEY_FOLDER => self::VALUE_PLUGINS], 'table' => [self::KEY_CSS => 1, self::KEY_FOLDER => self::VALUE_PLUGINS], + 'track_changes' => [self::KEY_CSS => 0, self::KEY_FOLDER => self::VALUE_PLUGINS], 'url' => [self::KEY_CSS => 0, self::KEY_FOLDER => self::VALUE_PLUGINS], 'video' => [self::KEY_CSS => 1, self::KEY_FOLDER => self::VALUE_PLUGINS], 'word_paste' => [self::KEY_CSS => 0, self::KEY_FOLDER => self::VALUE_PLUGINS], diff --git a/src/Utility/UConfiguration.php b/src/Utility/UConfiguration.php index 6c9f6c1..57af90c 100644 --- a/src/Utility/UConfiguration.php +++ b/src/Utility/UConfiguration.php @@ -42,6 +42,7 @@ abstract class UConfiguration 'imagePasteProcess' => null, 'initOnClick' => null, 'keepFormatOnDelete' => null, + 'keepTextFormatOnTable' => null, 'linkAlwaysBlank' => null, 'linkAlwaysNoFollow' => null, 'linkConvertEmailAddress' => null, @@ -56,9 +57,11 @@ abstract class UConfiguration 'paragraphMultipleStyles' => null, 'pasteAllowLocalImages' => null, 'pastePlain' => null, + 'preserveTabSpaces' => null, 'requestWithCredentials' => null, 'requestWithCORS' => null, 'shortcutsHint' => null, + 'showChangesEnabled' => null, 'spellcheck' => null, 'tableCellMultipleStyles' => null, 'tableMultipleStyles' => null, @@ -69,6 +72,7 @@ abstract class UConfiguration 'toolbarSticky' => null, 'toolbarVisibleWithoutSelection' => null, 'tooltips' => null, + 'trackChangesEnabled' => null, 'useClasses' => null, 'videoMove' => null, 'videoResize' => null, @@ -130,6 +134,8 @@ abstract class UConfiguration 'filesManagerUploadURL' => null, 'fontAwesomeTemplate' => null, 'fontSizeUnit' => null, + 'fontFamilyDefaultSelection' => null, + 'fontSizeDefaultSelection' => null, 'iconsTemplate' => null, 'iframeDefaultStyle' => null, 'iframeStyle' => null, From 0e1add3dbadd79d6712fe756b57dd6c153a002fd Mon Sep 17 00:00:00 2001 From: jyothigayathri Date: Mon, 17 Jun 2024 14:57:31 +0530 Subject: [PATCH 2/2] modified code for FroalaEditorType.php --- src/Form/Type/FroalaEditorType.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Form/Type/FroalaEditorType.php b/src/Form/Type/FroalaEditorType.php index c1f574c..0ed629c 100644 --- a/src/Form/Type/FroalaEditorType.php +++ b/src/Form/Type/FroalaEditorType.php @@ -95,7 +95,9 @@ public function buildView(FormView $view, FormInterface $form, array $options): $arrPlugin = $this->pluginProvider->obtainArrPluginToInclude($arrPluginEnabled, $arrPluginDisabled); - $view->vars['froala_arrOption']['pluginsEnabled'] = array_map(fn (string $plugin): string => 'trackChanges' === $plugin ? 'track_changes' : $plugin, $this->pluginProvider->obtainArrPluginCamelized($arrPlugin)); + $view->vars['froala_arrOption']['pluginsEnabled'] = array_map(function (string $plugin) { + return 'trackChanges' === $plugin ? 'track_changes' : $plugin; + }, $this->pluginProvider->obtainArrPluginCamelized($arrPlugin)); $view->vars['froala_arrPluginJS'] = $this->pluginProvider->obtainArrPluginJS($arrPlugin); $view->vars['froala_arrPluginCSS'] = $this->pluginProvider->obtainArrPluginCSS($arrPlugin); $view->vars['froala_events'] = $arrEvent;