diff options
author | Kevin Jardine <kevinjardine@yahoo.com> | 2012-01-25 11:35:41 +0100 |
---|---|---|
committer | Kevin Jardine <kevinjardine@yahoo.com> | 2012-01-25 11:35:41 +0100 |
commit | 2cef39baed704f34c54221301a214f363d2ce65a (patch) | |
tree | 18a26b982ca1ae860e8a288acfd8e954a2975c9a /actions/event_calendar | |
parent | aa04adce03438348c52477eacbd611c83d3caf68 (diff) | |
download | elgg-2cef39baed704f34c54221301a214f363d2ce65a.tar.gz elgg-2cef39baed704f34c54221301a214f363d2ce65a.tar.bz2 |
reactivated add_users and add_users_notify settings (both off by default)
Diffstat (limited to 'actions/event_calendar')
-rw-r--r-- | actions/event_calendar/manage_subscribers.php | 11 |
1 files changed, 10 insertions, 1 deletions
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 @@ <?php $event_guid = get_input('event_guid'); $event = get_entity($event_guid); -if (elgg_instanceof($event,'object','event_calendar') && $event->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()); |