summaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin/lib/helper.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_trashbin/lib/helper.php')
-rw-r--r--apps/files_trashbin/lib/helper.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/files_trashbin/lib/helper.php b/apps/files_trashbin/lib/helper.php
index e6ca73520a6..c98d57586d3 100644
--- a/apps/files_trashbin/lib/helper.php
+++ b/apps/files_trashbin/lib/helper.php
@@ -8,11 +8,14 @@ class Helper
{
/**
* Retrieves the contents of a trash bin directory.
+ *
* @param string $dir path to the directory inside the trashbin
* or empty to retrieve the root of the trashbin
+ * @param string $sortAttribute attribute to sort on or empty to disable sorting
+ * @param bool $sortDescending true for descending sort, false otherwise
* @return \OCP\Files\FileInfo[]
*/
- public static function getTrashFiles($dir){
+ public static function getTrashFiles($dir, $sortAttribute = '', $sortDescending = false){
$result = array();
$timestamp = null;
$user = \OCP\User::getUser();
@@ -57,8 +60,9 @@ class Helper
closedir($dirContent);
}
- usort($result, array('\OCA\Files\Helper', 'fileCmp'));
-
+ if ($sortAttribute !== '') {
+ return \OCA\Files\Helper::sortFiles($result, $sortAttribute, $sortDescending);
+ }
return $result;
}