[BUGFIX] RTE: Removing div from formatblock selector may not workspaces
authorStanislas Rolland <typo3@sjbr.ca>
Thu, 9 Feb 2012 05:11:28 +0000 (00:11 -0500)
committerStanislas Rolland <typo3@sjbr.ca>
Fri, 10 Feb 2012 01:58:38 +0000 (02:58 +0100)
Problem: RTE.default.buttons.formatblock.removeItems = div is not
honoured when indent/outdent is configured.
Solution: Honour the removal/restriction even when indent/outdent is
configured.

Fixes: #33457
Releases: 4.5, 4.6, 4.7

Change-Id: I2f2b43d8e5d74a6598667a3b79d6894acdff96f9
Reviewed-on: http://review.typo3.org/8921
Reviewed-by: Stanislas Rolland
Tested-by: Stanislas Rolland
typo3/sysext/rtehtmlarea/extensions/BlockElements/class.tx_rtehtmlarea_blockelements.php

index 121d1a6..74e0b87 100644 (file)
@@ -129,11 +129,6 @@ class tx_rtehtmlarea_blockelements extends tx_rtehtmlarea_api {
                        }
                                // Adding custom items
                        $blockElementsOrder = array_merge(t3lib_div::trimExplode(',', $this->htmlAreaRTE->cleanList($blockElementsOrder), 1), $addItems);
-                               // Applying User TSConfig restriction
-                       $blockElementsOrder = array_diff($blockElementsOrder, $hideItems);
-                       if (!in_array('*', $restrictTo)) {
-                               $blockElementsOrder = array_intersect($blockElementsOrder, $restrictTo);
-                       }
                                // Add div element if indent is configured in the toolbar
                        if (in_array('indent', $this->toolbar) || in_array('outdent', $this->toolbar)) {
                                $blockElementsOrder = array_merge($blockElementsOrder, array('div'));
@@ -142,6 +137,12 @@ class tx_rtehtmlarea_blockelements extends tx_rtehtmlarea_api {
                        if (in_array('blockquote', $this->toolbar)) {
                                $blockElementsOrder = array_merge($blockElementsOrder, array('blockquote'));
                        }
+                               // Remove items
+                       $blockElementsOrder = array_diff($blockElementsOrder, $hideItems);
+                               // Applying User TSConfig restriction
+                       if (!in_array('*', $restrictTo)) {
+                               $blockElementsOrder = array_intersect($blockElementsOrder, $restrictTo);
+                       }
                                // Localizing the options
                        $blockElementsOptions = array();
                        if ($this->htmlAreaRTE->cleanList($this->thisConfig['hidePStyleItems']) != '*') {