summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2013-02-11 11:50:41 +0100
committerRobin Appelman <icewind@owncloud.com>2013-02-11 11:50:41 +0100
commit7fa9181a2697d343fce30124792fae664c9c0510 (patch)
tree60c7cc89b066edb3f324bbc4206124b3a370c155 /apps/files_sharing
parentbbf672f4532b6c94354256e71a324830829c1dea (diff)
downloadnextcloud-server-7fa9181a2697d343fce30124792fae664c9c0510.tar.gz
nextcloud-server-7fa9181a2697d343fce30124792fae664c9c0510.zip
Share: fix sorting of files in public shared folder
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/public.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index ac889cd2dcb..b478ac8a4ad 100644
--- a/apps/files_sharing/public.php
+++ b/apps/files_sharing/public.php
@@ -3,6 +3,16 @@ $RUNTIME_NOSETUPFS = true;
// Load other apps for file previews
OC_App::loadApps();
+function fileCmp($a, $b) {
+ if ($a['type'] == 'dir' and $b['type'] != 'dir') {
+ return -1;
+ } elseif ($a['type'] != 'dir' and $b['type'] == 'dir') {
+ return 1;
+ } else {
+ return strnatcasecmp($a['name'], $b['name']);
+ }
+}
+
if (isset($_GET['t'])) {
$token = $_GET['t'];
$linkItem = OCP\Share::getShareByToken($token);
@@ -146,6 +156,8 @@ if (isset($path)) {
$i['permissions'] = OCP\PERMISSION_READ;
$files[] = $i;
}
+ usort($files, "fileCmp");
+
// Make breadcrumb
$breadcrumb = array();
$pathtohere = '';