@@ -28,29 +28,29 @@ discard block  | 
                                                    ||
| 28 | 28 | |
| 29 | 29 | global $CFG;  | 
                                                        
| 30 | 30 | |
| 31 | -require_once($CFG->dirroot.'/calendar/lib.php');  | 
                                                        |
| 32 | -require_once($CFG->dirroot.'/message/lib.php');  | 
                                                        |
| 33 | -require_once($CFG->dirroot.'/mod/lti/OAuth.php');  | 
                                                        |
| 34 | -require_once($CFG->dirroot.'/tag/lib.php');  | 
                                                        |
| 35 | -require_once($CFG->libdir.'/accesslib.php');  | 
                                                        |
| 36 | -require_once($CFG->libdir.'/completionlib.php');  | 
                                                        |
| 37 | -require_once($CFG->libdir.'/datalib.php');  | 
                                                        |
| 38 | -require_once($CFG->libdir.'/coursecatlib.php');  | 
                                                        |
| 39 | -require_once($CFG->libdir.'/enrollib.php');  | 
                                                        |
| 40 | -require_once($CFG->libdir.'/filelib.php');  | 
                                                        |
| 41 | -require_once($CFG->libdir.'/formslib.php');  | 
                                                        |
| 42 | -  | 
                                                        |
| 43 | -  | 
                                                        |
| 44 | -if (file_exists(dirname(__FILE__).'/vendor/firebase/php-jwt/src/JWT.php')) { | 
                                                        |
| 45 | - require_once(dirname(__FILE__).'/vendor/firebase/php-jwt/src/JWT.php');  | 
                                                        |
| 31 | +require_once($CFG->dirroot . '/calendar/lib.php');  | 
                                                        |
| 32 | +require_once($CFG->dirroot . '/message/lib.php');  | 
                                                        |
| 33 | +require_once($CFG->dirroot . '/mod/lti/OAuth.php');  | 
                                                        |
| 34 | +require_once($CFG->dirroot . '/tag/lib.php');  | 
                                                        |
| 35 | +require_once($CFG->libdir . '/accesslib.php');  | 
                                                        |
| 36 | +require_once($CFG->libdir . '/completionlib.php');  | 
                                                        |
| 37 | +require_once($CFG->libdir . '/datalib.php');  | 
                                                        |
| 38 | +require_once($CFG->libdir . '/coursecatlib.php');  | 
                                                        |
| 39 | +require_once($CFG->libdir . '/enrollib.php');  | 
                                                        |
| 40 | +require_once($CFG->libdir . '/filelib.php');  | 
                                                        |
| 41 | +require_once($CFG->libdir . '/formslib.php');  | 
                                                        |
| 42 | +  | 
                                                        |
| 43 | +  | 
                                                        |
| 44 | +if (file_exists(dirname(__FILE__) . '/vendor/firebase/php-jwt/src/JWT.php')) { | 
                                                        |
| 45 | + require_once(dirname(__FILE__) . '/vendor/firebase/php-jwt/src/JWT.php');  | 
                                                        |
| 46 | 46 | }  | 
                                                        
| 47 | 47 | |
| 48 | 48 |  if (!isset($CFG->bigbluebuttonbn)) { | 
                                                        
| 49 | 49 | $CFG->bigbluebuttonbn = array();  | 
                                                        
| 50 | 50 | }  | 
                                                        
| 51 | 51 | |
| 52 | -if (file_exists(dirname(__FILE__).'/config.php')) { | 
                                                        |
| 53 | - require_once(dirname(__FILE__).'/config.php');  | 
                                                        |
| 52 | +if (file_exists(dirname(__FILE__) . '/config.php')) { | 
                                                        |
| 53 | + require_once(dirname(__FILE__) . '/config.php');  | 
                                                        |
| 54 | 54 | }  | 
                                                        
| 55 | 55 | |
| 56 | 56 | /*  | 
                                                        
@@ -97,18 +97,18 @@ discard block  | 
                                                    ||
| 97 | 97 | return null;  | 
                                                        
| 98 | 98 | }  | 
                                                        
| 99 | 99 | $features = array(  | 
                                                        
| 100 | - (string) FEATURE_IDNUMBER => true,  | 
                                                        |
| 101 | - (string) FEATURE_GROUPS => true,  | 
                                                        |
| 102 | - (string) FEATURE_GROUPINGS => true,  | 
                                                        |
| 103 | - (string) FEATURE_GROUPMEMBERSONLY => true,  | 
                                                        |
| 104 | - (string) FEATURE_MOD_INTRO => true,  | 
                                                        |
| 105 | - (string) FEATURE_BACKUP_MOODLE2 => true,  | 
                                                        |
| 106 | - (string) FEATURE_COMPLETION_TRACKS_VIEWS => true,  | 
                                                        |
| 107 | - (string) FEATURE_GRADE_HAS_GRADE => false,  | 
                                                        |
| 108 | - (string) FEATURE_GRADE_OUTCOMES => false,  | 
                                                        |
| 109 | - (string) FEATURE_SHOW_DESCRIPTION => true,  | 
                                                        |
| 100 | + (string)FEATURE_IDNUMBER => true,  | 
                                                        |
| 101 | + (string)FEATURE_GROUPS => true,  | 
                                                        |
| 102 | + (string)FEATURE_GROUPINGS => true,  | 
                                                        |
| 103 | + (string)FEATURE_GROUPMEMBERSONLY => true,  | 
                                                        |
| 104 | + (string)FEATURE_MOD_INTRO => true,  | 
                                                        |
| 105 | + (string)FEATURE_BACKUP_MOODLE2 => true,  | 
                                                        |
| 106 | + (string)FEATURE_COMPLETION_TRACKS_VIEWS => true,  | 
                                                        |
| 107 | + (string)FEATURE_GRADE_HAS_GRADE => false,  | 
                                                        |
| 108 | + (string)FEATURE_GRADE_OUTCOMES => false,  | 
                                                        |
| 109 | + (string)FEATURE_SHOW_DESCRIPTION => true,  | 
                                                        |
| 110 | 110 | );  | 
                                                        
| 111 | -    if (isset($features[(string) $feature])) { | 
                                                        |
| 111 | +    if (isset($features[(string)$feature])) { | 
                                                        |
| 112 | 112 | return $features[$feature];  | 
                                                        
| 113 | 113 | }  | 
                                                        
| 114 | 114 | return null;  | 
                                                        
@@ -208,7 +208,7 @@ discard block  | 
                                                    ||
| 208 | 208 | $log->timecreated = time();  | 
                                                        
| 209 | 209 | $log->log = BIGBLUEBUTTONBN_LOG_EVENT_DELETE;  | 
                                                        
| 210 | 210 |      $sql  = "SELECT * FROM {bigbluebuttonbn_logs} "; | 
                                                        
| 211 | -    $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND ". $DB->sql_compare_text('meta') . " = ?"; | 
                                                        |
| 211 | +    $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND " . $DB->sql_compare_text('meta') . " = ?"; | 
                                                        |
| 212 | 212 |      $logs = $DB->get_records_sql($sql, array($bigbluebuttonbn->id, BIGBLUEBUTTONBN_LOG_EVENT_CREATE, "{\"record\":true}")); | 
                                                        
| 213 | 213 |      $log->meta = "{\"has_recordings\":false}"; | 
                                                        
| 214 | 214 |      if (!empty($logs)) { | 
                                                        
@@ -237,10 +237,10 @@ discard block  | 
                                                    ||
| 237 | 237 |  function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) { | 
                                                        
| 238 | 238 | global $DB;  | 
                                                        
| 239 | 239 |      $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id, | 
                                                        
| 240 | - 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join', ), '*');  | 
                                                        |
| 240 | + 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join',), '*');  | 
                                                        |
| 241 | 241 |      if ($completed > 0) { | 
                                                        
| 242 | -        return fullname($user).' '.get_string('view_message_has_joined', 'bigbluebuttonbn').' '. | 
                                                        |
| 243 | -            get_string('view_message_session_for', 'bigbluebuttonbn').' '.(string) $completed.' '. | 
                                                        |
| 242 | +        return fullname($user) . ' ' . get_string('view_message_has_joined', 'bigbluebuttonbn') . ' ' . | 
                                                        |
| 243 | +            get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string)$completed . ' ' . | 
                                                        |
| 244 | 244 |              get_string('view_message_times', 'bigbluebuttonbn'); | 
                                                        
| 245 | 245 | }  | 
                                                        
| 246 | 246 | return '';  | 
                                                        
@@ -260,7 +260,7 @@ discard block  | 
                                                    ||
| 260 | 260 |  function bigbluebuttonbn_user_complete($course, $user, $mod, $bigbluebuttonbn) { | 
                                                        
| 261 | 261 | global $DB;  | 
                                                        
| 262 | 262 |      $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id, | 
                                                        
| 263 | - 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join', ),  | 
                                                        |
| 263 | + 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join',),  | 
                                                        |
| 264 | 264 | '*', IGNORE_MULTIPLE);  | 
                                                        
| 265 | 265 | return $completed > 0;  | 
                                                        
| 266 | 266 | }  | 
                                                        
@@ -335,16 +335,16 @@ discard block  | 
                                                    ||
| 335 | 335 |      if ($bigbluebuttonbn->visible) { | 
                                                        
| 336 | 336 | $classes = 'class="dimmed" ';  | 
                                                        
| 337 | 337 | }  | 
                                                        
| 338 | - $str = '<div class="bigbluebuttonbn overview">'."\n";  | 
                                                        |
| 339 | -    $str .= '  <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; | 
                                                        |
| 340 | - $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule.  | 
                                                        |
| 341 | - '">'.$bigbluebuttonbn->name.'</a>'."\n";  | 
                                                        |
| 342 | - $str .= ' </div>'."\n";  | 
                                                        |
| 343 | - $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime).  | 
                                                        |
| 344 | - '</div>'."\n";  | 
                                                        |
| 345 | -    $str .= '  <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) | 
                                                        |
| 346 | - .'</div>'."\n";  | 
                                                        |
| 347 | - $str .= '</div>'."\n";  | 
                                                        |
| 338 | + $str = '<div class="bigbluebuttonbn overview">' . "\n";  | 
                                                        |
| 339 | +    $str .= '  <div class="name">' . get_string('modulename', 'bigbluebuttonbn') . ': ' . "\n"; | 
                                                        |
| 340 | + $str .= ' <a ' . $classes . 'href="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bigbluebuttonbn->coursemodule .  | 
                                                        |
| 341 | + '">' . $bigbluebuttonbn->name . '</a>' . "\n";  | 
                                                        |
| 342 | + $str .= ' </div>' . "\n";  | 
                                                        |
| 343 | + $str .= ' <div class="info">' . get_string($start, 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->openingtime) .  | 
                                                        |
| 344 | + '</div>' . "\n";  | 
                                                        |
| 345 | +    $str .= '  <div class="info">' . get_string('ends_at', 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->closingtime) | 
                                                        |
| 346 | + .'</div>' . "\n";  | 
                                                        |
| 347 | + $str .= '</div>' . "\n";  | 
                                                        |
| 348 | 348 | return $str;  | 
                                                        
| 349 | 349 | }  | 
                                                        
| 350 | 350 | |
@@ -544,7 +544,7 @@ discard block  | 
                                                    ||
| 544 | 544 |      if (count($files) == 1) { | 
                                                        
| 545 | 545 | // Get the first (and only) file.  | 
                                                        
| 546 | 546 | $file = reset($files);  | 
                                                        
| 547 | - $filesrc = '/'.$file->get_filename();  | 
                                                        |
| 547 | + $filesrc = '/' . $file->get_filename();  | 
                                                        |
| 548 | 548 | }  | 
                                                        
| 549 | 549 | return $filesrc;  | 
                                                        
| 550 | 550 | }  | 
                                                        
@@ -612,7 +612,7 @@ discard block  | 
                                                    ||
| 612 | 612 |      if (!$filename) { | 
                                                        
| 613 | 613 | return false;  | 
                                                        
| 614 | 614 | }  | 
                                                        
| 615 | - $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename;  | 
                                                        |
| 615 | + $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename;  | 
                                                        |
| 616 | 616 | $fs = get_file_storage();  | 
                                                        
| 617 | 617 | $file = $fs->get_file_by_hash(sha1($fullpath));  | 
                                                        
| 618 | 618 |      if (!$file || $file->is_directory()) { | 
                                                        
@@ -61,7 +61,7 @@ discard block  | 
                                                    ||
| 61 | 61 | * Remove this block when restored  | 
                                                        
| 62 | 62 | */  | 
                                                        
| 63 | 63 | |
| 64 | - /** @var BIGBLUEBUTTONBN_DEFAULT_SERVER_URL string of default bigbluebutton server url */  | 
                                                        |
| 64 | + /** @var BIGBLUEBUTTONBN_DEFAULT_SERVER_URL string of default bigbluebutton server url */  | 
                                                        |
| 65 | 65 | const BIGBLUEBUTTONBN_DEFAULT_SERVER_URL = 'http://test-install.blindsidenetworks.com/bigbluebutton/';  | 
                                                        
| 66 | 66 | /** @var BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET string of default bigbluebutton server shared secret */  | 
                                                        
| 67 | 67 | const BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET = '8cd8ef52e8e101574e400365b55e11a6';  | 
                                                        
@@ -339,12 +339,12 @@ discard block  | 
                                                    ||
| 339 | 339 | $str = '<div class="bigbluebuttonbn overview">'."\n";  | 
                                                        
| 340 | 340 |      $str .= '  <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; | 
                                                        
| 341 | 341 | $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule.  | 
                                                        
| 342 | - '">'.$bigbluebuttonbn->name.'</a>'."\n";  | 
                                                        |
| 342 | + '">'.$bigbluebuttonbn->name.'</a>'."\n";  | 
                                                        |
| 343 | 343 | $str .= ' </div>'."\n";  | 
                                                        
| 344 | 344 | $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime).  | 
                                                        
| 345 | 345 | '</div>'."\n";  | 
                                                        
| 346 | 346 |      $str .= '  <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) | 
                                                        
| 347 | - .'</div>'."\n";  | 
                                                        |
| 347 | + .'</div>'."\n";  | 
                                                        |
| 348 | 348 | $str .= '</div>'."\n";  | 
                                                        
| 349 | 349 | return $str;  | 
                                                        
| 350 | 350 | }  | 
                                                        
