Share: fix sorting of files in public shared folder

This commit is contained in:
Robin Appelman 2013-02-11 11:50:41 +01:00
parent bbf672f453
commit 7fa9181a26
1 changed files with 12 additions and 0 deletions

View File

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