[TASK] Display edit metadata icon in filelist 79/52079/3
authorGianluigi Martino <gmartino27@gmail.com>
Fri, 17 Mar 2017 12:15:44 +0000 (13:15 +0100)
committerBenjamin Kott <benjamin.kott@outlook.com>
Thu, 30 Mar 2017 20:44:22 +0000 (22:44 +0200)
Editing metadata of a file is only possible by clicking the filename in
filelist. For editor is easier to find this function by clicking the edit
metadata icon in filelist control panel

Releases: master
Resolves: #80103
Change-Id: I0a7a1b96896c6bf6f3cb26cdcee3c819fc29d0d3
Reviewed-on: https://review.typo3.org/52079
Tested-by: TYPO3com <no-reply@typo3.com>
Tested-by: Riccardo De Contardi <erredeco@gmail.com>
Reviewed-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
Tested-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Benjamin Kott <benjamin.kott@outlook.com>
Tested-by: Benjamin Kott <benjamin.kott@outlook.com>
typo3/sysext/filelist/Classes/FileList.php

index d68835a..cb7eb9b 100644 (file)
@@ -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) {