diff options
author | Kevin Jardine <kevinjardine@yahoo.com> | 2012-01-25 12:10:45 +0100 |
---|---|---|
committer | Kevin Jardine <kevinjardine@yahoo.com> | 2012-01-25 12:10:45 +0100 |
commit | 2a3e34d1c5724b29a4f2404081f30b425fcdee50 (patch) | |
tree | dd00b1525ec9ee44cebc7b4fef3b0152b32c3438 | |
parent | a62fc25059fb7b67358b285b6d6f3a4a469f35bb (diff) | |
download | elgg-2a3e34d1c5724b29a4f2404081f30b425fcdee50.tar.gz elgg-2a3e34d1c5724b29a4f2404081f30b425fcdee50.tar.bz2 |
more for add_users and add_users_notify features
-rw-r--r-- | actions/event_calendar/manage_subscribers.php | 2 | ||||
-rw-r--r-- | actions/event_calendar/toggle_personal_calendar.php | 9 | ||||
-rw-r--r-- | views/default/forms/event_calendar/edit.php | 8 |
3 files changed, 15 insertions, 4 deletions
diff --git a/actions/event_calendar/manage_subscribers.php b/actions/event_calendar/manage_subscribers.php index d20c73cbd..079c3628f 100644 --- a/actions/event_calendar/manage_subscribers.php +++ b/actions/event_calendar/manage_subscribers.php @@ -15,7 +15,7 @@ if (($event_calendar_add_users == 'yes') && elgg_instanceof($event,'object','eve $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); + notify_user($user_guid, $site_guid, $subject, $message, NULL, 'email'); } } system_message(elgg_echo('event_calendar:manage_subscribers:success')); diff --git a/actions/event_calendar/toggle_personal_calendar.php b/actions/event_calendar/toggle_personal_calendar.php index 9ad8d0a0e..8eb20e6b9 100644 --- a/actions/event_calendar/toggle_personal_calendar.php +++ b/actions/event_calendar/toggle_personal_calendar.php @@ -19,6 +19,15 @@ if (event_calendar_has_personal_event($event_guid,$user_guid)) { $response = array('success'=>TRUE, 'message' => $remove_response, 'button_text'=>$button_text); } else { if (event_calendar_add_personal_event($event_guid,$user_guid)) { + $event_calendar_add_users_notify = elgg_get_plugin_setting('add_users_notify', 'event_calendar'); + if ($event_calendar_add_users_notify == 'yes') { + $subject = elgg_echo('event_calendar:add_users_notify:subject'); + $user = get_user($user_guid); + $event = get_entity($event_guid); + $site_guid = elgg_get_site_entity()->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, NULL, 'email'); + } $button_text = elgg_echo('event_calendar:remove_from_the_calendar_button'); $response = array('success'=>TRUE, 'message' => $add_response, 'button_text'=>$button_text); } else { diff --git a/views/default/forms/event_calendar/edit.php b/views/default/forms/event_calendar/edit.php index 214a51f4e..a84a79407 100644 --- a/views/default/forms/event_calendar/edit.php +++ b/views/default/forms/event_calendar/edit.php @@ -6,7 +6,7 @@ $event_calendar_times = elgg_get_plugin_setting('times', 'event_calendar'); $event_calendar_region_display = elgg_get_plugin_setting('region_display', 'event_calendar'); $event_calendar_type_display = elgg_get_plugin_setting('type_display', 'event_calendar'); $event_calendar_spots_display = elgg_get_plugin_setting('spots_display', 'event_calendar'); -$event_calendar_add_users = elgg_get_plugin_setting('add_users', 'event_calendar'); +//$event_calendar_add_users = elgg_get_plugin_setting('add_users', 'event_calendar'); $event_calendar_hide_access = elgg_get_plugin_setting('hide_access', 'event_calendar'); $event_calendar_hide_end = elgg_get_plugin_setting('hide_end', 'event_calendar'); $event_calendar_more_required = elgg_get_plugin_setting('more_required', 'event_calendar'); @@ -143,12 +143,14 @@ if ($event_calendar_spots_display == 'yes') { $body .= '<p class="description">'.$prefix['spots'].elgg_echo('event_calendar:spots_description').'</p>'; } -if ($event_calendar_add_users == 'yes') { +// the following feature has been superceded by the manage subscribers feature + +/*if ($event_calendar_add_users == 'yes') { $body .= '<p><label>'.elgg_echo("event_calendar:add_user_label").'<br />'; $body .= elgg_view("input/adduser",array('name' => 'adduser','internalid' => 'do_adduser','width'=> 200, 'minChars'=>2)); $body .= '</label></p><br /><br />'; $body .= '<p class="description">'.elgg_echo('event_calendar:add_user_description').'</p>'; -} +}*/ $body .= '<p><label>'.elgg_echo("event_calendar:brief_description_label").'<br />'; $body .= elgg_view("input/text",array('name' => 'description','value'=>$brief_description)); |