@@ -529,7 +529,7 @@ discard block  | 
                                                    ||
| 529 | 529 | $bigbluebuttonbn->coursemodule,  | 
                                                        
| 530 | 530 | 'bigbluebuttonbn',  | 
                                                        
| 531 | 531 | $bigbluebuttonbn->id, $bigbluebuttonbn->completionexpected  | 
                                                        
| 532 | - );  | 
                                                        |
| 532 | + );  | 
                                                        |
| 533 | 533 | }  | 
                                                        
| 534 | 534 | }  | 
                                                        
| 535 | 535 | /**  | 
                                                        
@@ -434,12 +434,12 @@ discard block  | 
                                                    ||
| 434 | 434 | $recordings = bigbluebuttonbn_get_recordings(  | 
                                                        
| 435 | 435 | $bbbsession['course']->id, $bigbluebuttonbnid, $enabledfeatures['showroom'],  | 
                                                        
| 436 | 436 | $bbbsession['bigbluebuttonbn']->recordings_deleted  | 
                                                        
| 437 | - );  | 
                                                        |
| 437 | + );  | 
                                                        |
| 438 | 438 |      if ($enabledfeatures['importrecordings']) { | 
                                                        
| 439 | 439 | // Get recording links.  | 
                                                        
| 440 | 440 | $recordingsimported = bigbluebuttonbn_get_recordings_imported_array(  | 
                                                        
| 441 | 441 | $bbbsession['course']->id, $bigbluebuttonbnid, $enabledfeatures['showroom']  | 
                                                        
| 442 | - );  | 
                                                        |
| 442 | + );  | 
                                                        |
| 443 | 443 | /* Perform aritmetic addition instead of merge so the imported recordings corresponding to existent  | 
                                                        
| 444 | 444 | * recordings are not included. */  | 
                                                        
| 445 | 445 | $recordings += $recordingsimported;  | 
                                                        
@@ -453,7 +453,7 @@ discard block  | 
                                                    ||
| 453 | 453 | // JavaScript variables for recordings.  | 
                                                        
| 454 | 454 | $jsvars += array(  | 
                                                        
| 455 | 455 | 'recordings_html' => $bbbsession['bigbluebuttonbn']->recordings_html == '1',  | 
                                                        
| 456 | - );  | 
                                                        |
| 456 | + );  | 
                                                        |
| 457 | 457 | // If there are meetings with recordings load the data to the table.  | 
                                                        
| 458 | 458 |      if ($bbbsession['bigbluebuttonbn']->recordings_html) { | 
                                                        
| 459 | 459 | // Render a plain html table.  | 
                                                        
@@ -463,7 +463,7 @@ discard block  | 
                                                    ||
| 463 | 463 | $jsvars += array(  | 
                                                        
| 464 | 464 | 'columns' => bigbluebuttonbn_get_recording_columns($bbbsession),  | 
                                                        
| 465 | 465 | 'data' => bigbluebuttonbn_get_recording_data($bbbsession, $recordings),  | 
                                                        
| 466 | - );  | 
                                                        |
| 466 | + );  | 
                                                        |
| 467 | 467 | // Render a YUI table.  | 
                                                        
| 468 | 468 |      return html_writer::div('', '', array('id' => 'bigbluebuttonbn_recordings_table')); | 
                                                        
| 469 | 469 | }  | 
                                                        
@@ -483,10 +483,10 @@ discard block  | 
                                                    ||
| 483 | 483 | }  | 
                                                        
| 484 | 484 |      $button = html_writer::tag('input', '', | 
                                                        
| 485 | 485 |          array('type' => 'button', | 
                                                        
| 486 | -              'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'), | 
                                                        |
| 487 | - 'class' => 'btn btn-secondary',  | 
                                                        |
| 488 | - 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='.  | 
                                                        |
| 489 | - $bbbsession['bigbluebuttonbn']->id.'\''));  | 
                                                        |
| 486 | +                'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'), | 
                                                        |
| 487 | + 'class' => 'btn btn-secondary',  | 
                                                        |
| 488 | + 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='.  | 
                                                        |
| 489 | + $bbbsession['bigbluebuttonbn']->id.'\''));  | 
                                                        |
| 490 | 490 |      $output  = html_writer::empty_tag('br'); | 
                                                        
| 491 | 491 |      $output .= html_writer::tag('span', $button, array('id' => 'import_recording_links_button')); | 
                                                        
| 492 | 492 |      $output .= html_writer::tag('span', '', array('id' => 'import_recording_links_table')); | 
                                                        
@@ -565,5 +565,5 @@ discard block  | 
                                                    ||
| 565 | 565 |          (string)\mod_bigbluebuttonbn\locallib\config::get('general_warning_button_href'), | 
                                                        
| 566 | 566 |          (string)\mod_bigbluebuttonbn\locallib\config::get('general_warning_button_text'), | 
                                                        
| 567 | 567 |          (string)\mod_bigbluebuttonbn\locallib\config::get('general_warning_button_class') | 
                                                        
| 568 | - );  | 
                                                        |
| 568 | + );  | 
                                                        |
| 569 | 569 | }  | 
                                                        
@@ -24,8 +24,8 @@ discard block  | 
                                                    ||
| 24 | 24 | * @author Fred Dixon (ffdixon [at] blindsidenetworks [dt] com)  | 
                                                        
| 25 | 25 | */  | 
                                                        
| 26 | 26 | |
| 27 | -require_once(dirname(dirname(dirname(__FILE__))).'/config.php');  | 
                                                        |
| 28 | -require_once(dirname(__FILE__).'/locallib.php');  | 
                                                        |
| 27 | +require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');  | 
                                                        |
| 28 | +require_once(dirname(__FILE__) . '/locallib.php');  | 
                                                        |
| 29 | 29 | |
| 30 | 30 |  $id = required_param('id', PARAM_INT); | 
                                                        
| 31 | 31 |  $bn = optional_param('bn', 0, PARAM_INT); | 
                                                        
@@ -57,19 +57,19 @@ discard block  | 
                                                    ||
| 57 | 57 |  if (is_null($serverversion)) { | 
                                                        
| 58 | 58 |      if ($bbbsession['administrator']) { | 
                                                        
| 59 | 59 |          print_error('view_error_unable_join', 'bigbluebuttonbn', | 
                                                        
| 60 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');  | 
                                                        |
| 60 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');  | 
                                                        |
| 61 | 61 | exit;  | 
                                                        
| 62 | 62 | }  | 
                                                        
| 63 | 63 |      if ($bbbsession['moderator']) { | 
                                                        
| 64 | 64 |          print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', | 
                                                        
| 65 | - $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course);  | 
                                                        |
| 65 | + $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course);  | 
                                                        |
| 66 | 66 | exit;  | 
                                                        
| 67 | 67 | }  | 
                                                        
| 68 | 68 |      print_error('view_error_unable_join_student', 'bigbluebuttonbn', | 
                                                        
| 69 | - $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course);  | 
                                                        |
| 69 | + $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course);  | 
                                                        |
| 70 | 70 | exit;  | 
                                                        
| 71 | 71 | }  | 
                                                        
| 72 | -$bbbsession['serverversion'] = (string) $serverversion;  | 
                                                        |
| 72 | +$bbbsession['serverversion'] = (string)$serverversion;  | 
                                                        |
| 73 | 73 | |
| 74 | 74 | // Mark viewed by user (if required).  | 
                                                        
| 75 | 75 | $completion = new completion_info($course);  | 
                                                        
@@ -77,7 +77,7 @@ discard block  | 
                                                    ||
| 77 | 77 | |
| 78 | 78 | // Print the page header.  | 
                                                        
| 79 | 79 | $PAGE->set_context($context);  | 
                                                        
| 80 | -$PAGE->set_url($CFG->wwwroot.'/mod/bigbluebuttonbn/view.php', array('id' => $cm->id)); | 
                                                        |
| 80 | +$PAGE->set_url($CFG->wwwroot . '/mod/bigbluebuttonbn/view.php', array('id' => $cm->id)); | 
                                                        |
| 81 | 81 | $PAGE->set_title(format_string($bigbluebuttonbn->name));  | 
                                                        
| 82 | 82 | $PAGE->set_cacheable(false);  | 
                                                        
| 83 | 83 | $PAGE->set_heading($course->fullname);  | 
                                                        
@@ -87,11 +87,11 @@ discard block  | 
                                                    ||
| 87 | 87 |  if (!has_capability('moodle/category:manage', $context) && !has_capability('mod/bigbluebuttonbn:join', $context)) { | 
                                                        
| 88 | 88 | echo $OUTPUT->header();  | 
                                                        
| 89 | 89 |      if (isguestuser()) { | 
                                                        
| 90 | -        echo $OUTPUT->confirm('<p>'.get_string('view_noguests', 'bigbluebuttonbn').'</p>'.get_string('liketologin'), | 
                                                        |
| 91 | - get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id);  | 
                                                        |
| 90 | +        echo $OUTPUT->confirm('<p>' . get_string('view_noguests', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'), | 
                                                        |
| 91 | + get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id);  | 
                                                        |
| 92 | 92 |      } else { | 
                                                        
| 93 | -        echo $OUTPUT->confirm('<p>'.get_string('view_nojoin', 'bigbluebuttonbn').'</p>'.get_string('liketologin'), | 
                                                        |
| 94 | - get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id);  | 
                                                        |
| 93 | +        echo $OUTPUT->confirm('<p>' . get_string('view_nojoin', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'), | 
                                                        |
| 94 | + get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id);  | 
                                                        |
| 95 | 95 | }  | 
                                                        
| 96 | 96 | echo $OUTPUT->footer();  | 
                                                        
| 97 | 97 | exit;  | 
                                                        
@@ -99,7 +99,7 @@ discard block  | 
                                                    ||
| 99 | 99 | |
| 100 | 100 | // Operation URLs.  | 
                                                        
| 101 | 101 | $bbbsession['bigbluebuttonbnURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id;  | 
                                                        
| 102 | -$bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id='.$id .  | 
                                                        |
| 102 | +$bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id=' . $id .  | 
                                                        |
| 103 | 103 | '&bn=' . $bbbsession['bigbluebuttonbn']->id;  | 
                                                        
| 104 | 104 | $bbbsession['recordingReadyURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_broker.php?action=recording_' .  | 
                                                        
| 105 | 105 | 'ready&bigbluebuttonbn=' . $bbbsession['bigbluebuttonbn']->id;  | 
                                                        
@@ -119,7 +119,7 @@ discard block  | 
                                                    ||
| 119 | 119 | echo $OUTPUT->footer();  | 
                                                        
| 120 | 120 | |
| 121 | 121 | // Shows version as a comment.  | 
                                                        
| 122 | -echo '<!-- '.$bbbsession['originTag'].' -->'."\n";  | 
                                                        |
| 122 | +echo '<!-- ' . $bbbsession['originTag'] . ' -->' . "\n";  | 
                                                        |
| 123 | 123 | |
| 124 | 124 | // Initialize session variable used across views.  | 
                                                        
| 125 | 125 | $SESSION->bigbluebuttonbn_bbbsession = $bbbsession;  | 
                                                        
@@ -148,7 +148,7 @@ discard block  | 
                                                    ||
| 148 | 148 | $bbbsession['modPW'] = $bbbsession['bigbluebuttonbn']->moderatorpass;  | 
                                                        
| 149 | 149 | $bbbsession['viewerPW'] = $bbbsession['bigbluebuttonbn']->viewerpass;  | 
                                                        
| 150 | 150 | // Database info related to the activity.  | 
                                                        
| 151 | - $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'.  | 
                                                        |
| 151 | + $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' .  | 
                                                        |
| 152 | 152 | $bbbsession['bigbluebuttonbn']->id;  | 
                                                        
| 153 | 153 | $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name;  | 
                                                        
| 154 | 154 | $bbbsession['meetingdescription'] = $bbbsession['bigbluebuttonbn']->intro;  | 
                                                        
@@ -168,7 +168,7 @@ discard block  | 
                                                    ||
| 168 | 168 |          $bbbsession['welcome'] = get_string('mod_form_field_welcome_default', 'bigbluebuttonbn'); | 
                                                        
| 169 | 169 | }  | 
                                                        
| 170 | 170 |      if ($bbbsession['bigbluebuttonbn']->record) { | 
                                                        
| 171 | -        $bbbsession['welcome'] .= '<br><br>'.get_string('bbbrecordwarning', 'bigbluebuttonbn'); | 
                                                        |
| 171 | +        $bbbsession['welcome'] .= '<br><br>' . get_string('bbbrecordwarning', 'bigbluebuttonbn'); | 
                                                        |
| 172 | 172 | }  | 
                                                        
| 173 | 173 | $bbbsession['openingtime'] = $bbbsession['bigbluebuttonbn']->openingtime;  | 
                                                        
| 174 | 174 | $bbbsession['closingtime'] = $bbbsession['bigbluebuttonbn']->closingtime;  | 
                                                        
@@ -181,7 +181,7 @@ discard block  | 
                                                    ||
| 181 | 181 | $bbbsession['originServerName'] = $parsedurl['host'];  | 
                                                        
| 182 | 182 | $bbbsession['originServerUrl'] = $CFG->wwwroot;  | 
                                                        
| 183 | 183 | $bbbsession['originServerCommonName'] = '';  | 
                                                        
| 184 | -    $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn ('.get_config('mod_bigbluebuttonbn', 'version').')'; | 
                                                        |
| 184 | +    $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn (' . get_config('mod_bigbluebuttonbn', 'version') . ')'; | 
                                                        |
| 185 | 185 | $bbbsession['bnserver'] = bigbluebuttonbn_is_bn_server();  | 
                                                        
| 186 | 186 | }  | 
                                                        
| 187 | 187 | |
@@ -236,8 +236,8 @@ discard block  | 
                                                    ||
| 236 | 236 | $groupname = groups_get_group_name($bbbsession['group']);  | 
                                                        
| 237 | 237 | }  | 
                                                        
| 238 | 238 | // Assign group default values.  | 
                                                        
| 239 | - $bbbsession['meetingid'] .= '['.$bbbsession['group'].']';  | 
                                                        |
| 240 | -    $bbbsession['meetingname'] .= ' ('.$groupname.')'; | 
                                                        |
| 239 | + $bbbsession['meetingid'] .= '[' . $bbbsession['group'] . ']';  | 
                                                        |
| 240 | +    $bbbsession['meetingname'] .= ' (' . $groupname . ')'; | 
                                                        |
| 241 | 241 |      if (count($groups) == 0) { | 
                                                        
| 242 | 242 | // Only the All participants group exists.  | 
                                                        
| 243 | 243 |          bigbluebuttonbn_view_message_box($bbbsession, get_string('view_groups_notenrolled_warning', 'bigbluebuttonbn'), 'info'); | 
                                                        
@@ -247,7 +247,7 @@ discard block  | 
                                                    ||
| 247 | 247 |      if (has_capability('moodle/site:accessallgroups', $context)) { | 
                                                        
| 248 | 248 |          bigbluebuttonbn_view_message_box($bbbsession, get_string('view_groups_selection_warning', 'bigbluebuttonbn')); | 
                                                        
| 249 | 249 | }  | 
                                                        
| 250 | - $urltoroot = $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bbbsession['cm']->id;  | 
                                                        |
| 250 | + $urltoroot = $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id;  | 
                                                        |
| 251 | 251 | groups_print_activity_menu($bbbsession['cm'], $urltoroot);  | 
                                                        
| 252 | 252 | echo '<br><br>';  | 
                                                        
| 253 | 253 | }  | 
                                                        
@@ -314,7 +314,7 @@ discard block  | 
                                                    ||
| 314 | 314 |          $recordingsdisabled = get_string('view_message_recordings_disabled', 'bigbluebuttonbn'); | 
                                                        
| 315 | 315 | $output .= bigbluebuttonbn_render_warning($recordingsdisabled, 'danger');  | 
                                                        
| 316 | 316 | }  | 
                                                        
| 317 | -    echo $output.html_writer::empty_tag('br').html_writer::empty_tag('br').html_writer::empty_tag('br'); | 
                                                        |
| 317 | +    echo $output . html_writer::empty_tag('br') . html_writer::empty_tag('br') . html_writer::empty_tag('br'); | 
                                                        |
| 318 | 318 |      $PAGE->requires->yui_module('moodle-mod_bigbluebuttonbn-broker', 'M.mod_bigbluebuttonbn.broker.init', array($jsvars)); | 
                                                        
| 319 | 319 | }  | 
                                                        
| 320 | 320 | |
@@ -383,12 +383,12 @@ discard block  | 
                                                    ||
| 383 | 383 | // JavaScript variables for room.  | 
                                                        
| 384 | 384 | $openingtime = '';  | 
                                                        
| 385 | 385 |      if ($bbbsession['openingtime']) { | 
                                                        
| 386 | -        $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn').': '. | 
                                                        |
| 386 | +        $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn') . ': ' . | 
                                                        |
| 387 | 387 | userdate($bbbsession['openingtime']);  | 
                                                        
| 388 | 388 | }  | 
                                                        
| 389 | 389 | $closingtime = '';  | 
                                                        
| 390 | 390 |      if ($bbbsession['closingtime']) { | 
                                                        
| 391 | -        $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn').': '. | 
                                                        |
| 391 | +        $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn') . ': ' . | 
                                                        |
| 392 | 392 | userdate($bbbsession['closingtime']);  | 
                                                        
| 393 | 393 | }  | 
                                                        
| 394 | 394 | $jsvars += array(  | 
                                                        
@@ -405,7 +405,7 @@ discard block  | 
                                                    ||
| 405 | 405 | $output .= $OUTPUT->box_end();  | 
                                                        
| 406 | 406 | // Action button box.  | 
                                                        
| 407 | 407 |      $output .= $OUTPUT->box_start('generalbox boxaligncenter', 'bigbluebuttonbn_view_action_button_box'); | 
                                                        
| 408 | - $output .= '<br><br><span id="join_button"></span> <span id="end_button"></span>'."\n";  | 
                                                        |
| 408 | + $output .= '<br><br><span id="join_button"></span> <span id="end_button"></span>' . "\n";  | 
                                                        |
| 409 | 409 | $output .= $OUTPUT->box_end();  | 
                                                        
| 410 | 410 |      if ($activity == 'ended') { | 
                                                        
| 411 | 411 | $output .= bigbluebuttonbn_view_ended($bbbsession);  | 
                                                        
@@ -454,7 +454,7 @@ discard block  | 
                                                    ||
| 454 | 454 | // If there are meetings with recordings load the data to the table.  | 
                                                        
| 455 | 455 |      if ($bbbsession['bigbluebuttonbn']->recordings_html) { | 
                                                        
| 456 | 456 | // Render a plain html table.  | 
                                                        
| 457 | - return bigbluebuttonbn_output_recording_table($bbbsession, $recordings)."\n";  | 
                                                        |
| 457 | + return bigbluebuttonbn_output_recording_table($bbbsession, $recordings) . "\n";  | 
                                                        |
| 458 | 458 | }  | 
                                                        
| 459 | 459 | // JavaScript variables for recordings with YUI.  | 
                                                        
| 460 | 460 | $jsvars += array(  | 
                                                        
@@ -482,8 +482,8 @@ discard block  | 
                                                    ||
| 482 | 482 |          array('type' => 'button', | 
                                                        
| 483 | 483 |                'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'), | 
                                                        
| 484 | 484 | 'class' => 'btn btn-secondary',  | 
                                                        
| 485 | - 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='.  | 
                                                        |
| 486 | - $bbbsession['bigbluebuttonbn']->id.'\''));  | 
                                                        |
| 485 | + 'onclick' => 'window.location=\'' . $CFG->wwwroot . '/mod/bigbluebuttonbn/import_view.php?bn=' .  | 
                                                        |
| 486 | + $bbbsession['bigbluebuttonbn']->id . '\''));  | 
                                                        |
| 487 | 487 |      $output  = html_writer::empty_tag('br'); | 
                                                        
| 488 | 488 |      $output .= html_writer::tag('span', $button, array('id' => 'import_recording_links_button')); | 
                                                        
| 489 | 489 |      $output .= html_writer::tag('span', '', array('id' => 'import_recording_links_table')); | 
                                                        
@@ -502,10 +502,10 @@ discard block  | 
                                                    ||
| 502 | 502 |      if (!is_null($bbbsession['presentation']['url'])) { | 
                                                        
| 503 | 503 |          $attributes = array('title' => $bbbsession['presentation']['name']); | 
                                                        
| 504 | 504 | $icon = new pix_icon($bbbsession['presentation']['icon'], $bbbsession['presentation']['mimetype_description']);  | 
                                                        
| 505 | -        return '<h4>'.get_string('view_section_title_presentation', 'bigbluebuttonbn').'</h4>'. | 
                                                        |
| 506 | - $OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false).  | 
                                                        |
| 505 | +        return '<h4>' . get_string('view_section_title_presentation', 'bigbluebuttonbn') . '</h4>' . | 
                                                        |
| 506 | + $OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false) .  | 
                                                        |
| 507 | 507 | $OUTPUT->action_link($bbbsession['presentation']['url'],  | 
                                                        
| 508 | - $bbbsession['presentation']['name'], null, $attributes).'<br><br>';  | 
                                                        |
| 508 | + $bbbsession['presentation']['name'], null, $attributes) . '<br><br>';  | 
                                                        |
| 509 | 509 | }  | 
                                                        
| 510 | 510 | return '';  | 
                                                        
| 511 | 511 | }  | 
                                                        
@@ -80,7 +80,7 @@  | 
                                                    ||
| 80 | 80 | 'objectid' => $this->objectid,  | 
                                                        
| 81 | 81 | 'contextinstanceid' => $this->contextinstanceid,  | 
                                                        
| 82 | 82 | 'other' => $this->other  | 
                                                        
| 83 | - );  | 
                                                        |
| 83 | + );  | 
                                                        |
| 84 | 84 | $string = $this->description;  | 
                                                        
| 85 | 85 |          foreach ($vars as $key => $value) { | 
                                                        
| 86 | 86 |              $string = str_replace("##" . $key, $value, $string); | 
                                                        
@@ -26,7 +26,7 @@  | 
                                                    ||
| 26 | 26 | |
| 27 | 27 |  defined('MOODLE_INTERNAL') || die(); | 
                                                        
| 28 | 28 | |
| 29 | -require_once(dirname(dirname(__FILE__)).'/locallib.php');  | 
                                                        |
| 29 | +require_once(dirname(dirname(__FILE__)) . '/locallib.php');  | 
                                                        |
| 30 | 30 | |
| 31 | 31 | /**  | 
                                                        
| 32 | 32 | * Performs data migrations and updates on upgrade.  | 
                                                        
@@ -23,8 +23,8 @@ discard block  | 
                                                    ||
| 23 | 23 | * @author Jesus Federico (jesus [at] blindsidenetworks [dt] com)  | 
                                                        
| 24 | 24 | */  | 
                                                        
| 25 | 25 | |
| 26 | -require_once(dirname(dirname(dirname(__FILE__))).'/config.php');  | 
                                                        |
| 27 | -require_once(dirname(__FILE__).'/locallib.php');  | 
                                                        |
| 26 | +require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');  | 
                                                        |
| 27 | +require_once(dirname(__FILE__) . '/locallib.php');  | 
                                                        |
| 28 | 28 | |
| 29 | 29 | use \Firebase\JWT\JWT;  | 
                                                        
| 30 | 30 | |
@@ -42,13 +42,13 @@ discard block  | 
                                                    ||
| 42 | 42 | require_login(0, false);  | 
                                                        
| 43 | 43 | |
| 44 | 44 |  if (empty($params['action'])) { | 
                                                        
| 45 | -    header('HTTP/1.0 400 Bad Request. Parameter ['.$params['action'].'] was not included'); | 
                                                        |
| 45 | +    header('HTTP/1.0 400 Bad Request. Parameter [' . $params['action'] . '] was not included'); | 
                                                        |
| 46 | 46 | return;  | 
                                                        
| 47 | 47 | }  | 
                                                        
| 48 | 48 | |
| 49 | 49 | $error = bigbluebuttonbn_broker_validate_parameters($params);  | 
                                                        
| 50 | 50 |  if (!empty($error)) { | 
                                                        
| 51 | -    header('HTTP/1.0 400 Bad Request. '.$error); | 
                                                        |
| 51 | +    header('HTTP/1.0 400 Bad Request. ' . $error); | 
                                                        |
| 52 | 52 | return;  | 
                                                        
| 53 | 53 | }  | 
                                                        
| 54 | 54 | |
@@ -132,11 +132,11 @@ discard block  | 
                                                    ||
| 132 | 132 | bigbluebuttonbn_broker_live_session_events($params, $bigbluebuttonbn, $cm);  | 
                                                        
| 133 | 133 | return;  | 
                                                        
| 134 | 134 | }  | 
                                                        
| 135 | -    header('HTTP/1.0 400 Bad request. The action '. $a . ' doesn\'t exist'); | 
                                                        |
| 135 | +    header('HTTP/1.0 400 Bad request. The action ' . $a . ' doesn\'t exist'); | 
                                                        |
| 136 | 136 | return;  | 
                                                        
| 137 | 137 | |
| 138 | 138 |  } catch (Exception $e) { | 
                                                        
| 139 | -    header('HTTP/1.0 500 Internal Server Error. '.$e->getMessage()); | 
                                                        |
| 139 | +    header('HTTP/1.0 500 Internal Server Error. ' . $e->getMessage()); | 
                                                        |
| 140 | 140 | return;  | 
                                                        
| 141 | 141 | }  | 
                                                        
| 142 | 142 | |
@@ -322,7 +322,7 @@ discard block  | 
                                                    ||
