Skip to content
Snippets Groups Projects
Commit 2115050c authored by Stanislas Rolland's avatar Stanislas Rolland
Browse files

[BUGFIX] RTE: Removing div from block format select box may not work

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.

Change-Id: I13eb3e6e6683b7dc9a1ae47caf9b9bb401f659bf
Fixes: #33457
Releases: 4.5, 4.6, 4.7
Reviewed-on: http://review.typo3.org/8953
Reviewed-by: Stanislas Rolland
Tested-by: Stanislas Rolland
parent 41e3ba1c
Branches
Tags
No related merge requests found
......@@ -139,11 +139,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'));
......@@ -151,6 +146,12 @@ class tx_rtehtmlarea_blockelements extends tx_rtehtmlarea_api {
// Add blockquote element if blockquote is configured in the toolbar
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();
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment