$values = array_map(function (\OCP\Files\Node $node) use ($shares) {
/** @var IShare[] $shares */
$shares = (isset($shares[$node->getId()])) ? $shares[$node->getId()] : [];
- return array_map(function(IShare $share) {
+ $types = array_map(function(IShare $share) {
return $share->getShareType();
}, $shares);
+ $types = array_unique($types);
+ sort($types);
+ return $types;
}, $children);
$keys = array_map(function (\OCP\Files\Node $node) {
$qb->expr()->eq('item_type', $qb->createNamedParameter('folder'))
))
->andWhere(
- $qb->expr()->eq('shareType', $qb->createNamedParameter(\OCP\Share::SHARE_TYPE_REMOTE))
+ $qb->expr()->eq('share_type', $qb->createNamedParameter(\OCP\Share::SHARE_TYPE_REMOTE))
);
/**
$qb->andWhere($qb->expr()->orX(
$qb->expr()->eq('share_type', $qb->createNamedParameter(\OCP\Share::SHARE_TYPE_USER)),
- $qb->expr()->eq('share_type', $qb->createNamedParameter(\OCP\Share::SHARE_TYPE_GROUP))
+ $qb->expr()->eq('share_type', $qb->createNamedParameter(\OCP\Share::SHARE_TYPE_GROUP)),
+ $qb->expr()->eq('share_type', $qb->createNamedParameter(\OCP\Share::SHARE_TYPE_LINK))
));
/**
$providers = $this->factory->getAllProviders();
return array_reduce($providers, function($shares, IShareProvider $provider) use ($userId, $node, $reshares) {
- return $shares + $provider->getSharesInFolder($userId, $node, $reshares);
+ $newShares = $provider->getSharesInFolder($userId, $node, $reshares);
+ foreach ($newShares as $fid => $data) {
+ if (!isset($shares[$fid])) {
+ $shares[$fid] = [];
+ }
+
+ $shares[$fid] = array_merge($shares[$fid], $data);
+ }
+ return $shares;
}, []);
}