@@ -88,8 +88,9 @@ |
||
88 | 88 | /// Set the duration for the meeting |
89 | 89 | if ( bigbluebuttonbn_get_cfg_scheduled_duration_enabled() ) { |
90 | 90 | $durationtime = bigbluebuttonbn_get_duration($bigbluebuttonbn->openingtime, $bigbluebuttonbn->closingtime); |
91 | - if( $durationtime > 0 ) |
|
92 | - $bbbsession['welcome'] .= '<br><br>'.str_replace("%duration%", ''.$durationtime, get_string('bbbdurationwarning', 'bigbluebuttonbn')); |
|
91 | + if( $durationtime > 0 ) { |
|
92 | + $bbbsession['welcome'] .= '<br><br>'.str_replace("%duration%", ''.$durationtime, get_string('bbbdurationwarning', 'bigbluebuttonbn')); |
|
93 | + } |
|
93 | 94 | } else { |
94 | 95 | $durationtime = 0; |
95 | 96 | } |
@@ -119,8 +119,9 @@ |
||
119 | 119 | //Execute the end command |
120 | 120 | $meeting_info = bigbluebuttonbn_bbb_broker_do_end_meeting($params['id'], $bbbsession['modPW']); |
121 | 121 | // Moodle event logger: Create an event for meeting ended |
122 | - if( isset($bigbluebuttonbn) ) |
|
123 | - bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_ENDED, $bigbluebuttonbn, $context, $cm); |
|
122 | + if( isset($bigbluebuttonbn) ) { |
|
123 | + bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_ENDED, $bigbluebuttonbn, $context, $cm); |
|
124 | + } |
|
124 | 125 | /// Update the cache |
125 | 126 | $meeting_info = bigbluebuttonbn_bbb_broker_get_meeting_info($params['id'], $bbbsession['modPW'], true); |
126 | 127 |
@@ -269,8 +269,9 @@ |
||
269 | 269 | // Fourth block starts here |
270 | 270 | //------------------------------------------------------------------------------- |
271 | 271 | $mform->addElement('header', 'schedule', get_string('mod_form_block_schedule', 'bigbluebuttonbn')); |
272 | - if( isset($current_activity->openingtime) && $current_activity->openingtime != 0 || isset($current_activity->closingtime) && $current_activity->closingtime != 0 ) |
|
273 | - $mform->setExpanded('schedule'); |
|
272 | + if( isset($current_activity->openingtime) && $current_activity->openingtime != 0 || isset($current_activity->closingtime) && $current_activity->closingtime != 0 ) { |
|
273 | + $mform->setExpanded('schedule'); |
|
274 | + } |
|
274 | 275 | |
275 | 276 | $mform->addElement('date_time_selector', 'openingtime', get_string('mod_form_field_openingtime', 'bigbluebuttonbn'), array('optional' => true)); |
276 | 277 | $mform->setDefault('openingtime', 0); |
@@ -388,14 +388,18 @@ discard block |
||
388 | 388 | $bigbluebuttonbn->timemodified = time(); |
389 | 389 | } |
390 | 390 | |
391 | - if (! isset($bigbluebuttonbn->newwindow)) |
|
392 | - $bigbluebuttonbn->newwindow = 0; |
|
393 | - if (! isset($bigbluebuttonbn->wait)) |
|
394 | - $bigbluebuttonbn->wait = 0; |
|
395 | - if (! isset($bigbluebuttonbn->record)) |
|
396 | - $bigbluebuttonbn->record = 0; |
|
397 | - if (! isset($bigbluebuttonbn->tagging)) |
|
398 | - $bigbluebuttonbn->tagging = 0; |
|
391 | + if (! isset($bigbluebuttonbn->newwindow)) { |
|
392 | + $bigbluebuttonbn->newwindow = 0; |
|
393 | + } |
|
394 | + if (! isset($bigbluebuttonbn->wait)) { |
|
395 | + $bigbluebuttonbn->wait = 0; |
|
396 | + } |
|
397 | + if (! isset($bigbluebuttonbn->record)) { |
|
398 | + $bigbluebuttonbn->record = 0; |
|
399 | + } |
|
400 | + if (! isset($bigbluebuttonbn->tagging)) { |
|
401 | + $bigbluebuttonbn->tagging = 0; |
|
402 | + } |
|
399 | 403 | |
400 | 404 | $bigbluebuttonbn->participants = htmlspecialchars_decode($bigbluebuttonbn->participants); |
401 | 405 | } |
@@ -463,8 +467,9 @@ discard block |
||
463 | 467 | /// Add the meeting details to the message_body |
464 | 468 | $msg->action = ucfirst($action); |
465 | 469 | $msg->activity_description = ""; |
466 | - if( !empty($bigbluebuttonbn->intro) ) |
|
467 | - $msg->activity_description = trim($bigbluebuttonbn->intro); |
|
470 | + if( !empty($bigbluebuttonbn->intro) ) { |
|
471 | + $msg->activity_description = trim($bigbluebuttonbn->intro); |
|
472 | + } |
|
468 | 473 | $msg->activity_openingtime = ""; |
469 | 474 | if ($bigbluebuttonbn->openingtime) { |
470 | 475 | $msg->activity_openingtime = calendar_day_representation($bigbluebuttonbn->openingtime).' '.$at.' '.calendar_time_representation($bigbluebuttonbn->openingtime); |
@@ -622,10 +627,11 @@ discard block |
||
622 | 627 | function bigbluebuttonbn_get_db_moodle_roles($rolename='all') { |
623 | 628 | global $DB; |
624 | 629 | |
625 | - if( $rolename != 'all') |
|
626 | - $roles = $DB->get_record('role', array('shortname' => $rolename)); |
|
627 | - else |
|
628 | - $roles = $DB->get_records('role', array()); |
|
630 | + if( $rolename != 'all') { |
|
631 | + $roles = $DB->get_record('role', array('shortname' => $rolename)); |
|
632 | + } else { |
|
633 | + $roles = $DB->get_records('role', array()); |
|
634 | + } |
|
629 | 635 | |
630 | 636 | return $roles; |
631 | 637 | } |
@@ -320,8 +320,7 @@ discard block |
||
320 | 320 | |
321 | 321 | if( $xml ) { //If the xml packet returned failure it displays the message to the user |
322 | 322 | return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); |
323 | - } |
|
324 | - else { //If the server is unreachable, then prompts the user of the necessary action |
|
323 | + } else { //If the server is unreachable, then prompts the user of the necessary action |
|
325 | 324 | return null; |
326 | 325 | } |
327 | 326 | } |
@@ -355,7 +354,9 @@ discard block |
||
355 | 354 | } |
356 | 355 | |
357 | 356 | function bigbluebuttonbn_wrap_xml_load_file($url, $method=BIGBLUEBUTTONBN_METHOD_GET, $data=null) { |
358 | - if ( bigbluebuttonbn_debugdisplay() ) error_log("Request to: ".$url); |
|
357 | + if ( bigbluebuttonbn_debugdisplay() ) { |
|
358 | + error_log("Request to: ".$url); |
|
359 | + } |
|
359 | 360 | |
360 | 361 | if (extension_loaded('curl')) { |
361 | 362 | $c = new curl(); |
@@ -942,7 +943,9 @@ discard block |
||
942 | 943 | $error = $org_msg; |
943 | 944 | |
944 | 945 | if( !empty($new_msg) ) { |
945 | - if( !empty($error) ) $error .= ' '; |
|
946 | + if( !empty($error) ) { |
|
947 | + $error .= ' '; |
|
948 | + } |
|
946 | 949 | $error .= $new_msg; |
947 | 950 | } |
948 | 951 |
@@ -84,8 +84,9 @@ discard block |
||
84 | 84 | $bbbsession['voicebridge'] = ($bigbluebuttonbn->voicebridge > 0) ? 70000 + $bigbluebuttonbn->voicebridge : $bigbluebuttonbn->voicebridge; |
85 | 85 | $bbbsession['wait'] = $bigbluebuttonbn->wait; |
86 | 86 | $bbbsession['record'] = $bigbluebuttonbn->record; |
87 | -if ($bigbluebuttonbn->record) |
|
87 | +if ($bigbluebuttonbn->record) { |
|
88 | 88 | $bbbsession['welcome'] .= '<br><br>' . get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
89 | +} |
|
89 | 90 | $bbbsession['tagging'] = $bigbluebuttonbn->tagging; |
90 | 91 | |
91 | 92 | $bbbsession['openingtime'] = $bigbluebuttonbn->openingtime; |
@@ -112,22 +113,24 @@ discard block |
||
112 | 113 | // Validates if the BigBlueButton server is running |
113 | 114 | $serverVersion = bigbluebuttonbn_getServerVersion($bbbsession['endpoint']); |
114 | 115 | if (!isset($serverVersion)) { //Server is not working |
115 | - if ($bbbsession['administrator']) |
|
116 | - print_error('view_error_unable_join', 'bigbluebuttonbn', $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
117 | - else if ($bbbsession['moderator']) |
|
118 | - print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course); |
|
119 | - else |
|
120 | - print_error('view_error_unable_join_student', 'bigbluebuttonbn', $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course); |
|
121 | -} else { |
|
122 | - $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getMeetingsURL($bbbsession['endpoint'], $bbbsession['shared_secret'])); |
|
123 | - if (!isset($xml) || !isset($xml->returncode) || $xml->returncode == 'FAILED') { // The shared secret is wrong |
|
124 | - if ($bbbsession['administrator']) |
|
116 | + if ($bbbsession['administrator']) { |
|
125 | 117 | print_error('view_error_unable_join', 'bigbluebuttonbn', $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
126 | - else if ($bbbsession['moderator']) |
|
118 | + } else if ($bbbsession['moderator']) { |
|
127 | 119 | print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course); |
128 | - else |
|
120 | + } else { |
|
129 | 121 | print_error('view_error_unable_join_student', 'bigbluebuttonbn', $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course); |
130 | 122 | } |
123 | + } else { |
|
124 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getMeetingsURL($bbbsession['endpoint'], $bbbsession['shared_secret'])); |
|
125 | + if (!isset($xml) || !isset($xml->returncode) || $xml->returncode == 'FAILED') { // The shared secret is wrong |
|
126 | + if ($bbbsession['administrator']) { |
|
127 | + print_error('view_error_unable_join', 'bigbluebuttonbn', $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
128 | + } else if ($bbbsession['moderator']) { |
|
129 | + print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course); |
|
130 | + } else { |
|
131 | + print_error('view_error_unable_join_student', 'bigbluebuttonbn', $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course); |
|
132 | + } |
|
133 | + } |
|
131 | 134 | } |
132 | 135 | |
133 | 136 | // Mark viewed by user (if required) |
@@ -338,7 +341,9 @@ discard block |
||
338 | 341 | } |
339 | 342 | //Generates the meetingID string |
340 | 343 | foreach ($mIDs as $mID) { |
341 | - if (strlen($meetingID) > 0) $meetingID .= ','; |
|
344 | + if (strlen($meetingID) > 0) { |
|
345 | + $meetingID .= ','; |
|
346 | + } |
|
342 | 347 | $meetingID .= $mID; |
343 | 348 | } |
344 | 349 | } |