aboutsummaryrefslogtreecommitdiff
path: root/actions/event_calendar/manage_subscribers.php
diff options
context:
space:
mode:
authorKevin Jardine <kevinjardine@yahoo.com>2012-01-02 15:09:06 +0100
committerKevin Jardine <kevinjardine@yahoo.com>2012-01-02 15:09:06 +0100
commitaa04adce03438348c52477eacbd611c83d3caf68 (patch)
treee9ab59edf8fdd4685e7779ca6a9250d6396dc31d /actions/event_calendar/manage_subscribers.php
parent52326aa6023bea7efc6208ce80f3e78797a3fcc9 (diff)
downloadelgg-aa04adce03438348c52477eacbd611c83d3caf68.tar.gz
elgg-aa04adce03438348c52477eacbd611c83d3caf68.tar.bz2
added new userpicker for site-wide event user management
Diffstat (limited to 'actions/event_calendar/manage_subscribers.php')
-rw-r--r--actions/event_calendar/manage_subscribers.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/actions/event_calendar/manage_subscribers.php b/actions/event_calendar/manage_subscribers.php
new file mode 100644
index 000000000..212150082
--- /dev/null
+++ b/actions/event_calendar/manage_subscribers.php
@@ -0,0 +1,17 @@
+<?php
+$event_guid = get_input('event_guid');
+$event = get_entity($event_guid);
+if (elgg_instanceof($event,'object','event_calendar') && $event->canEdit()) {
+ $members = get_input('members');
+ // clear the event from all personal calendars
+ remove_entity_relationships($event_guid, 'personal_event', TRUE);
+ // add event to personal calendars
+ foreach ($members as $user_guid) {
+ add_entity_relationship($user_guid,'personal_event',$event_guid);
+ }
+ system_message(elgg_echo('event_calendar:manage_subscribers:success'));
+ forward($event->getURL());
+} else {
+ register_error(elgg_echo('event_calendar:manage_subscribers:error'));
+ forward();
+}