| 322 | 322 |  function bigbluebuttonbn_broker_recording_info_current($recording, $params) { | 
                                                        
| 323 | 323 | $callbackresponse['status'] = true;  | 
                                                        
| 324 | 324 | $callbackresponse['found'] = true;  | 
                                                        
| 325 | - $callbackresponse['published'] = (string) $recording['published'];  | 
                                                        |
| 325 | + $callbackresponse['published'] = (string)$recording['published'];  | 
                                                        |
| 326 | 326 |      if (!isset($params['meta']) || empty($params['meta'])) { | 
                                                        
| 327 | 327 | return $callbackresponse;  | 
                                                        
| 328 | 328 | }  | 
                                                        
@@ -650,8 +650,8 @@ discard block  | 
                                                    ||
| 650 | 650 | $decodedparameters = JWT::decode($params['signed_parameters'],  | 
                                                        
| 651 | 651 |              \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256')); | 
                                                        
| 652 | 652 |      } catch (Exception $e) { | 
                                                        
| 653 | - $error = 'Caught exception: '.$e->getMessage();  | 
                                                        |
| 654 | -        header('HTTP/1.0 400 Bad Request. '.$error); | 
                                                        |
| 653 | + $error = 'Caught exception: ' . $e->getMessage();  | 
                                                        |
| 654 | +        header('HTTP/1.0 400 Bad Request. ' . $error); | 
                                                        |
| 655 | 655 | return;  | 
                                                        
| 656 | 656 | }  | 
                                                        
| 657 | 657 | // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received.  | 
                                                        
@@ -667,8 +667,8 @@ discard block  | 
                                                    ||
| 667 | 667 | bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn);  | 
                                                        
| 668 | 668 |          header('HTTP/1.0 202 Accepted'); | 
                                                        
| 669 | 669 |      } catch (Exception $e) { | 
                                                        
| 670 | - $error = 'Caught exception: '.$e->getMessage();  | 
                                                        |
| 671 | -        header('HTTP/1.0 503 Service Unavailable. '.$error); | 
                                                        |
| 670 | + $error = 'Caught exception: ' . $e->getMessage();  | 
                                                        |
| 671 | +        header('HTTP/1.0 503 Service Unavailable. ' . $error); | 
                                                        |
| 672 | 672 | }  | 
                                                        
| 673 | 673 | }  | 
                                                        
| 674 | 674 | |
@@ -689,13 +689,13 @@ discard block  | 
                                                    ||
| 689 | 689 | $importrecordings = $SESSION->bigbluebuttonbn_importrecordings;  | 
                                                        
| 690 | 690 |      if (!isset($importrecordings[$params['id']])) { | 
                                                        
| 691 | 691 |          $error = "Recording {$params['id']} could not be found. It can not be imported"; | 
                                                        
| 692 | -        header('HTTP/1.0 404 Not found. '.$error); | 
                                                        |
| 692 | +        header('HTTP/1.0 404 Not found. ' . $error); | 
                                                        |
| 693 | 693 | return;  | 
                                                        
| 694 | 694 | }  | 
                                                        
| 695 | 695 |      $callbackresponse = array('status' => true); | 
                                                        
| 696 | 696 | $importrecordings[$params['id']]['imported'] = true;  | 
                                                        
| 697 | 697 |      $overrides = array('meetingid' => $importrecordings[$params['id']]['meetingID']); | 
                                                        
| 698 | -    $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}'; | 
                                                        |
| 698 | +    $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}'; | 
                                                        |
| 699 | 699 | bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta);  | 
                                                        
| 700 | 700 | // Moodle event logger: Create an event for recording imported.  | 
                                                        
| 701 | 701 |      if (isset($bbbsession['bigbluebutton']) && isset($bbbsession['cm'])) { | 
                                                        
@@ -721,8 +721,8 @@ discard block  | 
                                                    ||
| 721 | 721 | $decodedparameters = JWT::decode($params['signed_parameters'],  | 
                                                        
| 722 | 722 |              \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256')); | 
                                                        
| 723 | 723 |      } catch (Exception $e) { | 
                                                        
| 724 | - $error = 'Caught exception: '.$e->getMessage();  | 
                                                        |
| 725 | -        header('HTTP/1.0 400 Bad Request. '.$error); | 
                                                        |
| 724 | + $error = 'Caught exception: ' . $e->getMessage();  | 
                                                        |
| 725 | +        header('HTTP/1.0 400 Bad Request. ' . $error); | 
                                                        |
| 726 | 726 | return;  | 
                                                        
| 727 | 727 | }  | 
                                                        
| 728 | 728 | // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received.  | 
                                                        
@@ -763,7 +763,7 @@ discard block  | 
                                                    ||
| 763 | 763 | }  | 
                                                        
| 764 | 764 | $action = strtolower($params['action']);  | 
                                                        
| 765 | 765 |      if (!array_key_exists($action, $requiredparams)) { | 
                                                        
| 766 | - return 'Action '.$params['action'].' can not be performed.';  | 
                                                        |
| 766 | + return 'Action ' . $params['action'] . ' can not be performed.';  | 
                                                        |
| 767 | 767 | }  | 
                                                        
| 768 | 768 | return bigbluebuttonbn_broker_validate_parameters_message($params, $requiredparams[$action]);  | 
                                                        
| 769 | 769 | }  | 
                                                        
@@ -262,7 +262,7 @@ discard block  | 
                                                    ||
| 262 | 262 | * Helper function to retrieve imported recordings from the Moodle database.  | 
                                                        
| 263 | 263 | * The references are stored as events in bigbluebuttonbn_logs.  | 
                                                        
| 264 | 264 | *  | 
                                                        
| 265 | - * @param string $courseid  | 
                                                        |
| 265 | + * @param integer $courseid  | 
                                                        |
| 266 | 266 | * @param string $bigbluebuttonbnid  | 
                                                        
| 267 | 267 | * @param bool $subset  | 
                                                        
| 268 | 268 | *  | 
                                                        
@@ -290,7 +290,7 @@ discard block  | 
                                                    ||
| 290 | 290 | /**  | 
                                                        
| 291 | 291 | * Helper function to retrive the default config.xml file.  | 
                                                        
| 292 | 292 | *  | 
                                                        
| 293 | - * @return string  | 
                                                        |
| 293 | + * @return null|SimpleXMLElement  | 
                                                        |
| 294 | 294 | */  | 
                                                        
