diff --git a/typo3/sysext/filelist/Classes/FileList.php b/typo3/sysext/filelist/Classes/FileList.php index d68835a29f0ed5bbb7d76f8c6191fc534028a196..cb7eb9bdde5fcee31d2b85b3fc3702e7c4dae289 100644 --- a/typo3/sysext/filelist/Classes/FileList.php +++ b/typo3/sysext/filelist/Classes/FileList.php @@ -933,6 +933,24 @@ class FileList extends AbstractRecordList } else { $cells['edit'] = $this->spaceIcon; } + + // Edit metadata of file + if ($fileOrFolderObject instanceof File && $fileOrFolderObject->checkActionPermission('write') && $this->getBackendUser()->check('tables_modify', 'sys_file_metadata')) { + $metaData = $fileOrFolderObject->_getMetaData(); + $urlParameters = [ + 'edit' => [ + 'sys_file_metadata' => [ + $metaData['uid'] => 'edit' + ] + ], + 'returnUrl' => $this->listURL() + ]; + $url = BackendUtility::getModuleUrl('record_edit', $urlParameters); + $title = htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:cm.editMetadata')); + $cells['metadata'] = '<a class="btn btn-default" href="' . htmlspecialchars($url) . '" title="' . $title . '">' . $this->iconFactory->getIcon('actions-open', Icon::SIZE_SMALL)->render() . '</a>'; + } + + // document view if ($fileOrFolderObject instanceof File) { $fileUrl = $fileOrFolderObject->getPublicUrl(true); if ($fileUrl) {