[BUGFIX] RTE: Image modify dialogue: keep the current image tab 43/36843/3
authorStanislas Rolland <typo3@sjbr.ca>
Wed, 11 Feb 2015 16:58:43 +0000 (11:58 -0500)
committerStanislas Rolland <typo3@sjbr.ca>
Wed, 11 Feb 2015 17:02:30 +0000 (18:02 +0100)
When there is a current image, it should be possible to come back
to the current image tab after visiting the other tabs.

Follow-up to: https://review.typo3.org/#/c/36839/

Releases: master
Resolves: #65009
Change-Id: Ib8a8f7125b6f1c8c8759c31b6c625632b281e663
Reviewed-on: http://review.typo3.org/36843
Reviewed-by: Stanislas Rolland <typo3@sjbr.ca>
Tested-by: Stanislas Rolland <typo3@sjbr.ca>
typo3/sysext/rtehtmlarea/Classes/SelectImage.php

index 6749664..5f7bfb5 100644 (file)
@@ -877,6 +877,10 @@ class SelectImage extends \TYPO3\CMS\Recordlist\Browser\ElementBrowser {
                foreach ($this->hookObjects as $hookObject) {
                        $allowedItems = $hookObject->addAllowedItems($allowedItems);
                }
+               // Remove tab "image" if there is no current image
+               if ($this->act !== 'image' && !$this->addModifyTab) {
+                       $allowedItems = array_diff($allowedItems, array('image'));
+               }
                // Remove options according to RTE configuration
                if (is_array($this->buttonConfig['options.']) && $this->buttonConfig['options.']['removeItems']) {
                        $allowedItems = array_diff($allowedItems, GeneralUtility::trimExplode(',', $this->buttonConfig['options.']['removeItems'], TRUE));