[BUGFIX] Remove driver id from file move message 44/38144/9
authorMichael Oehlhof <typo3@oehlhof.de>
Wed, 25 Mar 2015 06:14:09 +0000 (07:14 +0100)
committerFrans Saris <franssaris@gmail.com>
Wed, 6 May 2015 19:57:25 +0000 (21:57 +0200)
The file move message showed identifiers instead of file and folder names.

Resolves: #64840
Releases: master
Change-Id: I6733f1d066a2577ed23b4c3843c7d4a09649d594
Reviewed-on: http://review.typo3.org/38144
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Christian Weiske <typo3@cweiske.de>
Tested-by: Christian Weiske <typo3@cweiske.de>
Reviewed-by: Cedric Ziel <cedric@cedric-ziel.com>
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Tested-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Tested-by: Frans Saris <franssaris@gmail.com>
typo3/sysext/backend/Classes/ClickMenu/ClickMenu.php
typo3/sysext/filelist/Classes/FileList.php

index bbca171..db7af65 100644 (file)
@@ -942,13 +942,14 @@ class ClickMenu {
                        if (!in_array('paste', $this->disabledItems) && $elFromAllTables && $folder && $fileObject->checkActionPermission('write')) {
                                $elArr = $this->clipObj->elFromTable('_FILE');
                                $selItem = reset($elArr);
+                               $clickedFileOrFolder = ResourceFactory::getInstance()->retrieveFileOrFolderObject($combinedIdentifier);
+                               $fileOrFolderInClipBoard = ResourceFactory::getInstance()->retrieveFileOrFolderObject($selItem);
+                               $fileInfo = $fileOrFolderInClipBoard->getStorage()->getFileInfoByIdentifier(substr(strstr($selItem, ':'), 1));
                                $elInfo = array(
-                                       basename($selItem),
-                                       basename($identifier),
+                                       $fileInfo['name'],
+                                       $clickedFileOrFolder->getName(),
                                        $this->clipObj->currentMode()
                                );
-                               $clickedFileOrFolder = ResourceFactory::getInstance()->retrieveFileOrFolderObject($combinedIdentifier);
-                               $fileOrFolderInClipBoard = ResourceFactory::getInstance()->retrieveFileOrFolderObject($selItem);
                                if (!$fileOrFolderInClipBoard instanceof Folder || !$fileOrFolderInClipBoard->getStorage()->isWithinFolder($fileOrFolderInClipBoard, $clickedFileOrFolder)) {
                                        $menuItems['pasteinto'] = $this->FILE_paste($identifier, $selItem, $elInfo);
                                }
index 93fe55f..8106d47 100644 (file)
@@ -256,14 +256,17 @@ class FileList extends AbstractRecordList {
                                $elFromTable = $this->clipObj->elFromTable('_FILE');
                                if (count($elFromTable)) {
                                        $addPasteButton = TRUE;
-                                       foreach ($elFromTable as $element) {
+                                       $elToConfirm = array();
+                                       foreach ($elFromTable as $key => $element) {
                                                $clipBoardElement = $this->resourceFactory->retrieveFileOrFolderObject($element);
                                                if ($clipBoardElement instanceof Folder && $clipBoardElement->getStorage()->isWithinFolder($clipBoardElement, $folderObject)) {
                                                        $addPasteButton = FALSE;
                                                }
+                                               $fileInfo = $clipBoardElement->getStorage()->getFileInfoByIdentifier(substr(strstr($element, ':'), 1));
+                                               $elToConfirm[$key] = $fileInfo['name'];
                                        }
                                        if ($addPasteButton) {
-                                               $buttons['PASTE'] = '<a href="' . htmlspecialchars($this->clipObj->pasteUrl('_FILE', $folderObject->getCombinedIdentifier())) . '" onclick="return ' . htmlspecialchars($this->clipObj->confirmMsg('_FILE', $this->path, 'into', $elFromTable)) . '" title="' . $this->getLanguageService()->getLL('clip_paste', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-paste-after') . '</a>';
+                                               $buttons['PASTE'] = '<a href="' . htmlspecialchars($this->clipObj->pasteUrl('_FILE', $folderObject->getCombinedIdentifier())) . '" onclick="return ' . htmlspecialchars($this->clipObj->confirmMsg('_FILE', $this->path, 'into', $elToConfirm)) . '" title="' . $this->getLanguageService()->getLL('clip_paste', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-paste-after') . '</a>';
                                        }
                                }
                        }
@@ -388,14 +391,17 @@ class FileList extends AbstractRecordList {
                                        $elFromTable = $this->clipObj->elFromTable($table);
                                        if (count($elFromTable) && $this->folderObject->checkActionPermission('write')) {
                                                $addPasteButton = TRUE;
-                                               foreach ($elFromTable as $element) {
+                                               $elToConfirm = array();
+                                               foreach ($elFromTable as $key => $element) {
                                                        $clipBoardElement = $this->resourceFactory->retrieveFileOrFolderObject($element);
                                                        if ($clipBoardElement instanceof Folder && $clipBoardElement->getStorage()->isWithinFolder($clipBoardElement, $this->folderObject)) {
                                                                $addPasteButton = FALSE;
                                                        }
+                                                       $fileInfo = $clipBoardElement->getStorage()->getFileInfoByIdentifier(substr(strstr($element, ':'), 1));
+                                                       $elToConfirm[$key] = $fileInfo['name'];
                                                }
                                                if ($addPasteButton) {
-                                                       $cells[] = '<a class="btn btn-default" href="' . htmlspecialchars($this->clipObj->pasteUrl('_FILE', $this->folderObject->getCombinedIdentifier())) . '" onclick="return ' . htmlspecialchars($this->clipObj->confirmMsg('_FILE', $this->path, 'into', $elFromTable)) . '" title="' . $this->getLanguageService()->getLL('clip_paste', 1) . '">' . IconUtility::getSpriteIcon('actions-document-paste-after') . '</a>';
+                                                       $cells[] = '<a class="btn btn-default" href="' . htmlspecialchars($this->clipObj->pasteUrl('_FILE', $this->folderObject->getCombinedIdentifier())) . '" onclick="return ' . htmlspecialchars($this->clipObj->confirmMsg('_FILE', $this->path, 'into', $elToConfirm)) . '" title="' . $this->getLanguageService()->getLL('clip_paste', 1) . '">' . IconUtility::getSpriteIcon('actions-document-paste-after') . '</a>';
                                                }
                                        }
                                        if ($this->clipObj->current !== 'normal' && $iOut) {
@@ -802,6 +808,7 @@ class FileList extends AbstractRecordList {
                }
                $cells = array();
                $fullIdentifier = $fileOrFolderObject->getCombinedIdentifier();
+               $fullName = $fileOrFolderObject->getName();
                $md5 = GeneralUtility::shortmd5($fullIdentifier);
                // For normal clipboard, add copy/cut buttons:
                if ($this->clipObj->current == 'normal') {
@@ -824,14 +831,17 @@ class FileList extends AbstractRecordList {
                $elFromTable = $this->clipObj->elFromTable('_FILE');
                if ($fileOrFolderObject instanceof Folder && count($elFromTable) && $fileOrFolderObject->checkActionPermission('write')) {
                        $addPasteButton = TRUE;
-                       foreach ($elFromTable as $element) {
+                       $elToConfirm = array();
+                       foreach ($elFromTable as $key => $element) {
                                $clipBoardElement = $this->resourceFactory->retrieveFileOrFolderObject($element);
                                if ($clipBoardElement instanceof Folder && $clipBoardElement->getStorage()->isWithinFolder($clipBoardElement, $fileOrFolderObject)) {
                                        $addPasteButton = FALSE;
                                }
+                               $fileInfo = $clipBoardElement->getStorage()->getFileInfoByIdentifier(substr(strstr($element, ':'), 1));
+                               $elToConfirm[$key] = $fileInfo['name'];
                        }
                        if ($addPasteButton) {
-                               $cells[] = '<a class="btn btn-default" href="' . htmlspecialchars($this->clipObj->pasteUrl('_FILE', $fullIdentifier)) . '" onclick="return ' . htmlspecialchars($this->clipObj->confirmMsg('_FILE', $fullIdentifier, 'into', $elFromTable)) . '" title="' . $this->getLanguageService()->getLL('clip_pasteInto', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-paste-into') . '</a>';
+                               $cells[] = '<a class="btn btn-default" href="' . htmlspecialchars($this->clipObj->pasteUrl('_FILE', $fullIdentifier)) . '" onclick="return ' . htmlspecialchars($this->clipObj->confirmMsg('_FILE', $fullName, 'into', $elToConfirm)) . '" title="' . $this->getLanguageService()->getLL('clip_pasteInto', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-paste-into') . '</a>';
                        }
                }
                // Compile items into a DIV-element: