[FEATURE] Add DESC sorting for FILES-cObject 23/25023/4
authorStefan Froemken <froemken@gmail.com>
Mon, 28 Oct 2013 09:34:35 +0000 (10:34 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Wed, 30 Oct 2013 22:33:28 +0000 (23:33 +0100)
Add new property "direction" in sorting
to order fileObjects in reverse order

Documentation: #53183
Resolves: #53130
Releases: 6.2
Change-Id: I2b31d1ca3afb3738d267ed0de8e1c3ca791f0980
Reviewed-on: https://review.typo3.org/25023
Reviewed-by: Gernot Ploiner
Tested-by: Gernot Ploiner
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/frontend/Classes/ContentObject/FilesContentObject.php

index 509a229..57cd322 100644 (file)
@@ -166,6 +166,9 @@ class FilesContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractConte
                                        return 0;
                                }
                        });
+                       if (is_array($conf['sorting.']) && isset($conf['sorting.']['direction']) && strtolower($conf['sorting.']['direction']) === 'desc') {
+                               $fileObjects = array_reverse($fileObjects);
+                       }
                }
 
                $availableFileObjectCount = count($fileObjects);