summaryrefslogtreecommitdiffstats
path: root/apps/files/ajax
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-04-03 20:57:06 +0200
committerVincent Petry <pvince81@owncloud.com>2014-04-28 17:42:04 +0200
commit688f6162daeec724c537f9c283092f45b29b05f2 (patch)
tree27fd75f137b773b886a5d9a0d4511ff136008133 /apps/files/ajax
parente055a411ea4b2a32dcf20c910d332867dc91f516 (diff)
downloadnextcloud-server-688f6162daeec724c537f9c283092f45b29b05f2.tar.gz
nextcloud-server-688f6162daeec724c537f9c283092f45b29b05f2.zip
Add sorting to files list, trashbin and public files
Diffstat (limited to 'apps/files/ajax')
-rw-r--r--apps/files/ajax/list.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/files/ajax/list.php b/apps/files/ajax/list.php
index 2d76b685018..bae3628402f 100644
--- a/apps/files/ajax/list.php
+++ b/apps/files/ajax/list.php
@@ -17,8 +17,11 @@ $baseUrl = OCP\Util::linkTo('files', 'index.php') . '?dir=';
$permissions = $dirInfo->getPermissions();
+$sortAttribute = isset( $_GET['sort'] ) ? $_GET['sort'] : 'name';
+$sortDirection = isset( $_GET['sortdirection'] ) ? ($_GET['sortdirection'] === 'desc') : false;
+
// make filelist
-$files = \OCA\Files\Helper::getFiles($dir);
+$files = \OCA\Files\Helper::getFiles($dir, $sortAttribute, $sortDirection);
$data['directory'] = $dir;
$data['files'] = \OCA\Files\Helper::formatFileInfos($files);