| 295 | 295 |  function bigbluebuttonbn_get_default_config_xml() { | 
                                                        
| 296 | 296 | $xml = bigbluebuttonbn_wrap_xml_load_file(  | 
                                                        
@@ -372,7 +372,7 @@ discard block  | 
                                                    ||
| 372 | 372 | * @param object $a  | 
                                                        
| 373 | 373 | * @param object $b  | 
                                                        
| 374 | 374 | *  | 
                                                        
| 375 | - * @return array  | 
                                                        |
| 375 | + * @return integer  | 
                                                        |
| 376 | 376 | */  | 
                                                        
| 377 | 377 |  function bigbluebuttonbn_recording_build_sorter($a, $b) { | 
                                                        
| 378 | 378 |      if ($a['startTime'] < $b['startTime']) { | 
                                                        
@@ -498,7 +498,7 @@ discard block  | 
                                                    ||
| 498 | 498 | * @param string $data  | 
                                                        
| 499 | 499 | * @param string $contenttype  | 
                                                        
| 500 | 500 | *  | 
                                                        
| 501 | - * @return object  | 
                                                        |
| 501 | + * @return null|SimpleXMLElement  | 
                                                        |
| 502 | 502 | */  | 
                                                        
| 503 | 503 |  function bigbluebuttonbn_wrap_xml_load_file($url, $method = 'GET', $data = null, $contenttype = 'text/xml') { | 
                                                        
| 504 | 504 |      if (extension_loaded('curl')) { | 
                                                        
@@ -539,7 +539,7 @@ discard block  | 
                                                    ||
| 539 | 539 | * @param string $data  | 
                                                        
| 540 | 540 | * @param string $contenttype  | 
                                                        
| 541 | 541 | *  | 
                                                        
| 542 | - * @return object  | 
                                                        |
| 542 | + * @return string  | 
                                                        |
| 543 | 543 | */  | 
                                                        
| 544 | 544 |  function bigbluebuttonbn_wrap_xml_load_file_curl_request($url, $method = 'GET', $data = null, $contenttype = 'text/xml') { | 
                                                        
| 545 | 545 | $c = new curl();  | 
                                                        
@@ -904,7 +904,7 @@ discard block  | 
                                                    ||
| 904 | 904 | * @param integer $instance  | 
                                                        
| 905 | 905 | * @param integer $voicebridge  | 
                                                        
| 906 | 906 | *  | 
                                                        
| 907 | - * @return string  | 
                                                        |
| 907 | + * @return boolean  | 
                                                        |
| 908 | 908 | */  | 
                                                        
| 909 | 909 |  function bigbluebuttonbn_voicebridge_unique($instance, $voicebridge) { | 
                                                        
| 910 | 910 | global $DB;  | 
                                                        
@@ -1170,7 +1170,7 @@ discard block  | 
                                                    ||
| 1170 | 1170 | * @param string $meetingid  | 
                                                        
| 1171 | 1171 | * @param string $configxml  | 
                                                        
| 1172 | 1172 | *  | 
                                                        
| 1173 | - * @return object  | 
                                                        |
| 1173 | + * @return null|SimpleXMLElement  | 
                                                        |
| 1174 | 1174 | */  | 
                                                        
| 1175 | 1175 |  function bigbluebuttonbn_set_config_xml($meetingid, $configxml) { | 
                                                        
| 1176 | 1176 |      $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?'; | 
                                                        
@@ -1219,7 +1219,7 @@ discard block  | 
                                                    ||
| 1219 | 1219 | * @param array $recording  | 
                                                        
| 1220 | 1220 | * @param array $tools  | 
                                                        
| 1221 | 1221 | *  | 
                                                        
| 1222 | - * @return array  | 
                                                        |
| 1222 | + * @return null|stdClass  | 
                                                        |
| 1223 | 1223 | */  | 
                                                        
| 1224 | 1224 |  function bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools = ['protect', 'publish', 'delete']) { | 
                                                        
| 1225 | 1225 |      if (!bigbluebuttonbn_include_recording_table_row($bbbsession, $recording)) { | 
                                                        
@@ -1723,7 +1723,7 @@ discard block  | 
                                                    ||
| 1723 | 1723 | *  | 
                                                        
| 1724 | 1724 | * @param array $bbbsession  | 
                                                        
| 1725 | 1725 | * @param array $recording  | 
                                                        
| 1726 | - * @param object $rowdata  | 
                                                        |
| 1726 | + * @param stdClass $rowdata  | 
                                                        |
| 1727 | 1727 | *  | 
                                                        
| 1728 | 1728 | * @return object  | 
                                                        
| 1729 | 1729 | */  | 
                                                        
@@ -1918,7 +1918,7 @@ discard block  | 
                                                    ||
| 1918 | 1918 | * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included  | 
                                                        
| 1919 | 1919 | * in the getRecordings request considering only those that belong to deleted activities.  | 
                                                        
| 1920 | 1920 | *  | 
                                                        
| 1921 | - * @param string $courseid  | 
                                                        |
| 1921 | + * @param integer $courseid  | 
                                                        |
| 1922 | 1922 | * @param string $bigbluebuttonbnid  | 
                                                        
| 1923 | 1923 | * @param bool $subset  | 
                                                        
| 1924 | 1924 | *  | 
                                                        
@@ -1942,7 +1942,7 @@ discard block  | 
                                                    ||
| 1942 | 1942 | * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included  | 
                                                        
| 1943 | 1943 | * in the getRecordings request considering only those that belong to imported recordings.  | 
                                                        
| 1944 | 1944 | *  | 
                                                        
| 1945 | - * @param string $courseid  | 
                                                        |
| 1945 | + * @param integer $courseid  | 
                                                        |
| 1946 | 1946 | * @param string $bigbluebuttonbnid  | 
                                                        
| 1947 | 1947 | * @param bool $subset  | 
                                                        
| 1948 | 1948 | *  | 
                                                        
@@ -1965,7 +1965,7 @@ discard block  | 
                                                    ||
| 1965 | 1965 | /**  | 
                                                        
| 1966 | 1966 | * Helper function to get recordings and imported recordings together.  | 
                                                        
| 1967 | 1967 | *  | 
                                                        
| 1968 | - * @param string $courseid  | 
                                                        |
| 1968 | + * @param integer $courseid  | 
                                                        |
| 1969 | 1969 | * @param string $bigbluebuttonbnid  | 
                                                        
| 1970 | 1970 | * @param bool $subset  | 
                                                        
| 1971 | 1971 | * @param bool $includedeleted  | 
                                                        
@@ -1983,7 +1983,7 @@ discard block  | 
                                                    ||
| 1983 | 1983 | * Helper function to retrieve recordings from the BigBlueButton. The references are stored as events  | 
                                                        
| 1984 | 1984 | * in bigbluebuttonbn_logs.  | 
                                                        
| 1985 | 1985 | *  | 
                                                        
| 1986 | - * @param string $courseid  | 
                                                        |
| 1986 | + * @param integer $courseid  | 
                                                        |
| 1987 | 1987 | * @param string $bigbluebuttonbnid  | 
                                                        
| 1988 | 1988 | * @param bool $subset  | 
                                                        
| 1989 | 1989 | * @param bool $includedeleted  | 
                                                        
@@ -89,9 +89,9 @@ discard block  | 
                                                    ||
| 89 | 89 | */  | 
                                                        
| 90 | 90 |  function bigbluebuttonbn_get_join_url($meetingid, $username, $pw, $logouturl, $configtoken = null, $userid = null) { | 
                                                        
| 91 | 91 | $data = ['meetingID' => $meetingid,  | 
                                                        
| 92 | - 'fullName' => $username,  | 
                                                        |
| 93 | - 'password' => $pw,  | 
                                                        |
| 94 | - 'logoutURL' => $logouturl,  | 
                                                        |
| 92 | + 'fullName' => $username,  | 
                                                        |
| 93 | + 'password' => $pw,  | 
                                                        |
| 94 | + 'logoutURL' => $logouturl,  | 
                                                        |
| 95 | 95 | ];  | 
                                                        
| 96 | 96 |      if (!is_null($configtoken)) { | 
                                                        
| 97 | 97 | $data['configToken'] = $configtoken;  | 
                                                        
@@ -143,23 +143,23 @@ discard block  | 
                                                    ||
| 143 | 143 |  function bigbluebuttonbn_get_meeting_info_array($meetingid) { | 
                                                        
| 144 | 144 | $xml = bigbluebuttonbn_wrap_xml_load_file(  | 
                                                        
| 145 | 145 |          \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) | 
                                                        
| 146 | - );  | 
                                                        |
| 146 | + );  | 
                                                        |
| 147 | 147 |      if ($xml && $xml->returncode == 'SUCCESS' && empty($xml->messageKey)) { | 
                                                        
| 148 | 148 | // Meeting info was returned.  | 
                                                        
| 149 | 149 |          return array('returncode' => $xml->returncode, | 
                                                        
| 150 | - 'meetingID' => $xml->meetingID,  | 
                                                        |
| 151 | - 'moderatorPW' => $xml->moderatorPW,  | 
                                                        |
| 152 | - 'attendeePW' => $xml->attendeePW,  | 
                                                        |
| 153 | - 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded,  | 
                                                        |
| 154 | - 'running' => $xml->running,  | 
                                                        |
| 155 | - 'recording' => $xml->recording,  | 
                                                        |
| 156 | - 'startTime' => $xml->startTime,  | 
                                                        |
| 157 | - 'endTime' => $xml->endTime,  | 
                                                        |
| 158 | - 'participantCount' => $xml->participantCount,  | 
                                                        |
| 159 | - 'moderatorCount' => $xml->moderatorCount,  | 
                                                        |
| 160 | - 'attendees' => $xml->attendees,  | 
                                                        |
| 161 | - 'metadata' => $xml->metadata,  | 
                                                        |
| 162 | - );  | 
                                                        |
| 150 | + 'meetingID' => $xml->meetingID,  | 
                                                        |
| 151 | + 'moderatorPW' => $xml->moderatorPW,  | 
                                                        |
| 152 | + 'attendeePW' => $xml->attendeePW,  | 
                                                        |
| 153 | + 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded,  | 
                                                        |
| 154 | + 'running' => $xml->running,  | 
                                                        |
| 155 | + 'recording' => $xml->recording,  | 
                                                        |
| 156 | + 'startTime' => $xml->startTime,  | 
                                                        |
| 157 | + 'endTime' => $xml->endTime,  | 
                                                        |
| 158 | + 'participantCount' => $xml->participantCount,  | 
                                                        |
| 159 | + 'moderatorCount' => $xml->moderatorCount,  | 
                                                        |
| 160 | + 'attendees' => $xml->attendees,  | 
                                                        |
| 161 | + 'metadata' => $xml->metadata,  | 
                                                        |
| 162 | + );  | 
                                                        |
| 163 | 163 | }  | 
                                                        
| 164 | 164 |      if ($xml) { | 
                                                        
| 165 | 165 | // Either failure or success without meeting info.  | 
                                                        
@@ -295,7 +295,7 @@ discard block  | 
                                                    ||
| 295 | 295 |  function bigbluebuttonbn_get_default_config_xml() { | 
                                                        
| 296 | 296 | $xml = bigbluebuttonbn_wrap_xml_load_file(  | 
                                                        
| 297 | 297 |          \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getDefaultConfigXML') | 
                                                        
| 298 | - );  | 
                                                        |
| 298 | + );  | 
                                                        |
| 299 | 299 | return $xml;  | 
                                                        
| 300 | 300 | }  | 
                                                        
| 301 | 301 | |
@@ -396,7 +396,7 @@ discard block  | 
                                                    ||
| 396 | 396 |      foreach ($ids as $id) { | 
                                                        
| 397 | 397 | $xml = bigbluebuttonbn_wrap_xml_load_file(  | 
                                                        
| 398 | 398 |              \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('deleteRecordings', ['recordID' => $id]) | 
                                                        
| 399 | - );  | 
                                                        |
| 399 | + );  | 
                                                        |
| 400 | 400 |          if ($xml && $xml->returncode != 'SUCCESS') { | 
                                                        
| 401 | 401 | return false;  | 
                                                        
| 402 | 402 | }  | 
                                                        
@@ -415,7 +415,7 @@ discard block  | 
                                                    ||
| 415 | 415 |      foreach ($ids as $id) { | 
                                                        
| 416 | 416 | $xml = bigbluebuttonbn_wrap_xml_load_file(  | 
                                                        
| 417 | 417 |              \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('publishRecordings', ['recordID' => $id, 'publish' => $publish]) | 
                                                        
| 418 | - );  | 
                                                        |
| 418 | + );  | 
                                                        |
| 419 | 419 |          if ($xml && $xml->returncode != 'SUCCESS') { | 
                                                        
| 420 | 420 | return false;  | 
                                                        
| 421 | 421 | }  | 
                                                        
@@ -434,7 +434,7 @@ discard block  | 
                                                    ||
| 434 | 434 |      foreach ($ids as $id) { | 
                                                        
| 435 | 435 | $xml = bigbluebuttonbn_wrap_xml_load_file(  | 
                                                        
| 436 | 436 |              \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params) | 
                                                        
| 437 | - );  | 
                                                        |
| 437 | + );  | 
                                                        |
| 438 | 438 |          if ($xml && $xml->returncode != 'SUCCESS') { | 
                                                        
| 439 | 439 | return false;  | 
                                                        
| 440 | 440 | }  | 
                                                        
@@ -451,7 +451,7 @@ discard block  | 
                                                    ||
| 451 | 451 |  function bigbluebuttonbn_end_meeting($meetingid, $modpw) { | 
                                                        
| 452 | 452 | $xml = bigbluebuttonbn_wrap_xml_load_file(  | 
                                                        
| 453 | 453 |          \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('end', ['meetingID' => $meetingid, 'password' => $modpw]) | 
                                                        
| 454 | - );  | 
                                                        |
| 454 | + );  | 
                                                        |
| 455 | 455 |      if ($xml) { | 
                                                        
| 456 | 456 | // If the xml packet returned failure it displays the message to the user.  | 
                                                        
| 457 | 457 |          return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); | 
                                                        
@@ -471,7 +471,7 @@ discard block  | 
                                                    ||
| 471 | 471 | */  | 
                                                        
| 472 | 472 | $xml = bigbluebuttonbn_wrap_xml_load_file(  | 
                                                        
| 473 | 473 |          \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) | 
                                                        
| 474 | - );  | 
                                                        |
| 474 | + );  | 
                                                        |
| 475 | 475 | return ($xml && $xml->returncode == 'SUCCESS');  | 
                                                        
| 476 | 476 | }  | 
                                                        
| 477 | 477 | |
@@ -483,7 +483,7 @@ discard block  | 
                                                    ||
| 483 | 483 |  function bigbluebuttonbn_get_server_version() { | 
                                                        
| 484 | 484 | $xml = bigbluebuttonbn_wrap_xml_load_file(  | 
                                                        
| 485 | 485 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url()  | 
                                                        
| 486 | - );  | 
                                                        |
| 486 | + );  | 
                                                        |
| 487 | 487 |      if ($xml && $xml->returncode == 'SUCCESS') { | 
                                                        
| 488 | 488 | return $xml->version;  | 
                                                        
| 489 | 489 | }  | 
                                                        
@@ -551,10 +551,10 @@ discard block  | 
                                                    ||
| 551 | 551 | |
| 552 | 552 | $options = array();  | 
                                                        
| 553 | 553 | $options['CURLOPT_HTTPHEADER'] = array(  | 
                                                        
| 554 | - 'Content-Type: '.$contenttype,  | 
                                                        |
| 555 | - 'Content-Length: '.strlen($data),  | 
                                                        |
| 556 | - 'Content-Language: en-US',  | 
                                                        |
| 557 | - );  | 
                                                        |
| 554 | + 'Content-Type: '.$contenttype,  | 
                                                        |
| 555 | + 'Content-Length: '.strlen($data),  | 
                                                        |
| 556 | + 'Content-Language: en-US',  | 
                                                        |
| 557 | + );  | 
                                                        |
| 558 | 558 | |
| 559 | 559 | return $c->post($url, $data, $options);  | 
                                                        
| 560 | 560 | }  | 
                                                        
@@ -697,16 +697,16 @@ discard block  | 
                                                    ||
| 697 | 697 | 'all' => array(  | 
                                                        
| 698 | 698 |              'name' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'), | 
                                                        
| 699 | 699 | 'children' => []  | 
                                                        
| 700 | - )  | 
                                                        |
| 701 | - );  | 
                                                        |
| 700 | + )  | 
                                                        |
| 701 | + );  | 
                                                        |
| 702 | 702 | $data['role'] = array(  | 
                                                        
| 703 | 703 |          'name' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'), | 
                                                        
| 704 | 704 | 'children' => bigbluebuttonbn_get_roles_select($context)  | 
                                                        
| 705 | - );  | 
                                                        |
| 705 | + );  | 
                                                        |
| 706 | 706 | $data['user'] = array(  | 
                                                        
| 707 | 707 |          'name' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'), | 
                                                        
| 708 | 708 | 'children' => bigbluebuttonbn_get_users_select($context)  | 
                                                        
| 709 | - );  | 
                                                        |
| 709 | + );  | 
                                                        |
| 710 | 710 | return $data;  | 
                                                        
| 711 | 711 | }  | 
                                                        
| 712 | 712 | |
@@ -751,9 +751,9 @@ discard block  | 
                                                    ||
| 751 | 751 | continue;  | 
                                                        
| 752 | 752 | }  | 
                                                        
| 753 | 753 | $participantlistarray[] = array(  | 
                                                        
| 754 | - 'selectiontype' => 'role',  | 
                                                        |
| 755 | - 'selectionid' => $moderatordefault,  | 
                                                        |
| 756 | - 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);  | 
                                                        |
| 754 | + 'selectiontype' => 'role',  | 
                                                        |
| 755 | + 'selectionid' => $moderatordefault,  | 
                                                        |
| 756 | + 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);  | 
                                                        |
| 757 | 757 | }  | 
                                                        
| 758 | 758 | return $participantlistarray;  | 
                                                        
| 759 | 759 | }  | 
                                                        
@@ -796,11 +796,11 @@ discard block  | 
                                                    ||
| 796 | 796 |              'all' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'), | 
                                                        
| 797 | 797 |              'role' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'), | 
                                                        
| 798 | 798 |              'user' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'), | 
                                                        
| 799 | - ],  | 
                                                        |
| 799 | + ],  | 
                                                        |
| 800 | 800 | 'type_selected' => 'all',  | 
                                                        
| 801 | 801 | 'options' => ['all' => '---------------'],  | 
                                                        
| 802 | 802 | 'selected' => 'all',  | 
                                                        
| 803 | - ];  | 
                                                        |
| 803 | + ];  | 
                                                        |
| 804 | 804 | }  | 
                                                        
