diff options
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)); |