Sort files by name, not by mimetype

This commit is contained in:
kondou 2013-09-05 23:17:53 +02:00
parent f84fe479a5
commit 85e41d9500
1 changed files with 9 additions and 0 deletions

View 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));