diff options
author | Michael Gapczynski <GapczynskiM@gmail.com> | 2011-08-08 15:49:16 -0400 |
---|---|---|
committer | Michael Gapczynski <GapczynskiM@gmail.com> | 2011-08-08 15:49:16 -0400 |
commit | 23c8d7b3fb316daa7c70552ed47e63e9bbcd300f (patch) | |
tree | 581f69c730a05773bac4a9eab122cd4c9a7f8d9a /apps | |
parent | 968f1282ce6a6cb36f175a28fc078f6dfcfc6d45 (diff) | |
download | nextcloud-server-23c8d7b3fb316daa7c70552ed47e63e9bbcd300f.tar.gz nextcloud-server-23c8d7b3fb316daa7c70552ed47e63e9bbcd300f.zip |
Show which parent folder is shared with the user in the sharing drop down
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/ajax/getitem.php | 10 | ||||
-rw-r--r-- | apps/files_sharing/js/share.js | 5 |
2 files changed, 7 insertions, 8 deletions
diff --git a/apps/files_sharing/ajax/getitem.php b/apps/files_sharing/ajax/getitem.php index 3a3be404a30..43105d334ee 100644 --- a/apps/files_sharing/ajax/getitem.php +++ b/apps/files_sharing/ajax/getitem.php @@ -9,12 +9,14 @@ $source = $userDirectory.$_GET['source']; $users = OC_Share::getMySharedItem($source); $source = dirname($source); while ($source != "" && $source != "/" && $source != "." && $source != $userDirectory) { - $parentUsers = array(); $values = array_values(OC_Share::getMySharedItem($source)); - for ($i = 0; $i < count($values); $i++) { - $parentUsers[basename($source)."-".$i] = $values[$i]; + if (count($values) > 0) { + $parentUsers = array(); + for ($i = 0; $i < count($values); $i++) { + $parentUsers[basename($source)."-".$i] = $values[$i]; + } + $users = array_merge($users, $parentUsers); } - $users = array_merge($users, $parentUsers); $source = dirname($source); } echo json_encode($users); diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index 0b97010c4f1..d6cf45bf44f 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -128,10 +128,7 @@ function createShareDropdown(filenames, files) { $.each(users, function(index, row) { if (typeof(index) == 'string') { // TODO typeof not always working, group together users that have parent folders shared with them - list += "<li>disabled"; - list += index; - list += row.uid_shared_with; - list += "</li>"; + list += "<li>Parent folder "+index.substr(0, index.lastIndexOf('-'))+" shared with "+row.uid_shared_with+"</li>"; } else { list += "<li data-uid_shared_with='"+row.uid_shared_with+"'>"; list += row.uid_shared_with; |