[BUGFIX] Paste button missing in empty folders 36/20936/2
authorPhilipp Gampe <philipp.gampe@typo3.org>
Fri, 17 May 2013 03:29:42 +0000 (05:29 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Mon, 20 May 2013 17:51:08 +0000 (19:51 +0200)
Inside an empty folder is no obvious way to paste the content of the
clipboard.

Add a paste icon to the docheader to paste into the current folder.

Resolves: #48202
Releases: 6.2, 6.1, 6.0
Change-Id: I2192bd853a1c1fada332319812acee8fe821b78a
Reviewed-on: https://review.typo3.org/20936
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/filelist/Classes/FileList.php
typo3/templates/file_list.html

index 87920f1..4f74a2e 100644 (file)
@@ -214,7 +214,8 @@ class FileList extends \TYPO3\CMS\Backend\RecordList\AbstractRecordList {
                        'level_up' => '',
                        'refresh' => '',
                        'title' => '',
-                       'page_icon' => ''
+                       'page_icon' => '',
+                       'PASTE' => ''
                );
                // Makes the code for the foldericon in the top
                if ($folderObject) {
@@ -237,6 +238,11 @@ class FileList extends \TYPO3\CMS\Backend\RecordList\AbstractRecordList {
                        if ($this->clickMenus) {
                                $otherMarkers['PAGE_ICON'] = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($otherMarkers['PAGE_ICON'], $folderObject->getCombinedIdentifier());
                        }
+                       // Add paste button
+                       $elFromTable = $this->clipObj->elFromTable('_FILE');
+                       if (count($elFromTable)) {
+                               $buttons['PASTE'] = '<a href="' . htmlspecialchars($this->clipObj->pasteUrl('_FILE', $this->folderObject->getCombinedIdentifier())) . '" onclick="return ' . htmlspecialchars($this->clipObj->confirmMsg('_FILE', $this->path, 'into', $elFromTable)) . '" title="' . $GLOBALS['LANG']->getLL('clip_paste', TRUE) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-paste-after') . '</a>';
+                       }
                }
                $buttons['refresh'] = '<a href="' . htmlspecialchars($this->listURL()) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.reload', 1) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-system-refresh') . '</a>';
                return array($buttons, $otherMarkers);
index 962cc2c..5a19722 100644 (file)
@@ -26,7 +26,7 @@
 <!-- ###BUTTON_GROUP_WRAP### -->
 
 <!-- ###BUTTON_GROUPS_LEFT### -->
-<!-- ###BUTTON_GROUP4### -->###UPLOAD######NEW###<!-- ###BUTTON_GROUP4### -->
+<!-- ###BUTTON_GROUP4### -->###UPLOAD######NEW######PASTE###<!-- ###BUTTON_GROUP4### -->
 <!-- ###BUTTON_GROUPS_LEFT### -->
 
 <!-- ###BUTTON_GROUPS_RIGHT### -->