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_sharing/ajax | |
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_sharing/ajax')
-rw-r--r-- | apps/files_sharing/ajax/list.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/files_sharing/ajax/list.php b/apps/files_sharing/ajax/list.php index 4b645496253..36deb58a7ac 100644 --- a/apps/files_sharing/ajax/list.php +++ b/apps/files_sharing/ajax/list.php @@ -47,6 +47,9 @@ if (isset($_GET['dir'])) { $relativePath = $_GET['dir']; } +$sortAttribute = isset( $_GET['sort'] ) ? $_GET['sort'] : 'name'; +$sortDirection = isset( $_GET['sortdirection'] ) ? ($_GET['sortdirection'] === 'desc') : false; + $data = \OCA\Files_Sharing\Helper::setupFromToken($token, $relativePath, $password); $linkItem = $data['linkItem']; @@ -64,7 +67,7 @@ $data = array(); $baseUrl = OCP\Util::linkTo('files_sharing', 'index.php') . '?t=' . urlencode($token) . '&dir='; // make filelist -$files = \OCA\Files\Helper::getFiles($dir); +$files = \OCA\Files\Helper::getFiles($dir, $sortAttribute, $sortDirection); $formattedFiles = array(); foreach ($files as $file) { |