From 688f6162daeec724c537f9c283092f45b29b05f2 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Thu, 3 Apr 2014 20:57:06 +0200 Subject: Add sorting to files list, trashbin and public files --- apps/files_sharing/ajax/list.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'apps/files_sharing/ajax') 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) { -- cgit v1.2.3 From ac9e07c589e65abd025b5ca867a353b5cb579dc2 Mon Sep 17 00:00:00 2001 From: Thomas Müller Date: Mon, 28 Apr 2014 17:56:20 +0200 Subject: $RUNTIME_APPTYPES is no longer used - left over from pre OC4 --- apps/files_sharing/ajax/list.php | 5 ----- 1 file changed, 5 deletions(-) (limited to 'apps/files_sharing/ajax') diff --git a/apps/files_sharing/ajax/list.php b/apps/files_sharing/ajax/list.php index 36deb58a7ac..82bacb3d38d 100644 --- a/apps/files_sharing/ajax/list.php +++ b/apps/files_sharing/ajax/list.php @@ -20,11 +20,6 @@ * */ -// only need filesystem apps -$RUNTIME_APPTYPES=array('filesystem'); - -// Init owncloud - if(!\OC_App::isEnabled('files_sharing')){ exit; } -- cgit v1.2.3