[BUGFIX] file_upload missing back icon 35/20935/2
authorPhilipp Gampe <philipp.gampe@typo3.org>
Fri, 17 May 2013 04:28:54 +0000 (06:28 +0200)
committerSteffen Müller <typo3@t3node.com>
Wed, 22 May 2013 16:32:43 +0000 (18:32 +0200)
Add a back button to:
 * file_upload
 * file_rename
 * file_newfolder

The code is taken from recordlist.

Resolves: #48065
Releases: 6.2, 6.1, 6.0
Change-Id: If328dd20f09875ab486fa3419ec5de9df8955956
Reviewed-on: https://review.typo3.org/20935
Reviewed-by: Steffen Müller
Tested-by: Steffen Müller
typo3/sysext/backend/Classes/Controller/File/CreateFolderController.php
typo3/sysext/backend/Classes/Controller/File/FileUploadController.php
typo3/sysext/backend/Classes/Controller/File/RenameFileController.php
typo3/templates/file_newfolder.html
typo3/templates/file_rename.html
typo3/templates/file_upload.html

index 066868d..29af6f7 100644 (file)
@@ -192,7 +192,13 @@ class CreateFolderController {
                $pageContent .= $this->doc->section($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:file_newfolder.php.newfile'), $code);
                $pageContent .= $this->doc->sectionEnd();
                $pageContent .= '</form>';
-               $docHeaderButtons = array();
+               $docHeaderButtons = array(
+                       'back' => ''
+               );
+               // Back
+               if ($this->returnUrl) {
+                       $docHeaderButtons['back'] = '<a href="' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisUrl($this->returnUrl)) . '" class="typo3-goBack" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.goBack', TRUE) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-view-go-back') . '</a>';
+               }
                // Add the HTML as a section:
                $markerArray = array(
                        'CSH' => $docHeaderButtons['csh'],
index ab876f8..9ac1a55 100644 (file)
@@ -96,7 +96,8 @@ class FileUploadController {
                $pageContent = $this->doc->header($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:file_upload.php.pagetitle')) . $this->doc->section('', $form);
                // Header Buttons
                $docHeaderButtons = array(
-                       'csh' => \TYPO3\CMS\Backend\Utility\BackendUtility::cshItem('xMOD_csh_corebe', 'file_upload', $GLOBALS['BACK_PATH'])
+                       'csh' => \TYPO3\CMS\Backend\Utility\BackendUtility::cshItem('xMOD_csh_corebe', 'file_upload', $GLOBALS['BACK_PATH']),
+                       'back' => ''
                );
                $markerArray = array(
                        'CSH' => $docHeaderButtons['csh'],
@@ -104,6 +105,10 @@ class FileUploadController {
                        'CONTENT' => $pageContent,
                        'PATH' => $this->title
                );
+               // Back
+               if ($this->returnUrl) {
+                       $docHeaderButtons['back'] = '<a href="' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisUrl($this->returnUrl)) . '" class="typo3-goBack" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.goBack', TRUE) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-view-go-back') . '</a>';
+               }
                $this->content .= $this->doc->moduleBody(array(), $docHeaderButtons, $markerArray);
                $this->content .= $this->doc->endPage();
                $this->content = $this->doc->insertStylesAndJS($this->content);
index ae52014..eec5b12 100644 (file)
@@ -132,8 +132,16 @@ class RenameFileController {
                $code .= '</form>';
                // Add the HTML as a section:
                $pageContent .= $code;
-               $docHeaderButtons = array();
+
+               $docHeaderButtons = array(
+                       'back' => ''
+               );
                $docHeaderButtons['csh'] = \TYPO3\CMS\Backend\Utility\BackendUtility::cshItem('xMOD_csh_corebe', 'file_rename', $GLOBALS['BACK_PATH']);
+               // Back
+               if ($this->returnUrl) {
+                       $docHeaderButtons['back'] = '<a href="' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisUrl($this->returnUrl)) . '" class="typo3-goBack" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.goBack', TRUE) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-view-go-back') . '</a>';
+               }
+
                // Add the HTML as a section:
                $markerArray = array(
                        'CSH' => $docHeaderButtons['csh'],
index 7ccda1c..4259a74 100644 (file)
@@ -26,7 +26,7 @@
 <!-- ###BUTTON_GROUP_WRAP### -->
 
 <!-- ###BUTTON_GROUPS_LEFT### -->
-<!-- ###BUTTON_GROUP4### --><!-- ###BUTTON_GROUP4### -->
+<!-- ###BUTTON_GROUP4### -->###BACK###<!-- ###BUTTON_GROUP4### -->
 <!-- ###BUTTON_GROUPS_LEFT### -->
 
 <!-- ###BUTTON_GROUPS_RIGHT### -->
index a425399..1a2d42c 100644 (file)
@@ -26,7 +26,7 @@
 <!-- ###BUTTON_GROUP_WRAP### -->
 
 <!-- ###BUTTON_GROUPS_LEFT### -->
-<!-- ###BUTTON_GROUP4### --><!-- ###BUTTON_GROUP4### -->
+<!-- ###BUTTON_GROUP4### -->###BACK###<!-- ###BUTTON_GROUP4### -->
 <!-- ###BUTTON_GROUPS_LEFT### -->
 
 <!-- ###BUTTON_GROUPS_RIGHT### -->
index a425399..1a2d42c 100644 (file)
@@ -26,7 +26,7 @@
 <!-- ###BUTTON_GROUP_WRAP### -->
 
 <!-- ###BUTTON_GROUPS_LEFT### -->
-<!-- ###BUTTON_GROUP4### --><!-- ###BUTTON_GROUP4### -->
+<!-- ###BUTTON_GROUP4### -->###BACK###<!-- ###BUTTON_GROUP4### -->
 <!-- ###BUTTON_GROUPS_LEFT### -->
 
 <!-- ###BUTTON_GROUPS_RIGHT### -->