summaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin/index.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2013-01-31 19:36:59 +0100
committerRobin Appelman <icewind@owncloud.com>2013-01-31 19:36:59 +0100
commit697536cf6ad1c9a862c32605b807172dfa680d22 (patch)
tree5b41466dbf1e2b30af85e0a23554aec57a58e073 /apps/files_trashbin/index.php
parent9d74ce45955ce9969b6d356a114b02780b5645f8 (diff)
downloadnextcloud-server-697536cf6ad1c9a862c32605b807172dfa680d22.tar.gz
nextcloud-server-697536cf6ad1c9a862c32605b807172dfa680d22.zip
Trash: use the same sorting algoritm as files
Diffstat (limited to 'apps/files_trashbin/index.php')
-rw-r--r--apps/files_trashbin/index.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/files_trashbin/index.php b/apps/files_trashbin/index.php
index 4f0a697939c..a4eb5cd216c 100644
--- a/apps/files_trashbin/index.php
+++ b/apps/files_trashbin/index.php
@@ -68,6 +68,18 @@ foreach ($result as $r) {
$files[] = $i;
}
+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']);
+ }
+}
+
+usort($files, "fileCmp");
+
// Make breadcrumb
$breadcrumb = array(array('dir' => '', 'name' => 'Trash'));
$pathtohere = '';