diff options
author | Kevin Jardine <kevinjardine@yahoo.com> | 2011-10-19 18:24:38 +0200 |
---|---|---|
committer | Kevin Jardine <kevinjardine@yahoo.com> | 2011-10-19 18:24:38 +0200 |
commit | 52c341fb429b138f07cf99d1f5cde7ae8a86f8ee (patch) | |
tree | 563abac65b4c8c34fe51d31411ad6a51f6edcdf3 /actions/event_calendar | |
parent | a4003502d860f39880d0368d2737f3b03445fafa (diff) | |
download | elgg-52c341fb429b138f07cf99d1f5cde7ae8a86f8ee.tar.gz elgg-52c341fb429b138f07cf99d1f5cde7ae8a86f8ee.tar.bz2 |
group events now have add all and remove all buttons when managing subscribers
Diffstat (limited to 'actions/event_calendar')
-rw-r--r-- | actions/event_calendar/add_to_group.php | 1 | ||||
-rw-r--r-- | actions/event_calendar/add_to_group_members.php | 15 | ||||
-rw-r--r-- | actions/event_calendar/remove_from_group_members.php | 15 |
3 files changed, 30 insertions, 1 deletions
diff --git a/actions/event_calendar/add_to_group.php b/actions/event_calendar/add_to_group.php index b8c18ebb0..b5eae4693 100644 --- a/actions/event_calendar/add_to_group.php +++ b/actions/event_calendar/add_to_group.php @@ -8,4 +8,3 @@ if ($group && $group->canEdit()) { system_message(elgg_echo('event_calendar:add_to_group:success')); } forward($event->getUrl()); -?>
\ No newline at end of file diff --git a/actions/event_calendar/add_to_group_members.php b/actions/event_calendar/add_to_group_members.php new file mode 100644 index 000000000..d0d555b12 --- /dev/null +++ b/actions/event_calendar/add_to_group_members.php @@ -0,0 +1,15 @@ +<?php +elgg_load_library('elgg:event_calendar'); +$event_guid = get_input("event_guid",0); +$event = get_entity($event_guid); +$group = get_entity($event->container_guid); +if (elgg_instanceof($group,'group') && elgg_instanceof($event,'object','event_calendar') && $group->canEdit()) { + $members = $group->getMembers(0,0); + foreach($members as $member) { + event_calendar_add_personal_event($event->guid,$member->guid); + } + system_message(elgg_echo('event_calendar:add_to_group_members:success')); +} else { + register_error(elgg_echo('event_calendar:add_to_group_members:error')); +} +forward("event_calendar/manage_users/$event_guid"); diff --git a/actions/event_calendar/remove_from_group_members.php b/actions/event_calendar/remove_from_group_members.php new file mode 100644 index 000000000..a15b66c97 --- /dev/null +++ b/actions/event_calendar/remove_from_group_members.php @@ -0,0 +1,15 @@ +<?php +elgg_load_library('elgg:event_calendar'); +$event_guid = get_input("event_guid",0); +$event = get_entity($event_guid); +$group = get_entity($event->container_guid); +if (elgg_instanceof($group,'group') && elgg_instanceof($event,'object','event_calendar') && $group->canEdit()) { + $members = $group->getMembers(0,0); + foreach($members as $member) { + event_calendar_remove_personal_event($event->guid,$member->guid); + } + system_message(elgg_echo('event_calendar:remove_from_group_members:success')); +} else { + register_error(elgg_echo('event_calendar:remove_from_group_members:error')); +} +forward("event_calendar/manage_users/$event_guid"); |