feat: default sort ordering is directory first, then name

This commit is contained in:
John Campbell
2019-10-24 12:34:14 -06:00
parent 49790c0d9f
commit 204033157b

View File

@@ -84,6 +84,11 @@ if($_GET['do'] == 'list') {
'is_executable' => is_executable($i),
];
}
usort($result,function($f1,$f2){
$f1_key = ($f1['is_dir']?:2) . $f1['name'];
$f2_key = ($f2['is_dir']?:2) . $f2['name'];
return $f1_key > $f2_key;
});
} else {
err(412,"Not a Directory");
}