Skip to content
Snippets Groups Projects
Commit 7fa9181a authored by Robin Appelman's avatar Robin Appelman
Browse files

Share: fix sorting of files in public shared folder

parent bbf672f4
Branches
No related tags found
No related merge requests found
......@@ -3,6 +3,16 @@ $RUNTIME_NOSETUPFS = true;
// Load other apps for file previews
OC_App::loadApps();
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']);
}
}
if (isset($_GET['t'])) {
$token = $_GET['t'];
$linkItem = OCP\Share::getShareByToken($token);
......@@ -146,6 +156,8 @@ if (isset($path)) {
$i['permissions'] = OCP\PERMISSION_READ;
$files[] = $i;
}
usort($files, "fileCmp");
// Make breadcrumb
$breadcrumb = array();
$pathtohere = '';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment