Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Ehrke <dev@georgswebsite.de>2012-04-08 06:41:24 +0400
committerGeorg Ehrke <dev@georgswebsite.de>2012-04-08 06:41:24 +0400
commit5a4237a31dd326b6ce46a6a7f1e9f45d103f51b6 (patch)
treeed0466a8fb53900d4537c13ce289c770e5608016 /apps/calendar
parent97d216c94d20ec23f8e88ecf490cdaae51ce3b7b (diff)
make dropdown menu work with single event sharing
Diffstat (limited to 'apps/calendar')
-rw-r--r--apps/calendar/templates/share.dropdown.php26
1 files changed, 16 insertions, 10 deletions
diff --git a/apps/calendar/templates/share.dropdown.php b/apps/calendar/templates/share.dropdown.php
index ca1e128ea78..4e9f41ead14 100644
--- a/apps/calendar/templates/share.dropdown.php
+++ b/apps/calendar/templates/share.dropdown.php
@@ -1,13 +1,19 @@
<?php
-$sharedcalendars = OC_Calendar_Share::allUsersSharedwith($_['calid'], OC_Calendar_Share::CALENDAR);
+if(array_key_exists('calid', $_)){
+ $id = $_['calid'];
+ $sharedelements = OC_Calendar_Share::allUsersSharedwith($_['calid'], OC_Calendar_Share::CALENDAR);
+}else{
+ $sharedelements = OC_Calendar_Share::allUsersSharedwith($_['eventid'], OC_Calendar_Share::EVENT);
+ $id = $_['eventid'];
+}
$users = array();$groups = array();$public = array();
-foreach($sharedcalendars as $sharedcalendar){
- if($sharedcalendar['sharetype'] == 'user'){
- $users[] = $sharedcalendar;
- }elseif($sharedcalendar['sharetype'] == 'group'){
- $groups[] = $sharedcalendar;
- }elseif($sharedcalendar['sharetype'] == 'public'){
- $public = $sharedcalendar;
+foreach($sharedelements as $sharedelement){
+ if($sharedelement['sharetype'] == 'user'){
+ $users[] = $sharedelement;
+ }elseif($sharedelement['sharetype'] == 'group'){
+ $groups[] = $sharedelement;
+ }elseif($sharedelement['sharetype'] == 'public'){
+ $public = $sharedelement;
}
}
?>
@@ -31,7 +37,7 @@ echo html_select_options($allusers, array());
<script>
$('#sharewithuser_<?php echo $user['share']; ?> > img').click(function(){
$('#share_user option[value="<?php echo $user['share']; ?>"]').removeAttr('disabled');
- Calendar.UI.Share.unshare(<?php echo $_['calid']; ?>, 'calendar', '<?php echo $user['share']; ?>', 'user');
+ Calendar.UI.Share.unshare(<?php echo $id; ?>, 'calendar', '<?php echo $user['share']; ?>', 'user');
$('#sharewithuser_<?php echo $user['share']; ?>').remove();
$("#share_user").trigger("liszt:updated");
});
@@ -57,7 +63,7 @@ echo html_select_options($allgroups, array());
<script>
$('#sharewithgroup_<?php echo $group['share']; ?> > img').click(function(){
$('#share_group option[value="<?php echo $group['share']; ?>"]').removeAttr('disabled');
- Calendar.UI.Share.unshare(<?php echo $_['calid']; ?>, 'calendar', '<?php echo $group['share']; ?>', 'group');
+ Calendar.UI.Share.unshare(<?php echo $id; ?>, 'calendar', '<?php echo $group['share']; ?>', 'group');
$('#sharewithgroup_<?php echo $group['share']; ?>').remove();
$("#share_group").trigger("liszt:updated");
});