From 872381995dbcd77b90ac5175ffc7ba51ec75c42a Mon Sep 17 00:00:00 2001 From: Kevin Jardine Date: Thu, 26 Apr 2012 16:21:00 +0200 Subject: Merges in BBB web conference functionality from now defunct sched_conf plugin --- views/default/event_calendar/conference_button.php | 32 ++++++++++++++++++++++ views/default/forms/event_calendar/edit.php | 9 ++++-- views/default/object/event_calendar.php | 4 +++ views/default/plugins/event_calendar/settings.php | 26 ++++++++++++++++++ 4 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 views/default/event_calendar/conference_button.php (limited to 'views/default') 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 @@ +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 '
'.$button.'
'; + } +} 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 .= '

'; $body .= '

'.$prefix['calendar'].elgg_echo('event_calendar:calendar_description').'

'; -if(elgg_plugin_exists('sched_conf')) { +if($event_calendar_bbb_server_url) { $body .= '

'; - $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 .= '

'; } 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 .= '
'; + $body .= elgg_view('event_calendar/conference_button',array('event'=>$event)); + } $event_items = event_calendar_get_formatted_full_items($event); $body .= '
'; 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 .= '
'; $body .= elgg_view('input/text',array('name'=>'params[ical_auth_file_name]','value'=>$ical_auth_file_name, 'class'=>'event-calendar-ical-auth-setting')); +$body .= '

'; + +$event_calendar_bbb_server_url = elgg_get_plugin_setting('bbb_server_url', 'event_calendar'); + +$body .= elgg_echo('event_calendar:bbb_server_url'); +$body .= '
'; +$body .= elgg_view('input/text', array( + 'name' => 'params[bbb_server_url]', + 'value' => $event_calendar_bbb_server_url, + 'class' => 'text_input', +)); + +$body .= '

'; + +$event_calendar_bbb_security_salt = elgg_get_plugin_setting('bbb_security_salt', 'event_calendar'); + +$body .= elgg_echo('event_calendar:bbb_security_salt'); +$body .= '
'; +$body .= elgg_view('input/text', array( + 'name' => 'params[bbb_security_salt]', + 'value' => $event_calendar_bbb_security_salt, + 'class' => 'text_input', +)); + +$body .= '

'; + echo $body; -- cgit v1.2.3