Trash: use the same sorting algoritm as files

This commit is contained in:
Robin Appelman 2013-01-31 19:36:59 +01:00
parent 9d74ce4595
commit 697536cf6a
1 changed files with 12 additions and 0 deletions

View File

@ -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 = '';