diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/api/sharees.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/apps/files_sharing/api/sharees.php b/apps/files_sharing/api/sharees.php index 83acdd086c3..8146c98b01a 100644 --- a/apps/files_sharing/api/sharees.php +++ b/apps/files_sharing/api/sharees.php @@ -205,6 +205,24 @@ class Sharees { $sharees = array_merge($sharees, $this->getRemote($search)); } + + // Sort sharees + usort($sharees, function($a, $b) { + $res = strcmp($a['label'], $b['label']); + + // If labels are equal sort by share type + if ($res === 0) { + $res = $a['value']['shareType'] - $b['value']['shareType']; + } + + // If sharetype is equal compare shareWith + if ($res === 0) { + $res = strcmp($a['value']['shareWith'], $b['value']['shareWith']); + } + + return $res; + }); + //Pagination $start = ($page - 1) * $per_page; $end = $page * $per_page; |