| 805 | 805 | |
| 806 | 806 | /**  | 
                                                        
@@ -1080,7 +1080,7 @@ discard block  | 
                                                    ||
| 1080 | 1080 | // Ping again and refresh the cache.  | 
                                                        
| 1081 | 1081 | $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(  | 
                                                        
| 1082 | 1082 |          \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) | 
                                                        
| 1083 | - );  | 
                                                        |
| 1083 | + );  | 
                                                        |
| 1084 | 1084 |      $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); | 
                                                        
| 1085 | 1085 | return $meetinginfo;  | 
                                                        
| 1086 | 1086 | }  | 
                                                        
@@ -1450,8 +1450,8 @@ discard block  | 
                                                    ||
| 1450 | 1450 | }  | 
                                                        
| 1451 | 1451 | $id = 'playbacks-'.$recording['recordID'];  | 
                                                        
| 1452 | 1452 |      $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported, | 
                                                        
| 1453 | - 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],  | 
                                                        |
| 1454 | - 'title' => $title, $visibility => $visibility));  | 
                                                        |
| 1453 | + 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],  | 
                                                        |
| 1454 | + 'title' => $title, $visibility => $visibility));  | 
                                                        |
| 1455 | 1455 |      foreach ($recording['playbacks'] as $playback) { | 
                                                        
| 1456 | 1456 | $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bbbsession, $playback);  | 
                                                        
| 1457 | 1457 | }  | 
                                                        
@@ -1476,7 +1476,7 @@ discard block  | 
                                                    ||
| 1476 | 1476 |      $title = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'); | 
                                                        
| 1477 | 1477 | $onclick = 'M.mod_bigbluebuttonbn.recordings.recordingPlay(this);';  | 
                                                        
| 1478 | 1478 | $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bbbsession['bigbluebuttonbn']->id .  | 
                                                        
| 1479 | - '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type'];  | 
                                                        |
| 1479 | + '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type'];  | 
                                                        |
| 1480 | 1480 |      if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') { | 
                                                        
| 1481 | 1481 | $href .= '&href='.urlencode(trim($playback['url']));  | 
                                                        
| 1482 | 1482 | }  | 
                                                        
@@ -1488,7 +1488,7 @@ discard block  | 
                                                    ||
| 1488 | 1488 | 'data-target' => $playback['type'],  | 
                                                        
| 1489 | 1489 | 'data-href' => $href,  | 
                                                        
| 1490 | 1490 | 'class' => 'btn btn-sm btn-default'  | 
                                                        
| 1491 | - );  | 
                                                        |
| 1491 | + );  | 
                                                        |
| 1492 | 1492 |      return $OUTPUT->action_link('#', $title, null, $linkattributes) . ' '; | 
                                                        
| 1493 | 1493 | }  | 
                                                        
| 1494 | 1494 | |
@@ -1602,10 +1602,10 @@ discard block  | 
                                                    ||
| 1602 | 1602 | 'id' => $id,  | 
                                                        
| 1603 | 1603 | 'onclick' => $onclick,  | 
                                                        
| 1604 | 1604 | 'data-action' => $data['action']  | 
                                                        
| 1605 | - );  | 
                                                        |
| 1605 | + );  | 
                                                        |
| 1606 | 1606 |          if (!isset($recording['imported'])) { | 
                                                        
| 1607 | 1607 | $linkattributes['data-links'] = bigbluebuttonbn_count_recording_imported_instances(  | 
                                                        
| 1608 | - $recording['recordID']);  | 
                                                        |
| 1608 | + $recording['recordID']);  | 
                                                        |
| 1609 | 1609 | }  | 
                                                        
| 1610 | 1610 |          if (isset($data['disabled'])) { | 
                                                        
| 1611 | 1611 | $iconattributes['class'] .= ' fa-' . $data['disabled'];  | 
                                                        
@@ -2146,8 +2146,8 @@ discard block  | 
                                                    ||
| 2146 | 2146 | $activitytime = '';  | 
                                                        
| 2147 | 2147 |      if ($time) { | 
                                                        
| 2148 | 2148 | $activitytime = calendar_day_representation($time).' '.  | 
                                                        
| 2149 | -          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. | 
                                                        |
| 2150 | - calendar_time_representation($time);  | 
                                                        |
| 2149 | +            get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. | 
                                                        |
| 2150 | + calendar_time_representation($time);  | 
                                                        |
| 2151 | 2151 | }  | 
                                                        
| 2152 | 2152 | return $activitytime;  | 
                                                        
| 2153 | 2153 | }  | 
                                                        
@@ -2447,7 +2447,7 @@ discard block  | 
                                                    ||
| 2447 | 2447 |          $renderer->render_group_element('participant_moderator_default', | 
                                                        
| 2448 | 2448 |              $renderer->render_group_element_configmultiselect('participant_moderator_default', | 
                                                        
| 2449 | 2449 | array_keys($owner), array_merge($owner, $roles))  | 
                                                        
| 2450 | - );  | 
                                                        |
| 2450 | + );  | 
                                                        |
| 2451 | 2451 | }  | 
                                                        
| 2452 | 2452 | }  | 
                                                        
| 2453 | 2453 | |
@@ -2547,7 +2547,7 @@ discard block  | 
                                                    ||
| 2547 | 2547 | return $output;  | 
                                                        
| 2548 | 2548 | }  | 
                                                        
| 2549 | 2549 |      $output .= $OUTPUT->box_start('box boxalignleft adminerror alert alert-' . $type . ' alert-block fade in', | 
                                                        
| 2550 | - 'bigbluebuttonbn_view_general_warning') . "\n";  | 
                                                        |
| 2550 | + 'bigbluebuttonbn_view_general_warning') . "\n";  | 
                                                        |
| 2551 | 2551 | $output .= ' ' . $message . "\n";  | 
                                                        
| 2552 | 2552 | $output .= ' <div class="singlebutton pull-right">' . "\n";  | 
                                                        
| 2553 | 2553 |      if (!empty($href)) { | 
                                                        
@@ -28,7 +28,7 @@ discard block  | 
                                                    ||
| 28 | 28 | |
| 29 | 29 | global $CFG;  | 
                                                        
| 30 | 30 | |
| 31 | -require_once(dirname(__FILE__).'/lib.php');  | 
                                                        |
| 31 | +require_once(dirname(__FILE__) . '/lib.php');  | 
                                                        |
| 32 | 32 | |
| 33 | 33 | /** @var BIGBLUEBUTTONBN_UPDATE_CACHE boolean set to true indicates that cache has to be updated */  | 
                                                        
| 34 | 34 | const BIGBLUEBUTTONBN_UPDATE_CACHE = true;  | 
                                                        
@@ -70,7 +70,7 @@ discard block  | 
                                                    ||
| 70 | 70 |      if (isset($meta)) { | 
                                                        
| 71 | 71 | $log->meta = $meta;  | 
                                                        
| 72 | 72 |      } else if ($event == BIGBLUEBUTTONBN_LOG_EVENT_CREATE) { | 
                                                        
| 73 | -        $log->meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}'; | 
                                                        |
| 73 | +        $log->meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}'; | 
                                                        |
| 74 | 74 | }  | 
                                                        
| 75 | 75 |      $DB->insert_record('bigbluebuttonbn_logs', $log); | 
                                                        
| 76 | 76 | }  | 
                                                        
@@ -118,8 +118,8 @@ discard block  | 
                                                    ||
| 118 | 118 | $data = null;  | 
                                                        
| 119 | 119 |      if (!is_null($pname) && !is_null($purl)) { | 
                                                        
| 120 | 120 | $method = 'POST';  | 
                                                        
| 121 | - $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='".  | 
                                                        |
| 122 | - $purl."' /></module></modules>";  | 
                                                        |
| 121 | + $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='" .  | 
                                                        |
| 122 | + $purl . "' /></module></modules>";  | 
                                                        |
| 123 | 123 | }  | 
                                                        
| 124 | 124 | $xml = bigbluebuttonbn_wrap_xml_load_file($createmeetingurl, $method, $data);  | 
                                                        
| 125 | 125 |      if ($xml) { | 
                                                        
@@ -280,7 +280,7 @@ discard block  | 
                                                    ||
| 280 | 280 | // Override imported flag with actual ID.  | 
                                                        
| 281 | 281 | $recording['imported'] = $recordimported->id;  | 
                                                        
| 282 | 282 |          if (isset($recordimported->protected)) { | 
                                                        
| 283 | - $recording['protected'] = (string) $recordimported->protected;  | 
                                                        |
| 283 | + $recording['protected'] = (string)$recordimported->protected;  | 
                                                        |
| 284 | 284 | }  | 
                                                        
| 285 | 285 | $recordsimportedarray[$recording['recordID']] = $recording;  | 
                                                        
| 286 | 286 | }  | 
                                                        
@@ -310,21 +310,21 @@ discard block  | 
                                                    ||
| 310 | 310 | // Add formats.  | 
                                                        
| 311 | 311 | $playbackarray = array();  | 
                                                        
| 312 | 312 |      foreach ($recording->playback->format as $format) { | 
                                                        
| 313 | -        $playbackarray[(string) $format->type] = array('type' => (string) $format->type, | 
                                                        |
| 314 | - 'url' => trim((string) $format->url), 'length' => (string) $format->length);  | 
                                                        |
| 313 | +        $playbackarray[(string)$format->type] = array('type' => (string)$format->type, | 
                                                        |
| 314 | + 'url' => trim((string)$format->url), 'length' => (string)$format->length);  | 
                                                        |
| 315 | 315 | // Add preview per format when existing.  | 
                                                        
| 316 | 316 |          if ($format->preview) { | 
                                                        
| 317 | - $playbackarray[(string) $format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview);  | 
                                                        |
| 317 | + $playbackarray[(string)$format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview);  | 
                                                        |
| 318 | 318 | }  | 
                                                        
| 319 | 319 | }  | 
                                                        
| 320 | 320 | // Add the metadata to the recordings array.  | 
                                                        
| 321 | 321 | $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata));  | 
                                                        
| 322 | -    $recordingarray = array('recordID' => (string) $recording->recordID, | 
                                                        |
| 323 | - 'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name,  | 
                                                        |
| 324 | - 'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime,  | 
                                                        |
| 325 | - 'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray);  | 
                                                        |
| 322 | +    $recordingarray = array('recordID' => (string)$recording->recordID, | 
                                                        |
| 323 | + 'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name,  | 
                                                        |
| 324 | + 'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime,  | 
                                                        |
| 325 | + 'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray);  | 
                                                        |
| 326 | 326 |      if (isset($recording->protected)) { | 
                                                        
| 327 | - $recordingarray['protected'] = (string) $recording->protected;  | 
                                                        |
| 327 | + $recordingarray['protected'] = (string)$recording->protected;  | 
                                                        |
| 328 | 328 | }  | 
                                                        
| 329 | 329 | return $recordingarray + $metadataarray;  | 
                                                        
| 330 | 330 | }  | 
                                                        
@@ -339,9 +339,9 @@ discard block  | 
                                                    ||
| 339 | 339 |  function bigbluebuttonbn_get_recording_preview_images($preview) { | 
                                                        
| 340 | 340 | $imagesarray = array();  | 
                                                        
| 341 | 341 |      foreach ($preview->images->image as $image) { | 
                                                        
| 342 | -        $imagearray = array('url' => trim((string) $image)); | 
                                                        |
| 342 | +        $imagearray = array('url' => trim((string)$image)); | 
                                                        |
| 343 | 343 |          foreach ($image->attributes() as $attkey => $attvalue) { | 
                                                        
| 344 | - $imagearray[$attkey] = (string) $attvalue;  | 
                                                        |
| 344 | + $imagearray[$attkey] = (string)$attvalue;  | 
                                                        |
| 345 | 345 | }  | 
                                                        
| 346 | 346 | array_push($imagesarray, $imagearray);  | 
                                                        
| 347 | 347 | }  | 
                                                        
@@ -361,7 +361,7 @@ discard block  | 
                                                    ||
| 361 | 361 |          if (is_object($value)) { | 
                                                        
| 362 | 362 | $value = '';  | 
                                                        
| 363 | 363 | }  | 
                                                        
| 364 | - $metadataarray['meta_'.$key] = $value;  | 
                                                        |
| 364 | + $metadataarray['meta_' . $key] = $value;  | 
                                                        |
| 365 | 365 | }  | 
                                                        
| 366 | 366 | return $metadataarray;  | 
                                                        
| 367 | 367 | }  | 
                                                        
@@ -433,7 +433,7 @@ discard block  | 
                                                    ||
| 433 | 433 |      $ids = explode(',', $recordids); | 
                                                        
| 434 | 434 |      foreach ($ids as $id) { | 
                                                        
| 435 | 435 | $xml = bigbluebuttonbn_wrap_xml_load_file(  | 
                                                        
| 436 | -            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params) | 
                                                        |
| 436 | +            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params) | 
                                                        |
| 437 | 437 | );  | 
                                                        
| 438 | 438 |          if ($xml && $xml->returncode != 'SUCCESS') { | 
                                                        
| 439 | 439 | return false;  | 
                                                        
@@ -513,7 +513,7 @@ discard block  | 
                                                    ||
| 513 | 513 | return $xml;  | 
                                                        
| 514 | 514 |          } catch (Exception $e) { | 
                                                        
| 515 | 515 | libxml_use_internal_errors($previous);  | 
                                                        
| 516 | - $error = 'Caught exception: '.$e->getMessage();  | 
                                                        |
| 516 | + $error = 'Caught exception: ' . $e->getMessage();  | 
                                                        |
| 517 | 517 | debugging($error, DEBUG_DEVELOPER);  | 
                                                        
| 518 | 518 | return null;  | 
                                                        
| 519 | 519 | }  | 
                                                        
@@ -524,7 +524,7 @@ discard block  | 
                                                    ||
| 524 | 524 | $response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS);  | 
                                                        
| 525 | 525 | return $response;  | 
                                                        
| 526 | 526 |      } catch (Exception $e) { | 
                                                        
| 527 | - $error = 'Caught exception: '.$e->getMessage();  | 
                                                        |
| 527 | + $error = 'Caught exception: ' . $e->getMessage();  | 
                                                        |
| 528 | 528 | debugging($error, DEBUG_DEVELOPER);  | 
                                                        
| 529 | 529 | libxml_use_internal_errors($previous);  | 
                                                        
| 530 | 530 | return null;  | 
                                                        
@@ -551,8 +551,8 @@ discard block  | 
                                                    ||
| 551 | 551 | |
| 552 | 552 | $options = array();  | 
                                                        
| 553 | 553 | $options['CURLOPT_HTTPHEADER'] = array(  | 
                                                        
| 554 | - 'Content-Type: '.$contenttype,  | 
                                                        |
| 555 | - 'Content-Length: '.strlen($data),  | 
                                                        |
| 554 | + 'Content-Type: ' . $contenttype,  | 
                                                        |
| 555 | + 'Content-Length: ' . strlen($data),  | 
                                                        |
| 556 | 556 | 'Content-Language: en-US',  | 
                                                        
| 557 | 557 | );  | 
                                                        
| 558 | 558 | |
@@ -569,7 +569,7 @@ discard block  | 
                                                    ||
| 569 | 569 | * @return void  | 
                                                        
| 570 | 570 | */  | 
                                                        
| 571 | 571 |  function bigbluebuttonbn_end_meeting_if_running($bigbluebuttonbn) { | 
                                                        
| 572 | - $meetingid = $bigbluebuttonbn->meetingid.'-'.$bigbluebuttonbn->course.'-'.$bigbluebuttonbn->id;  | 
                                                        |
| 572 | + $meetingid = $bigbluebuttonbn->meetingid . '-' . $bigbluebuttonbn->course . '-' . $bigbluebuttonbn->id;  | 
                                                        |
| 573 | 573 |      if (bigbluebuttonbn_is_meeting_running($meetingid)) { | 
                                                        
| 574 | 574 | bigbluebuttonbn_end_meeting($meetingid, $bigbluebuttonbn->moderatorpass);  | 
                                                        
| 575 | 575 | }  | 
                                                        
@@ -589,9 +589,9 @@ discard block  | 
                                                    ||
| 589 | 589 |      if ($userroles) { | 
                                                        
| 590 | 590 | $where = '';  | 
                                                        
| 591 | 591 |          foreach ($userroles as $userrole) { | 
                                                        
| 592 | - $where .= (empty($where) ? ' WHERE' : ' OR').' id=' . $userrole->roleid;  | 
                                                        |
| 592 | + $where .= (empty($where) ? ' WHERE' : ' OR') . ' id=' . $userrole->roleid;  | 
                                                        |
| 593 | 593 | }  | 
                                                        
| 594 | -        $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where); | 
                                                        |
| 594 | +        $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where); | 
                                                        |
| 595 | 595 | }  | 
                                                        
