diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-04-03 20:57:06 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-04-28 17:42:04 +0200 |
commit | 688f6162daeec724c537f9c283092f45b29b05f2 (patch) | |
tree | 27fd75f137b773b886a5d9a0d4511ff136008133 /apps/files_trashbin/lib | |
parent | e055a411ea4b2a32dcf20c910d332867dc91f516 (diff) | |
download | nextcloud-server-688f6162daeec724c537f9c283092f45b29b05f2.tar.gz nextcloud-server-688f6162daeec724c537f9c283092f45b29b05f2.zip |
Add sorting to files list, trashbin and public files
Diffstat (limited to 'apps/files_trashbin/lib')
-rw-r--r-- | apps/files_trashbin/lib/helper.php | 10 |
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; } |