From 2cef39baed704f34c54221301a214f363d2ce65a Mon Sep 17 00:00:00 2001 From: Kevin Jardine Date: Wed, 25 Jan 2012 11:35:41 +0100 Subject: reactivated add_users and add_users_notify settings (both off by default) --- actions/event_calendar/manage_subscribers.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'actions/event_calendar/manage_subscribers.php') diff --git a/actions/event_calendar/manage_subscribers.php b/actions/event_calendar/manage_subscribers.php index 212150082..d20c73cbd 100644 --- a/actions/event_calendar/manage_subscribers.php +++ b/actions/event_calendar/manage_subscribers.php @@ -1,13 +1,22 @@ canEdit()) { +$event_calendar_add_users = elgg_get_plugin_setting('add_users', 'event_calendar'); +if (($event_calendar_add_users == 'yes') && 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 + $event_calendar_add_users_notify = elgg_get_plugin_setting('add_users_notify', 'event_calendar'); + $site_guid = elgg_get_site_entity()->guid; foreach ($members as $user_guid) { add_entity_relationship($user_guid,'personal_event',$event_guid); + if ($event_calendar_add_users_notify == 'yes') { + $subject = elgg_echo('event_calendar:add_users_notify:subject'); + $user = get_user($user_guid); + $message = elgg_echo('event_calendar:add_users_notify:body',array($user->name,$event->title,$event->getURL())); + notify_user($user_guid, $site_guid, $subject, $message); + } } system_message(elgg_echo('event_calendar:manage_subscribers:success')); forward($event->getURL()); -- cgit v1.2.3