summaryrefslogtreecommitdiffstats
path: root/apps/files/ajax/list.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/ajax/list.php')
-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);