diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-05-19 20:52:25 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-05-19 20:52:25 +0200 |
commit | 51a6764f3180a258dc17a6744929866aeddb8779 (patch) | |
tree | 78452f7027ab7b71d48f1aedc736cd9617430ce8 /apps/files_sharing/ajax/list.php | |
parent | 2c483fdca21fc32bf6ef8eaf5835e8e4614acd3a (diff) | |
parent | b6d2d6329d99c47fa8a01a7a8db7f8f2de6b9f74 (diff) | |
download | nextcloud-server-51a6764f3180a258dc17a6744929866aeddb8779.tar.gz nextcloud-server-51a6764f3180a258dc17a6744929866aeddb8779.zip |
Merge branch 'master' into cleanup-list-code
Conflicts:
apps/files_sharing/ajax/list.php
Diffstat (limited to 'apps/files_sharing/ajax/list.php')
-rw-r--r-- | apps/files_sharing/ajax/list.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/files_sharing/ajax/list.php b/apps/files_sharing/ajax/list.php index c31b3a0e06f..93964c5ed5b 100644 --- a/apps/files_sharing/ajax/list.php +++ b/apps/files_sharing/ajax/list.php @@ -40,6 +40,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']; @@ -56,7 +59,7 @@ if (!\OC\Files\Filesystem::is_dir($dir . '/')) { $data = array(); // make filelist -$files = \OCA\Files\Helper::getFiles($dir); +$files = \OCA\Files\Helper::getFiles($dir, $sortAttribute, $sortDirection); $formattedFiles = array(); foreach ($files as $file) { @@ -80,4 +83,4 @@ if (OC_Appconfig::getValue('core', 'shareapi_allow_public_upload', 'yes') === 'n $data['permissions'] = $permissions; -OCP\JSON::success(array('data' => $data));
\ No newline at end of file +OCP\JSON::success(array('data' => $data)); |