Show which parent folder is shared with the user in the sharing drop down
This commit is contained in:
parent
968f1282ce
commit
23c8d7b3fb
|
@ -9,12 +9,14 @@ $source = $userDirectory.$_GET['source'];
|
||||||
$users = OC_Share::getMySharedItem($source);
|
$users = OC_Share::getMySharedItem($source);
|
||||||
$source = dirname($source);
|
$source = dirname($source);
|
||||||
while ($source != "" && $source != "/" && $source != "." && $source != $userDirectory) {
|
while ($source != "" && $source != "/" && $source != "." && $source != $userDirectory) {
|
||||||
$parentUsers = array();
|
|
||||||
$values = array_values(OC_Share::getMySharedItem($source));
|
$values = array_values(OC_Share::getMySharedItem($source));
|
||||||
for ($i = 0; $i < count($values); $i++) {
|
if (count($values) > 0) {
|
||||||
$parentUsers[basename($source)."-".$i] = $values[$i];
|
$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);
|
$source = dirname($source);
|
||||||
}
|
}
|
||||||
echo json_encode($users);
|
echo json_encode($users);
|
||||||
|
|
|
@ -128,10 +128,7 @@ function createShareDropdown(filenames, files) {
|
||||||
$.each(users, function(index, row) {
|
$.each(users, function(index, row) {
|
||||||
if (typeof(index) == 'string') {
|
if (typeof(index) == 'string') {
|
||||||
// TODO typeof not always working, group together users that have parent folders shared with them
|
// TODO typeof not always working, group together users that have parent folders shared with them
|
||||||
list += "<li>disabled";
|
list += "<li>Parent folder "+index.substr(0, index.lastIndexOf('-'))+" shared with "+row.uid_shared_with+"</li>";
|
||||||
list += index;
|
|
||||||
list += row.uid_shared_with;
|
|
||||||
list += "</li>";
|
|
||||||
} else {
|
} else {
|
||||||
list += "<li data-uid_shared_with='"+row.uid_shared_with+"'>";
|
list += "<li data-uid_shared_with='"+row.uid_shared_with+"'>";
|
||||||
list += row.uid_shared_with;
|
list += row.uid_shared_with;
|
||||||
|
|
Loading…
Reference in New Issue