diff options
author | Andrew Manning <tamanning@zoho.com> | 2018-03-27 21:11:34 -0400 |
---|---|---|
committer | Andrew Manning <tamanning@zoho.com> | 2018-03-27 21:11:34 -0400 |
commit | 1dc795722a8e748ebb98e8fab778cd4686a0654f (patch) | |
tree | 4f4a4e8dea10090106c4d54a02c6860332cd9df4 /Zotlabs/Storage | |
parent | dcd658f12ea60945678717e3c310e94ece7b1f96 (diff) | |
parent | c98776923a3aed4a0a17ca1412787de3b718eba9 (diff) | |
download | volse-hubzilla-1dc795722a8e748ebb98e8fab778cd4686a0654f.tar.gz volse-hubzilla-1dc795722a8e748ebb98e8fab778cd4686a0654f.tar.bz2 volse-hubzilla-1dc795722a8e748ebb98e8fab778cd4686a0654f.zip |
Merge branch 'dev' into oauth2
Diffstat (limited to 'Zotlabs/Storage')
-rw-r--r-- | Zotlabs/Storage/Directory.php | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/Zotlabs/Storage/Directory.php b/Zotlabs/Storage/Directory.php index 510d463c1..a2ae0fee8 100644 --- a/Zotlabs/Storage/Directory.php +++ b/Zotlabs/Storage/Directory.php @@ -680,7 +680,7 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota, DAV\IMo throw new DAV\Exception\Forbidden('Permission denied.'); } else { - throw new DAV\Exception\NotFound('A component of the request file path could not be found.'); + throw new DAV\Exception\NotFound('A component of the requested file path could not be found.'); } } @@ -691,7 +691,23 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota, DAV\IMo } $prefix = ''; - $suffix = ' order by is_dir desc, filename asc '; + + if(! array_key_exists('cloud_sort',$_SESSION)) + $_SESSION['cloud_sort'] = 'name'; + + switch($_SESSION['cloud_sort']) { + case 'size': + $suffix = ' order by is_dir desc, filesize asc '; + break; + // The following provides inconsistent results for directories because we re-calculate the date for directories based on the most recent change + case 'date': + $suffix = ' order by is_dir desc, edited asc '; + break; + case 'name': + default: + $suffix = ' order by is_dir desc, filename asc '; + break; + } $r = q("select $prefix id, uid, hash, filename, filetype, filesize, revision, folder, flags, is_dir, created, edited from attach where folder = '%s' and uid = %d $perms $suffix", dbesc($folder), |