[TASK] Format size in filelist info window 19/46519/2
authorDaniel Maier <dani-maier@gmx.de>
Sun, 7 Feb 2016 19:15:14 +0000 (20:15 +0100)
committerAndreas Fernandez <typo3@scripting-base.de>
Mon, 8 Feb 2016 09:49:49 +0000 (10:49 +0100)
The file size information inside the filelist info window is now
formatted as bytes/kilobytes/megabytes instead of just showing the
plain integer value.

Resolves: #73161
Releases: master, 7.6
Change-Id: I3a8f2245fd0d3a40cfff450ed466e8ccd254d81b
Reviewed-on: https://review.typo3.org/46519
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php

index 2dd5a5f..e4f7c00 100644 (file)
@@ -431,6 +431,11 @@ class ElementInformationController
                 continue;
             }
 
+            // format file size as bytes/kilobytes/megabytes
+            if ($this->type === 'file' && $name === 'size') {
+                $this->row[$name] = GeneralUtility::formatSize($this->row[$name], $this->getLanguageService()->sL('LLL:EXT:lang/locallang_common.xlf:byteSizeUnits', true));
+            }
+
             $isExcluded = !(!$GLOBALS['TCA'][$this->table]['columns'][$name]['exclude'] || $this->getBackendUser()->check('non_exclude_fields', $this->table . ':' . $name));
             if ($isExcluded) {
                 continue;