| 596 | 596 | return $userroles;  | 
                                                        
| 597 | 597 | }  | 
                                                        
@@ -614,7 +614,7 @@ discard block  | 
                                                    ||
| 614 | 614 | * @return array $users  | 
                                                        
| 615 | 615 | */  | 
                                                        
| 616 | 616 |  function bigbluebuttonbn_get_users(context $context = null) { | 
                                                        
| 617 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);  | 
                                                        |
| 617 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);  | 
                                                        |
| 618 | 618 |      foreach ($users as $key => $value) { | 
                                                        
| 619 | 619 | $users[$key] = fullname($value);  | 
                                                        
| 620 | 620 | }  | 
                                                        
@@ -629,7 +629,7 @@ discard block  | 
                                                    ||
| 629 | 629 | * @return array $users  | 
                                                        
| 630 | 630 | */  | 
                                                        
| 631 | 631 |  function bigbluebuttonbn_get_users_select(context $context = null) { | 
                                                        
| 632 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);  | 
                                                        |
| 632 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);  | 
                                                        |
| 633 | 633 |      foreach ($users as $key => $value) { | 
                                                        
| 634 | 634 |          $users[$key] = array('id' => $value->id, 'name' => fullname($value)); | 
                                                        
| 635 | 635 | }  | 
                                                        
@@ -644,7 +644,7 @@ discard block  | 
                                                    ||
| 644 | 644 | * @return array $roles  | 
                                                        
| 645 | 645 | */  | 
                                                        
| 646 | 646 |  function bigbluebuttonbn_get_roles(context $context = null) { | 
                                                        
| 647 | - $roles = (array) role_get_names($context);  | 
                                                        |
| 647 | + $roles = (array)role_get_names($context);  | 
                                                        |
| 648 | 648 |      foreach ($roles as $key => $value) { | 
                                                        
| 649 | 649 | $roles[$key] = $value->localname;  | 
                                                        
| 650 | 650 | }  | 
                                                        
@@ -659,7 +659,7 @@ discard block  | 
                                                    ||
| 659 | 659 | * @return array $users  | 
                                                        
| 660 | 660 | */  | 
                                                        
| 661 | 661 |  function bigbluebuttonbn_get_roles_select(context $context = null) { | 
                                                        
| 662 | - $roles = (array) role_get_names($context);  | 
                                                        |
| 662 | + $roles = (array)role_get_names($context);  | 
                                                        |
| 663 | 663 |      foreach ($roles as $key => $value) { | 
                                                        
| 664 | 664 |          $roles[$key] = array('id' => $value->id, 'name' => $value->localname); | 
                                                        
| 665 | 665 | }  | 
                                                        
@@ -674,7 +674,7 @@ discard block  | 
                                                    ||
| 674 | 674 | * @return object $role  | 
                                                        
| 675 | 675 | */  | 
                                                        
| 676 | 676 |  function bigbluebuttonbn_get_role($id) { | 
                                                        
| 677 | - $roles = (array) role_get_names();  | 
                                                        |
| 677 | + $roles = (array)role_get_names();  | 
                                                        |
| 678 | 678 |      if (is_numeric($id)) { | 
                                                        
| 679 | 679 | return (object)$roles[$id];  | 
                                                        
| 680 | 680 | }  | 
                                                        
@@ -829,7 +829,7 @@ discard block  | 
                                                    ||
| 829 | 829 |      if (!isguestuser()) { | 
                                                        
| 830 | 830 | $userroles = bigbluebuttonbn_get_user_roles($context, $userid);  | 
                                                        
| 831 | 831 | }  | 
                                                        
| 832 | - return bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles);  | 
                                                        |
| 832 | + return bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles);  | 
                                                        |
| 833 | 833 | }  | 
                                                        
| 834 | 834 | |
| 835 | 835 | /**  | 
                                                        
@@ -985,7 +985,7 @@ discard block  | 
                                                    ||
| 985 | 985 |  function bigbluebuttonbn_generate_nonce() { | 
                                                        
| 986 | 986 | $mt = microtime();  | 
                                                        
| 987 | 987 | $rand = mt_rand();  | 
                                                        
| 988 | - return md5($mt.$rand);  | 
                                                        |
| 988 | + return md5($mt . $rand);  | 
                                                        |
| 989 | 989 | }  | 
                                                        
| 990 | 990 | |
| 991 | 991 | /**  | 
                                                        
@@ -1075,10 +1075,10 @@ discard block  | 
                                                    ||
| 1075 | 1075 | $now = time();  | 
                                                        
| 1076 | 1076 |      if (!$updatecache && isset($result) && $now < ($result['creation_time'] + $cachettl)) { | 
                                                        
| 1077 | 1077 | // Use the value in the cache.  | 
                                                        
| 1078 | - return (array) json_decode($result['meeting_info']);  | 
                                                        |
| 1078 | + return (array)json_decode($result['meeting_info']);  | 
                                                        |
| 1079 | 1079 | }  | 
                                                        
| 1080 | 1080 | // Ping again and refresh the cache.  | 
                                                        
| 1081 | - $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(  | 
                                                        |
| 1081 | + $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file(  | 
                                                        |
| 1082 | 1082 |          \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) | 
                                                        
| 1083 | 1083 | );  | 
                                                        
| 1084 | 1084 |      $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); | 
                                                        
@@ -1173,7 +1173,7 @@ discard block  | 
                                                    ||
| 1173 | 1173 | * @return object  | 
                                                        
| 1174 | 1174 | */  | 
                                                        
| 1175 | 1175 |  function bigbluebuttonbn_set_config_xml($meetingid, $configxml) { | 
                                                        
| 1176 | -    $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?'; | 
                                                        |
| 1176 | +    $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?'; | 
                                                        |
| 1177 | 1177 | $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml);  | 
                                                        
| 1178 | 1178 | $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, 'POST',  | 
                                                        
| 1179 | 1179 | $configxmlparams, 'application/x-www-form-urlencoded');  | 
                                                        
@@ -1189,8 +1189,8 @@ discard block  | 
                                                    ||
| 1189 | 1189 | * @return string  | 
                                                        
| 1190 | 1190 | */  | 
                                                        
| 1191 | 1191 |  function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) { | 
                                                        
| 1192 | - $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid);  | 
                                                        |
| 1193 | -    $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.\mod_bigbluebuttonbn\locallib\config::get('shared_secret')); | 
                                                        |
| 1192 | + $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid);  | 
                                                        |
| 1193 | +    $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . \mod_bigbluebuttonbn\locallib\config::get('shared_secret')); | 
                                                        |
| 1194 | 1194 | return $configxmlparams;  | 
                                                        
| 1195 | 1195 | }  | 
                                                        
| 1196 | 1196 | |
@@ -1204,7 +1204,7 @@ discard block  | 
                                                    ||
| 1204 | 1204 | */  | 
                                                        
| 1205 | 1205 |  function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) { | 
                                                        
| 1206 | 1206 | $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml);  | 
                                                        
| 1207 | - $configxmlarray = (array) $configxml;  | 
                                                        |
| 1207 | + $configxmlarray = (array)$configxml;  | 
                                                        |
| 1208 | 1208 |      if ($configxmlarray['returncode'] != 'SUCCESS') { | 
                                                        
| 1209 | 1209 |          debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER); | 
                                                        
| 1210 | 1210 | return '';  | 
                                                        
@@ -1296,7 +1296,7 @@ discard block  | 
                                                    ||
| 1296 | 1296 | global $USER;  | 
                                                        
| 1297 | 1297 | $starttime = $starttime - ($starttime % 1000);  | 
                                                        
| 1298 | 1298 | // Set formatted date.  | 
                                                        
| 1299 | -    $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z'; | 
                                                        |
| 1299 | +    $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z'; | 
                                                        |
| 1300 | 1300 | return userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone));  | 
                                                        
| 1301 | 1301 | }  | 
                                                        
| 1302 | 1302 | |
@@ -1407,7 +1407,7 @@ discard block  | 
                                                    ||
| 1407 | 1407 | * @return string  | 
                                                        
| 1408 | 1408 | */  | 
                                                        
| 1409 | 1409 |  function bigbluebuttonbn_get_recording_data_row_preview($recording) { | 
                                                        
| 1410 | -    $options = array('id' => 'preview-'.$recording['recordID'], 'class' => 'container'); | 
                                                        |
| 1410 | +    $options = array('id' => 'preview-' . $recording['recordID'], 'class' => 'container'); | 
                                                        |
| 1411 | 1411 |      if ($recording['published'] === 'false') { | 
                                                        
| 1412 | 1412 | $options['hidden'] = 'hidden';  | 
                                                        
| 1413 | 1413 | }  | 
                                                        
@@ -1448,7 +1448,7 @@ discard block  | 
                                                    ||
| 1448 | 1448 |      if ($recording['published'] === 'false') { | 
                                                        
| 1449 | 1449 | $visibility = 'hidden ';  | 
                                                        
| 1450 | 1450 | }  | 
                                                        
| 1451 | - $id = 'playbacks-'.$recording['recordID'];  | 
                                                        |
| 1451 | + $id = 'playbacks-' . $recording['recordID'];  | 
                                                        |
| 1452 | 1452 |      $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported, | 
                                                        
| 1453 | 1453 | 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],  | 
                                                        
| 1454 | 1454 | 'title' => $title, $visibility => $visibility));  | 
                                                        
@@ -1473,12 +1473,12 @@ discard block  | 
                                                    ||
| 1473 | 1473 |      if (!bigbluebuttonbn_include_recording_data_row_type($recording, $bbbsession, $playback)) { | 
                                                        
| 1474 | 1474 | return '';  | 
                                                        
| 1475 | 1475 | }  | 
                                                        
| 1476 | -    $title = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'); | 
                                                        |
| 1476 | +    $title = get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn'); | 
                                                        |
| 1477 | 1477 | $onclick = 'M.mod_bigbluebuttonbn.recordings.recordingPlay(this);';  | 
                                                        
| 1478 | 1478 | $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bbbsession['bigbluebuttonbn']->id .  | 
                                                        
| 1479 | - '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type'];  | 
                                                        |
| 1479 | + '&mid=' . $recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type'];  | 
                                                        |
| 1480 | 1480 |      if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') { | 
                                                        
| 1481 | - $href .= '&href='.urlencode(trim($playback['url']));  | 
                                                        |
| 1481 | + $href .= '&href=' . urlencode(trim($playback['url']));  | 
                                                        |
| 1482 | 1482 | }  | 
                                                        
| 1483 | 1483 | $id = 'recording-play-' . $playback['type'] . '-' . $recording['recordID'];  | 
                                                        
| 1484 | 1484 | $linkattributes = array(  | 
                                                        
@@ -1612,7 +1612,7 @@ discard block  | 
                                                    ||
| 1612 | 1612 | $linkattributes['class'] = 'disabled';  | 
                                                        
| 1613 | 1613 | unset($linkattributes['onclick']);  | 
                                                        
| 1614 | 1614 | }  | 
                                                        
| 1615 | -        $icon = new pix_icon('i/'.$data['tag'], | 
                                                        |
| 1615 | +        $icon = new pix_icon('i/' . $data['tag'], | 
                                                        |
| 1616 | 1616 |              get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'), | 
                                                        
| 1617 | 1617 | 'moodle', $iconattributes);  | 
                                                        
| 1618 | 1618 |          return $OUTPUT->action_icon('#', $icon, null, $linkattributes, false); | 
                                                        
@@ -1729,7 +1729,7 @@ discard block  | 
                                                    ||
| 1729 | 1729 | */  | 
                                                        
| 1730 | 1730 |  function bigbluebuttonbn_get_recording_table_row($bbbsession, $recording, $rowdata) { | 
                                                        
| 1731 | 1731 | $row = new html_table_row();  | 
                                                        
| 1732 | - $row->id = 'recording-td-'.$recording['recordID'];  | 
                                                        |
| 1732 | + $row->id = 'recording-td-' . $recording['recordID'];  | 
                                                        |
| 1733 | 1733 | $row->attributes['data-imported'] = 'false';  | 
                                                        
| 1734 | 1734 | $texthead = '';  | 
                                                        
| 1735 | 1735 | $texttail = '';  | 
                                                        
@@ -1789,9 +1789,9 @@ discard block  | 
                                                    ||
| 1789 | 1789 |  function bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn) { | 
                                                        
| 1790 | 1790 | $sender = get_admin();  | 
                                                        
| 1791 | 1791 | // Prepare message.  | 
                                                        
| 1792 | -    $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn'). | 
                                                        |
| 1793 | - ' "' . $bigbluebuttonbn->name . '" '.  | 
                                                        |
| 1794 | -        get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>'; | 
                                                        |
| 1792 | +    $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . | 
                                                        |
| 1793 | + ' "' . $bigbluebuttonbn->name . '" ' .  | 
                                                        |
| 1794 | +        get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>'; | 
                                                        |
| 1795 | 1795 | $context = context_course::instance($bigbluebuttonbn->course);  | 
                                                        
| 1796 | 1796 | \mod_bigbluebuttonbn\locallib\notifier::notification_send($context, $sender, $bigbluebuttonbn, $messagetext);  | 
                                                        
| 1797 | 1797 | }  | 
                                                        
@@ -2013,7 +2013,7 @@ discard block  | 
                                                    ||
| 2013 | 2013 | }  | 
                                                        
