[BUGFIX] Show storage and folder of file/folder 58/30558/4
authorFrans Saris <franssaris@gmail.com>
Wed, 4 Jun 2014 14:45:26 +0000 (16:45 +0200)
committerMarkus Klein <klein.t3@mfc-linz.at>
Wed, 4 Jun 2014 15:58:34 +0000 (17:58 +0200)
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
typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php

index 09507c0..86ae648 100644 (file)
@@ -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>