From 13104c3e7bd0d38c9d68db8acb21115f94221221 Mon Sep 17 00:00:00 2001 From: Frans Saris <franssaris@gmail.com> Date: Wed, 4 Jun 2014 16:45:26 +0200 Subject: [PATCH] [BUGFIX] Show storage and folder of file/folder To make it possible for an editor to find the real location of a used file, the storage and folder are added to the ElementInformation view of a file and folder. Resolves: #57798 Releases: 6.2 Change-Id: I7c8104809bad49a6df1ec625cf3463a96526ede2 Reviewed-on: https://review.typo3.org/30558 Reviewed-by: Einar Gislason Tested-by: Einar Gislason Reviewed-by: Markus Klein Tested-by: Markus Klein --- .../ContentElement/ElementInformationController.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php b/typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php index 09507c0cdabb..86ae64884fed 100644 --- a/typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php +++ b/typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php @@ -316,6 +316,11 @@ class ElementInformationController { ); } + if (in_array($this->type, array('folder', 'file'), TRUE)) { + $extraFields['storage'] = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_tca.xlf:sys_file.storage', TRUE); + $extraFields['folder'] = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xlf:folder', TRUE); + } + foreach ($extraFields as $name => $value) { $rowValue = BackendUtility::getProcessedValueExtra($this->table, $name, $this->row[$name]); if ($name === 'cruser_id' && $rowValue) { @@ -326,6 +331,13 @@ class ElementInformationController { $rowValue .= ' - ' . $userTemp[0]['realName']; } } + } elseif ($rowValue === NULL) { + $resourceObject = $this->fileObject ?: $this->folderObject; + if ($name === 'storage') { + $rowValue = $resourceObject->getStorage()->getName(); + } elseif ($name === 'folder') { + $rowValue = $resourceObject->getParentFolder()->getIdentifier(); + } } $tableRows[] = ' <tr> -- GitLab