[BUGFIX] Add back button from info page to element browser wizard 48/36848/4
authorStanislas Rolland <typo3@sjbr.ca>
Wed, 11 Feb 2015 19:15:52 +0000 (14:15 -0500)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Sat, 28 Feb 2015 19:09:16 +0000 (20:09 +0100)
When using the element browser for image insertion in backend form
or in RTE, there should be some Back button on the Info page to go back
to the wizard form.
Currently, one has to close the window and start over.

Releases: master
Resolves: #55787
Change-Id: I909767feaacf260736707b3b28cb34efe2bf82e6
Reviewed-on: http://review.typo3.org/36848
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php

index 117412c..2be0e14 100644 (file)
@@ -212,6 +212,7 @@ class ElementInformationController {
                        $this->content .= $this->renderPreview();
                        $this->content .= $this->renderPropertiesAsTable();
                        $this->content .= $this->renderReferences();
+                       $this->content .= $this->renderBackButton();
                }
        }
 
@@ -436,6 +437,24 @@ class ElementInformationController {
        }
 
        /**
+        * Render a back button, if a returnUrl was provided
+        *
+        * @return string
+        */
+       protected function renderBackButton() {
+               $backLink = '';
+               $returnUrl = GeneralUtility::_GET('returnUrl');
+               if ($returnUrl) {
+                       $backLink .= '
+                               <a class="btn btn-primary" href="' . htmlspecialchars($returnUrl) . '>
+                                       ' . IconUtility::getSpriteIcon('actions-view-go-back') . '
+                                       ' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xlf:back', TRUE) . '
+                               </a>';
+               }
+               return $backLink;
+       }
+
+       /**
         * Renders file properties as html table
         *
         * @param array $fieldList