mirror of
https://github.com/jcampbell1/simple-file-manager.git
synced 2025-02-20 22:00:04 +01:00
feat: default sort ordering is directory first, then name
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user