| 2014 | 2014 | // Prepare select for loading records based on existent bigbluebuttonbns.  | 
                                                        
| 2015 | 2015 |      $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE '; | 
                                                        
| 2016 | -    $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')'; | 
                                                        |
| 2016 | +    $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')'; | 
                                                        |
| 2017 | 2017 | // Include only Create events and exclude those with record not true.  | 
                                                        
| 2018 | 2018 | $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?';  | 
                                                        
| 2019 | 2019 | // Execute select for loading records based on existent bigbluebuttonbns.  | 
                                                        
@@ -2145,8 +2145,8 @@ discard block  | 
                                                    ||
| 2145 | 2145 |  function bigbluebuttonbn_format_activity_time($time) { | 
                                                        
| 2146 | 2146 | $activitytime = '';  | 
                                                        
| 2147 | 2147 |      if ($time) { | 
                                                        
| 2148 | - $activitytime = calendar_day_representation($time).' '.  | 
                                                        |
| 2149 | -          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. | 
                                                        |
| 2148 | + $activitytime = calendar_day_representation($time) . ' ' .  | 
                                                        |
| 2149 | +          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' . | 
                                                        |
| 2150 | 2150 | calendar_time_representation($time);  | 
                                                        
| 2151 | 2151 | }  | 
                                                        
| 2152 | 2152 | return $activitytime;  | 
                                                        
@@ -2539,7 +2539,7 @@ discard block  | 
                                                    ||
| 2539 | 2539 | *  | 
                                                        
| 2540 | 2540 | * @return string  | 
                                                        
| 2541 | 2541 | */  | 
                                                        
| 2542 | -function bigbluebuttonbn_render_warning($message, $type='info', $href='', $text='', $class='') { | 
                                                        |
| 2542 | +function bigbluebuttonbn_render_warning($message, $type = 'info', $href = '', $text = '', $class = '') { | 
                                                        |
| 2543 | 2543 | global $OUTPUT;  | 
                                                        
| 2544 | 2544 | $output = "\n";  | 
                                                        
| 2545 | 2545 | // Evaluates if config_warning is enabled.  | 
                                                        
@@ -2578,10 +2578,10 @@ discard block  | 
                                                    ||
| 2578 | 2578 |      if ($class == '') { | 
                                                        
| 2579 | 2579 | $class = 'btn btn-secondary';  | 
                                                        
| 2580 | 2580 | }  | 
                                                        
| 2581 | - $output = ' <form method="post" action="' . $href . '" class="form-inline">'."\n";  | 
                                                        |
| 2582 | - $output .= ' <button type="submit" class="' . $class . '"'."\n";  | 
                                                        |
| 2583 | - $output .= ' title="' . $title . '"'."\n";  | 
                                                        |
| 2584 | - $output .= ' >' . $text . '</button>'."\n";  | 
                                                        |
| 2585 | - $output .= ' </form>'."\n";  | 
                                                        |
| 2581 | + $output = ' <form method="post" action="' . $href . '" class="form-inline">' . "\n";  | 
                                                        |
| 2582 | + $output .= ' <button type="submit" class="' . $class . '"' . "\n";  | 
                                                        |
| 2583 | + $output .= ' title="' . $title . '"' . "\n";  | 
                                                        |
| 2584 | + $output .= ' >' . $text . '</button>' . "\n";  | 
                                                        |
| 2585 | + $output .= ' </form>' . "\n";  | 
                                                        |
| 2586 | 2586 | return $output;  | 
                                                        
| 2587 | 2587 | }  | 
                                                        
@@ -24,8 +24,8 @@ discard block  | 
                                                    ||
| 24 | 24 | * @author Fred Dixon (ffdixon [at] blindsidenetworks [dt] com)  | 
                                                        
| 25 | 25 | */  | 
                                                        
| 26 | 26 | |
| 27 | -require_once(dirname(dirname(dirname(__FILE__))).'/config.php');  | 
                                                        |
| 28 | -require_once(dirname(__FILE__).'/locallib.php');  | 
                                                        |
| 27 | +require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');  | 
                                                        |
| 28 | +require_once(dirname(__FILE__) . '/locallib.php');  | 
                                                        |
| 29 | 29 | |
| 30 | 30 |  $id = required_param('id', PARAM_INT); | 
                                                        
| 31 | 31 |  $a = optional_param('a', 0, PARAM_INT); | 
                                                        
@@ -89,13 +89,13 @@ discard block  | 
                                                    ||
| 89 | 89 |      if ($moderator || $administrator) { | 
                                                        
| 90 | 90 | bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['meeting_end'], $bigbluebuttonbn);  | 
                                                        
| 91 | 91 |          echo get_string('index_ending', 'bigbluebuttonbn'); | 
                                                        
| 92 | - $meetingid = $bigbluebuttonbn->meetingid.'-'.$course->id.'-'.$bigbluebuttonbn->id;  | 
                                                        |
| 92 | + $meetingid = $bigbluebuttonbn->meetingid . '-' . $course->id . '-' . $bigbluebuttonbn->id;  | 
                                                        |
| 93 | 93 |          if ($g != '0') { | 
                                                        
| 94 | - $meetingid .= '['.$g.']';  | 
                                                        |
| 94 | + $meetingid .= '[' . $g . ']';  | 
                                                        |
| 95 | 95 | }  | 
                                                        
| 96 | 96 | |
| 97 | 97 | bigbluebuttonbn_end_meeting($meetingid, $bigbluebuttonbn->moderatorpass);  | 
                                                        
| 98 | -        redirect('index.php?id='.$id); | 
                                                        |
| 98 | +        redirect('index.php?id=' . $id); | 
                                                        |
| 99 | 99 | }  | 
                                                        
| 100 | 100 | }  | 
                                                        
| 101 | 101 | |
@@ -110,7 +110,7 @@ discard block  | 
                                                    ||
| 110 | 110 | // Add a the data for the bigbluebuttonbn instance.  | 
                                                        
| 111 | 111 | $groupobj = null;  | 
                                                        
| 112 | 112 |          if (groups_get_activity_groupmode($cm) > 0) { | 
                                                        
| 113 | -            $groupobj = (object) array('id' => 0, 'name' => get_string('allparticipants')); | 
                                                        |
| 113 | +            $groupobj = (object)array('id' => 0, 'name' => get_string('allparticipants')); | 
                                                        |
| 114 | 114 | }  | 
                                                        
| 115 | 115 | $table->data[] = bigbluebuttonbn_index_display_room($canmoderate, $course, $bigbluebuttonbn, $groupobj);  | 
                                                        
| 116 | 116 | // Add a the data for the groups belonging to the bigbluebuttonbn instance, if any.  | 
                                                        
@@ -136,12 +136,12 @@ discard block  | 
                                                    ||
| 136 | 136 | * @return array  | 
                                                        
| 137 | 137 | */  | 
                                                        
| 138 | 138 |  function bigbluebuttonbn_index_display_room($moderator, $course, $bigbluebuttonbn, $groupobj = null) { | 
                                                        
| 139 | - $meetingid = $bigbluebuttonbn->meetingid.'-'.$course->id.'-'.$bigbluebuttonbn->id;  | 
                                                        |
| 139 | + $meetingid = $bigbluebuttonbn->meetingid . '-' . $course->id . '-' . $bigbluebuttonbn->id;  | 
                                                        |
| 140 | 140 | $paramgroup = '';  | 
                                                        
| 141 | 141 | $groupname = '';  | 
                                                        
| 142 | 142 |      if ($groupobj) { | 
                                                        
| 143 | - $meetingid .= '['.$groupobj->id.']';  | 
                                                        |
| 144 | - $paramgroup = '&group='.$groupobj->id;  | 
                                                        |
| 143 | + $meetingid .= '[' . $groupobj->id . ']';  | 
                                                        |
| 144 | + $paramgroup = '&group=' . $groupobj->id;  | 
                                                        |
| 145 | 145 | $groupname = $groupobj->name;  | 
                                                        
| 146 | 146 | }  | 
                                                        
| 147 | 147 | $meetinginfo = bigbluebuttonbn_get_meeting_info_array($meetingid);  | 
                                                        
@@ -156,7 +156,7 @@ discard block  | 
                                                    ||
| 156 | 156 | return;  | 
                                                        
| 157 | 157 | }  | 
                                                        
| 158 | 158 | // Output Users in the meeting.  | 
                                                        
| 159 | - $joinurl = '<a href="view.php?id='.$bigbluebuttonbn->coursemodule.$paramgroup.'">'.format_string($bigbluebuttonbn->name).'</a>';  | 
                                                        |
| 159 | + $joinurl = '<a href="view.php?id=' . $bigbluebuttonbn->coursemodule . $paramgroup . '">' . format_string($bigbluebuttonbn->name) . '</a>';  | 
                                                        |
| 160 | 160 | $group = $groupname;  | 
                                                        
| 161 | 161 | $users = '';  | 
                                                        
| 162 | 162 | $viewerlist = '';  | 
                                                        
@@ -201,7 +201,7 @@ discard block  | 
                                                    ||
| 201 | 201 | $attendeecount = 0;  | 
                                                        
| 202 | 202 |          foreach ($meetinginfo['attendees']->attendee as $attendee) { | 
                                                        
| 203 | 203 |              if ($attendee->role == $role) { | 
                                                        
| 204 | - $attendeelist .= ($attendeecount++ > 0 ? ', ' : '').$attendee->fullName;  | 
                                                        |
| 204 | + $attendeelist .= ($attendeecount++ > 0 ? ', ' : '') . $attendee->fullName;  | 
                                                        |
| 205 | 205 | }  | 
                                                        
| 206 | 206 | }  | 
                                                        
| 207 | 207 | }  | 
                                                        
@@ -235,17 +235,17 @@ discard block  | 
                                                    ||
| 235 | 235 |  function bigbluebuttonbn_index_display_room_actions($moderator, $course, $bigbluebuttonbn, $groupobj = null) { | 
                                                        
| 236 | 236 | $actions = '';  | 
                                                        
| 237 | 237 |      if ($moderator) { | 
                                                        
| 238 | - $actions .= '<form name="form1" method="post" action="">'."\n";  | 
                                                        |
| 239 | - $actions .= ' <INPUT type="hidden" name="id" value="'.$course->id.'">'."\n";  | 
                                                        |
| 240 | - $actions .= ' <INPUT type="hidden" name="a" value="'.$bigbluebuttonbn->id.'">'."\n";  | 
                                                        |
| 238 | + $actions .= '<form name="form1" method="post" action="">' . "\n";  | 
                                                        |
| 239 | + $actions .= ' <INPUT type="hidden" name="id" value="' . $course->id . '">' . "\n";  | 
                                                        |
| 240 | + $actions .= ' <INPUT type="hidden" name="a" value="' . $bigbluebuttonbn->id . '">' . "\n";  | 
                                                        |
| 241 | 241 |          if ($groupobj != null) { | 
                                                        
| 242 | - $actions .= ' <INPUT type="hidden" name="g" value="'.$groupobj->id.'">'."\n";  | 
                                                        |
| 242 | + $actions .= ' <INPUT type="hidden" name="g" value="' . $groupobj->id . '">' . "\n";  | 
                                                        |
| 243 | 243 | }  | 
                                                        
| 244 | 244 | $actions .= ' <INPUT type="submit" name="submit" value="' .  | 
                                                        
| 245 | 245 |              get_string('view_conference_action_end', 'bigbluebuttonbn') . | 
                                                        
| 246 | 246 | '" class="btn btn-primary btn-sm" onclick="return confirm(\'' .  | 
                                                        
| 247 | 247 |              get_string('index_confirm_end', 'bigbluebuttonbn') . '\')">' . "\n"; | 
                                                        
| 248 | - $actions .= '</form>'."\n";  | 
                                                        |
| 248 | + $actions .= '</form>' . "\n";  | 
                                                        |
| 249 | 249 | }  | 
                                                        
| 250 | 250 | return $actions;  | 
                                                        
| 251 | 251 | }  | 
                                                        
@@ -41,8 +41,8 @@  | 
                                                    ||
| 41 | 41 | */  | 
                                                        
| 42 | 42 |      protected function init() { | 
                                                        
| 43 | 43 |          parent::init('r', self::LEVEL_PARTICIPATING); | 
                                                        
| 44 | - $this->description = "The user with id '##userid' has joined a bigbluebutton meeting for ".  | 
                                                        |
| 45 | - "the bigbluebuttonbn activity with id '##objectid' for the course id ".  | 
                                                        |
| 44 | + $this->description = "The user with id '##userid' has joined a bigbluebutton meeting for " .  | 
                                                        |
| 45 | + "the bigbluebuttonbn activity with id '##objectid' for the course id " .  | 
                                                        |
| 46 | 46 | "'##courseid'.";  | 
                                                        
| 47 | 47 | }  | 
                                                        
| 48 | 48 | |
@@ -41,8 +41,8 @@  | 
                                                    ||
| 41 | 41 | */  | 
                                                        
| 42 | 42 |      protected function init() { | 
                                                        
| 43 | 43 |          parent::init('r', self::LEVEL_OTHER); | 
                                                        
| 44 | - $this->description = "A bigbluebutton meeting for the bigbluebuttonbn activity with id ".  | 
                                                        |
| 45 | - "'##objectid' for the course id '##courseid' has been forcibly ".  | 
                                                        |
| 44 | + $this->description = "A bigbluebutton meeting for the bigbluebuttonbn activity with id " .  | 
                                                        |
| 45 | + "'##objectid' for the course id '##courseid' has been forcibly " .  | 
                                                        |
| 46 | 46 | "ended by the user with id '##userid'.";  | 
                                                        
| 47 | 47 | }  | 
                                                        
| 48 | 48 | |