diff --git a/core/js/share.js b/core/js/share.js
index b5e8b0e661..535ae6da99 100644
--- a/core/js/share.js
+++ b/core/js/share.js
@@ -71,7 +71,8 @@ OC.Share={
var item = itemSource;
}
if (typeof OC.Share.statuses[item] === 'undefined') {
- checkShares = false;
+ // NOTE: Check doesn't always work and misses some shares, fix later
+ checkShares = true;
} else {
checkShares = true;
}
@@ -149,7 +150,11 @@ OC.Share={
if (share.share_type == OC.Share.SHARE_TYPE_LINK) {
OC.Share.showLink(itemSource, share.share_with);
} else {
- OC.Share.addShareWith(share.share_type, share.share_with, share.permissions, possiblePermissions);
+ if (share.collection) {
+ OC.Share.addShareWith(share.share_type, share.share_with, share.permissions, possiblePermissions, share.collection);
+ } else {
+ OC.Share.addShareWith(share.share_type, share.share_with, share.permissions, possiblePermissions, false);
+ }
}
});
}
@@ -213,56 +218,70 @@ OC.Share={
}
});
},
- addShareWith:function(shareType, shareWith, permissions, possiblePermissions) {
+ addShareWith:function(shareType, shareWith, permissions, possiblePermissions, collection) {
if (!OC.Share.itemShares[shareType]) {
OC.Share.itemShares[shareType] = [];
}
OC.Share.itemShares[shareType].push(shareWith);
- var editChecked = createChecked = updateChecked = deleteChecked = shareChecked = '';
- if (permissions & OC.PERMISSION_CREATE) {
- createChecked = 'checked="checked"';
- editChecked = 'checked="checked"';
- }
- if (permissions & OC.PERMISSION_UPDATE) {
- updateChecked = 'checked="checked"';
- editChecked = 'checked="checked"';
- }
- if (permissions & OC.PERMISSION_DELETE) {
- deleteChecked = 'checked="checked"';
- editChecked = 'checked="checked"';
- }
- if (permissions & OC.PERMISSION_SHARE) {
- shareChecked = 'checked="checked"';
- }
- var html = '
';
- html += shareWith;
- if (possiblePermissions & OC.PERMISSION_CREATE || possiblePermissions & OC.PERMISSION_UPDATE || possiblePermissions & OC.PERMISSION_DELETE) {
- if (editChecked == '') {
- html += '';
- $(html).appendTo('#shareWithList');
-
},
showLink:function(itemSource, password) {
$('#linkCheckbox').attr('checked', true);
diff --git a/lib/public/share.php b/lib/public/share.php
index 3e42e91d04..6186c2d1c1 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -695,7 +695,12 @@ class Share {
if (isset($item) && $row['item_type'] == $itemType && $row[$column] == $item) {
$collectionItems[] = $row;
} else {
- $row['collection'] = array('item_type' => $row['item_type'], $column => $row[$column]);
+ $collection = array();
+ $collection['item_type'] = $row['item_type'];
+ if ($row['item_type'] == 'file' || $row['item_type'] == 'folder') {
+ $collection['path'] = basename($row['path']);
+ }
+ $row['collection'] = $collection;
// Fetch all of the children sources
$children = $collectionBackend->getChildren($row[$column]);
foreach ($children as $child) {