diff --git a/typo3/sysext/filelist/Classes/FileList.php b/typo3/sysext/filelist/Classes/FileList.php index 7232e1535daed02b89c1917c331ef40eeb1a269b..d6a3fc3ee9aac0cae81eff92b76e6c0e91b0571f 100644 --- a/typo3/sysext/filelist/Classes/FileList.php +++ b/typo3/sysext/filelist/Classes/FileList.php @@ -922,6 +922,8 @@ class FileList extends AbstractRecordList { $cells = []; $fullIdentifier = $fileOrFolderObject->getCombinedIdentifier(); + $md5 = GeneralUtility::shortMD5($fullIdentifier); + $isSel = $this->clipObj->isSelected('_FILE', $md5); // Edit file content (if editable) if ($fileOrFolderObject instanceof File && $fileOrFolderObject->checkActionPermission('write') && GeneralUtility::inList($GLOBALS['TYPO3_CONF_VARS']['SYS']['textfile_ext'], $fileOrFolderObject->getExtension())) { @@ -990,6 +992,30 @@ class FileList extends AbstractRecordList $cells['info'] = $this->spaceIcon; } + // copy the file + if ($fileOrFolderObject->checkActionPermission('copy') && $this->clipObj->current === 'normal') { + $copyTitle = htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:cm.copy')); + $copyIcon = $this->iconFactory->getIcon('actions-edit-copy', Icon::SIZE_SMALL)->render(); + + if ($isSel === 'copy') { + $copyIcon = $this->iconFactory->getIcon('actions-edit-copy-release', Icon::SIZE_SMALL)->render(); + } + + $cells['copy'] = '<a class="btn btn-default"" href="' . htmlspecialchars($this->clipObj->selUrlFile($fullIdentifier, 1, ($isSel === 'copy'))) . '" title="' . $copyTitle . '">' . $copyIcon . '</a>'; + } + + // cut the file + if ($fileOrFolderObject->checkActionPermission('move') && $this->clipObj->current === 'normal') { + $cutTitle = htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:cm.cut')); + $cutIcon = $this->iconFactory->getIcon('actions-edit-cut', Icon::SIZE_SMALL)->render(); + + if ($isSel === 'cut') { + $cutIcon = $this->iconFactory->getIcon('actions-edit-cut-release', Icon::SIZE_SMALL)->render(); + } + + $cells['cut'] = '<a class="btn btn-default" href="' . htmlspecialchars($this->clipObj->selUrlFile($fullIdentifier, 0, ($isSel === 'cut'))) . '" title="' . $cutTitle . '">' . $cutIcon . '</a>'; + } + // delete the file if ($fileOrFolderObject->checkActionPermission('delete')) { $identifier = $fileOrFolderObject->getIdentifier();