diff options
Diffstat (limited to 'views')
-rw-r--r-- | views/default/event_calendar/conference_button.php | 32 | ||||
-rw-r--r-- | views/default/forms/event_calendar/edit.php | 9 | ||||
-rw-r--r-- | views/default/object/event_calendar.php | 4 | ||||
-rw-r--r-- | views/default/plugins/event_calendar/settings.php | 26 |
4 files changed, 69 insertions, 2 deletions
diff --git a/views/default/event_calendar/conference_button.php b/views/default/event_calendar/conference_button.php new file mode 100644 index 000000000..f6fedf4f6 --- /dev/null +++ b/views/default/event_calendar/conference_button.php @@ -0,0 +1,32 @@ +<?php +// A non-admin / non-event-creator only sees the button if they have the event on his/her personal calendar +// and it is at most 15 minutes before the conference starts. + +// The button is removed for everyone (even admins) one day after the conference ends. + +$event = $vars['event']; + +if ($event) { + elgg_load_library('elgg:event_calendar'); + $user_guid = elgg_get_logged_in_user_guid(); + $termination_time = $event->real_end_time + 60*60*24; + if ($termination_time < time()) { + $in_time_window = FALSE; + } else if ($event->canEdit()) { + $in_time_window = TRUE; + } else if (event_calendar_has_personal_event($event->guid, $user_guid) && ($event->start_date - 15*60) >= time()) { + $in_time_window = TRUE; + } else { + $in_time_window = FALSE; + } + if ( $in_time_window ) { + $button = elgg_view('output/url', array( + 'href' => event_calendar_get_join_bbb_url($event), + 'text' => elgg_echo('event_calendar:join_conf_button'), + 'class' => 'elgg-button elgg-button-action', + 'target' => '_blank', + )); + + echo '<div class="event-calendar-conf-join-button">'.$button.'</div>'; + } +} diff --git a/views/default/forms/event_calendar/edit.php b/views/default/forms/event_calendar/edit.php index 260e8afe0..79e2a5d0b 100644 --- a/views/default/forms/event_calendar/edit.php +++ b/views/default/forms/event_calendar/edit.php @@ -26,6 +26,7 @@ $event_calendar_more_required = elgg_get_plugin_setting('more_required', 'event_ $event_calendar_personal_manage = elgg_get_plugin_setting('personal_manage', 'event_calendar'); $event_calendar_repeated_events = elgg_get_plugin_setting('repeated_events', 'event_calendar'); $event_calendar_reminders = elgg_get_plugin_setting('reminders', 'event_calendar'); +$event_calendar_bbb_server_url = elgg_get_plugin_setting('bbb_server_url', 'event_calendar'); if ($event_calendar_more_required == 'yes') { $required_fields = array('title','venue','start_date','start_time', @@ -168,9 +169,13 @@ $body .= elgg_view('event_calendar/container',array('container_guid'=>$vars['con $body .= '</p>'; $body .= '<p class="event-calendar-description">'.$prefix['calendar'].elgg_echo('event_calendar:calendar_description').'</p>'; -if(elgg_plugin_exists('sched_conf')) { +if($event_calendar_bbb_server_url) { $body .= '<p>'; - $body .= elgg_view('input/checkbox',array('name'=>'web_conference','value'=>$web_conference,'options_values'=>array('1'))); + if ($fd['web_conference']) { + $body .= elgg_view('input/checkbox',array('name'=>'web_conference','value'=>1,'checked'=>'checked')); + } else { + $body .= elgg_view('input/checkbox',array('name'=>'web_conference','value'=>1)); + } $body .= elgg_echo('event_calendar:web_conference_label'); $body .= '</p>'; } diff --git a/views/default/object/event_calendar.php b/views/default/object/event_calendar.php index 717e2803e..b72c869ea 100644 --- a/views/default/object/event_calendar.php +++ b/views/default/object/event_calendar.php @@ -16,6 +16,10 @@ $full = elgg_extract('full_view', $vars, FALSE); if ($full) { $body = elgg_view('event_calendar/strapline',$vars); + if ($event->web_conference) { + $body .= '<br />'; + $body .= elgg_view('event_calendar/conference_button',array('event'=>$event)); + } $event_items = event_calendar_get_formatted_full_items($event); $body .= '<br />'; diff --git a/views/default/plugins/event_calendar/settings.php b/views/default/plugins/event_calendar/settings.php index 908818998..2a2e043de 100644 --- a/views/default/plugins/event_calendar/settings.php +++ b/views/default/plugins/event_calendar/settings.php @@ -445,4 +445,30 @@ $body .= elgg_echo('event_calendar:ical_auth_file_name:title'); $body .= '<br />'; $body .= elgg_view('input/text',array('name'=>'params[ical_auth_file_name]','value'=>$ical_auth_file_name, 'class'=>'event-calendar-ical-auth-setting')); +$body .= '<br /><br />'; + +$event_calendar_bbb_server_url = elgg_get_plugin_setting('bbb_server_url', 'event_calendar'); + +$body .= elgg_echo('event_calendar:bbb_server_url'); +$body .= '<br />'; +$body .= elgg_view('input/text', array( + 'name' => 'params[bbb_server_url]', + 'value' => $event_calendar_bbb_server_url, + 'class' => 'text_input', +)); + +$body .= '<br /><br />'; + +$event_calendar_bbb_security_salt = elgg_get_plugin_setting('bbb_security_salt', 'event_calendar'); + +$body .= elgg_echo('event_calendar:bbb_security_salt'); +$body .= '<br />'; +$body .= elgg_view('input/text', array( + 'name' => 'params[bbb_security_salt]', + 'value' => $event_calendar_bbb_security_salt, + 'class' => 'text_input', +)); + +$body .= '<br /><br />'; + echo $body; |