]> source.dussan.org Git - nextcloud-server.git/commitdiff
Sort files by name, not by mimetype
authorkondou <kondou@ts.unde.re>
Thu, 5 Sep 2013 21:17:53 +0000 (23:17 +0200)
committerkondou <kondou@ts.unde.re>
Thu, 5 Sep 2013 21:17:53 +0000 (23:17 +0200)
apps/files/ajax/rawlist.php

index 2fd6f67d308ca56be3405ee83b03d19460ce07e6..e51932dff0fe2e9030ff00d0150a291f99a6dc0c 100644 (file)
@@ -42,4 +42,13 @@ if (is_array($mimetypes) && count($mimetypes)) {
        }
 }
 
+// Sort by name
+function cmp($a, $b) {
+       if ($a['name'] === $b['name']) {
+                return 0;
+       }
+       return ($a['name'] < $b['name']) ? -1 : 1;
+}
+uasort($files, 'cmp');
+
 OC_JSON::success(array('data' => $files));