@@ -41,7 +41,7 @@ |
||
41 | 41 | */ |
42 | 42 | protected function init($crud = 'r', $edulevel = self::LEVEL_OTHER) { |
43 | 43 | parent::init($crud, $edulevel); |
44 | - $this->description = "The user with id '##userid' has unprotected a recording with id ". |
|
44 | + $this->description = "The user with id '##userid' has unprotected a recording with id " . |
|
45 | 45 | "'##other' in the course id '##courseid'."; |
46 | 46 | } |
47 | 47 |
@@ -41,7 +41,7 @@ |
||
41 | 41 | */ |
42 | 42 | protected function init($crud = 'r', $edulevel = self::LEVEL_OTHER) { |
43 | 43 | parent::init($crud, $edulevel); |
44 | - $this->description = "The user with id '##userid' has imported a recording with id ". |
|
44 | + $this->description = "The user with id '##userid' has imported a recording with id " . |
|
45 | 45 | "'##other' in the course id '##courseid'."; |
46 | 46 | } |
47 | 47 |
@@ -41,8 +41,8 @@ |
||
41 | 41 | */ |
42 | 42 | protected function init($crud = 'r', $edulevel = self::LEVEL_PARTICIPATING) { |
43 | 43 | parent::init($crud, $edulevel); |
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,7 +41,7 @@ |
||
41 | 41 | */ |
42 | 42 | protected function init($crud = 'r', $edulevel = self::LEVEL_OTHER) { |
43 | 43 | parent::init($crud, $edulevel); |
44 | - $this->description = "The user with id '##userid' has protected a recording with id ". |
|
44 | + $this->description = "The user with id '##userid' has protected a recording with id " . |
|
45 | 45 | "'##other' in the course id '##courseid'."; |
46 | 46 | } |
47 | 47 |
@@ -41,7 +41,7 @@ |
||
41 | 41 | */ |
42 | 42 | protected function init($crud = 'r', $edulevel = self::LEVEL_OTHER) { |
43 | 43 | parent::init($crud, $edulevel); |
44 | - $this->description = "The user with id '##userid' has viewed a recording with id ". |
|
44 | + $this->description = "The user with id '##userid' has viewed a recording with id " . |
|
45 | 45 | "'##other' from the course id '##courseid'."; |
46 | 46 | } |
47 | 47 |
@@ -209,8 +209,8 @@ discard block |
||
209 | 209 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
210 | 210 | $field['description_key'], 0, ['maxlength' => 4, 'size' => 6], |
211 | 211 | ['message' => get_string('mod_form_field_voicebridge_format_error', 'bigbluebuttonbn'), |
212 | - 'type' => 'numeric', 'rule' => '####', 'validator' => 'server'] |
|
213 | - ); |
|
212 | + 'type' => 'numeric', 'rule' => '####', 'validator' => 'server'] |
|
213 | + ); |
|
214 | 214 | } else { |
215 | 215 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
216 | 216 | $field['description_key'], 0, ['maxlength' => 4, 'size' => 6]); |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | */ |
249 | 249 | private function bigbluebuttonbn_mform_add_block_room_recordings(&$mform, $cfg) { |
250 | 250 | $field = ['type' => 'hidden', 'name' => 'recordings_html', 'data_type' => PARAM_INT, |
251 | - 'description_key' => null]; |
|
251 | + 'description_key' => null]; |
|
252 | 252 | if ($cfg['recordings_html_editable']) { |
253 | 253 | $field['type'] = 'checkbox'; |
254 | 254 | $field['description_key'] = 'mod_form_field_recordings_html'; |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
257 | 257 | $field['description_key'], $cfg['recordings_html_default']); |
258 | 258 | $field = ['type' => 'hidden', 'name' => 'recordings_deleted', 'data_type' => PARAM_INT, |
259 | - 'description_key' => null]; |
|
259 | + 'description_key' => null]; |
|
260 | 260 | if ($cfg['recordings_deleted_editable']) { |
261 | 261 | $field['type'] = 'checkbox'; |
262 | 262 | $field['description_key'] = 'mod_form_field_recordings_deleted'; |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
265 | 265 | $field['description_key'], $cfg['recordings_deleted_default']); |
266 | 266 | $field = ['type' => 'hidden', 'name' => 'recordings_imported', 'data_type' => PARAM_INT, |
267 | - 'description_key' => null]; |
|
267 | + 'description_key' => null]; |
|
268 | 268 | if ($cfg['importrecordings_enabled'] && $cfg['recordings_imported_editable']) { |
269 | 269 | $field['type'] = 'checkbox'; |
270 | 270 | $field['description_key'] = 'mod_form_field_recordings_imported'; |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
273 | 273 | $field['description_key'], $cfg['recordings_imported_default']); |
274 | 274 | $field = ['type' => 'hidden', 'name' => 'recordings_preview', 'data_type' => PARAM_INT, |
275 | - 'description_key' => null]; |
|
275 | + 'description_key' => null]; |
|
276 | 276 | if ($cfg['recordings_preview_editable']) { |
277 | 277 | $field['type'] = 'checkbox'; |
278 | 278 | $field['description_key'] = 'mod_form_field_recordings_preview'; |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | $htmlselectiontype = html_writer::select($participantselection['type_options'], |
343 | 343 | 'bigbluebuttonbn_participant_selection_type', $participantselection['type_selected'], array(), |
344 | 344 | array('id' => 'bigbluebuttonbn_participant_selection_type', |
345 | - 'onchange' => 'M.mod_bigbluebuttonbn.modform.participantSelectionSet(); return 0;')); |
|
345 | + 'onchange' => 'M.mod_bigbluebuttonbn.modform.participantSelectionSet(); return 0;')); |
|
346 | 346 | $htmlselectionoptions = html_writer::select($participantselection['options'], 'bigbluebuttonbn_participant_selection', |
347 | 347 | $participantselection['selected'], array(), |
348 | 348 | array('id' => 'bigbluebuttonbn_participant_selection', 'disabled' => 'disabled')); |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | 'type' => 'button', 'class' => 'btn btn-secondary', |
351 | 351 | 'value' => get_string('mod_form_field_participant_list_action_add', 'bigbluebuttonbn'), |
352 | 352 | 'onclick' => 'M.mod_bigbluebuttonbn.modform.participantAdd(); return 0;' |
353 | - )); |
|
353 | + )); |
|
354 | 354 | $htmladdparticipant = html_writer::tag('div', |
355 | 355 | $htmlselectiontype . ' ' . $htmlselectionoptions . ' ' . $htmlselectioninput, null); |
356 | 356 | $mform->addElement('html', "\n\n"); |
@@ -392,9 +392,9 @@ discard block |
||
392 | 392 | $field['type'] = 'select'; |
393 | 393 | $field['data_type'] = PARAM_TEXT; |
394 | 394 | $field['description_key'] = 'mod_form_field_block_clienttype'; |
395 | - $choices = array(BIGBLUEBUTTON_CLIENTTYPE_FLASH => get_string('mod_form_block_clienttype_flash', 'bigbluebuttonbn'), |
|
396 | - BIGBLUEBUTTON_CLIENTTYPE_HTML5 => get_string('mod_form_block_clienttype_html5', 'bigbluebuttonbn')); |
|
397 | - $mform->addElement('header', 'clienttypeselection', get_string('mod_form_block_clienttype', 'bigbluebuttonbn')); |
|
395 | + $choices = array(BIGBLUEBUTTON_CLIENTTYPE_FLASH => get_string('mod_form_block_clienttype_flash', 'bigbluebuttonbn'), |
|
396 | + BIGBLUEBUTTON_CLIENTTYPE_HTML5 => get_string('mod_form_block_clienttype_html5', 'bigbluebuttonbn')); |
|
397 | + $mform->addElement('header', 'clienttypeselection', get_string('mod_form_block_clienttype', 'bigbluebuttonbn')); |
|
398 | 398 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
399 | 399 | $field['description_key'], $cfg['clienttype_default'], $choices); |
400 | 400 | return; |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | |
27 | 27 | defined('MOODLE_INTERNAL') || die(); |
28 | 28 | |
29 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
30 | -require_once($CFG->dirroot.'/course/moodleform_mod.php'); |
|
29 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
30 | +require_once($CFG->dirroot . '/course/moodleform_mod.php'); |
|
31 | 31 | |
32 | 32 | /** |
33 | 33 | * Moodle class for mod_form. |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $serverversion = bigbluebuttonbn_get_server_version(); |
49 | 49 | if (is_null($serverversion)) { |
50 | 50 | print_error('general_error_unable_connect', 'bigbluebuttonbn', |
51 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
51 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
52 | 52 | return; |
53 | 53 | } |
54 | 54 | // Context. |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | // If none is allowed, fail and return |
80 | 80 | if (empty($jsvars['instanceTypeProfiles'])) { |
81 | 81 | print_error('general_error_not_allowed_to_create_instances)', 'bigbluebuttonbn', |
82 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
82 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
83 | 83 | return; |
84 | 84 | } |
85 | 85 | $this->bigbluebuttonbn_mform_add_block_profiles($mform, $jsvars['instanceTypeProfiles']); |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | ); |
128 | 128 | $defaultvalues['presentation'] = $draftitemid; |
129 | 129 | } catch (Exception $e) { |
130 | - debugging('Presentation could not be loaded: '.$e->getMessage(), DEBUG_DEVELOPER); |
|
130 | + debugging('Presentation could not be loaded: ' . $e->getMessage(), DEBUG_DEVELOPER); |
|
131 | 131 | return; |
132 | 132 | } |
133 | 133 | } |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | return; |
454 | 454 | } |
455 | 455 | $mform->addElement($type, $name, get_string($descriptionkey, 'bigbluebuttonbn'), $options); |
456 | - if (get_string_manager()->string_exists($descriptionkey.'_help', 'bigbluebuttonbn')) { |
|
456 | + if (get_string_manager()->string_exists($descriptionkey . '_help', 'bigbluebuttonbn')) { |
|
457 | 457 | $mform->addHelpButton($name, $descriptionkey, 'bigbluebuttonbn'); |
458 | 458 | } |
459 | 459 | if (!empty($rule)) { |
@@ -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; |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | 'logoutURL' => $logouturl, |
101 | 101 | ]; |
102 | 102 | // Choose between Adobe Flash or HTML5 Client. |
103 | - if ( $clienttype == BIGBLUEBUTTON_CLIENTTYPE_HTML5 ) { |
|
103 | + if ($clienttype == BIGBLUEBUTTON_CLIENTTYPE_HTML5) { |
|
104 | 104 | $data['joinViaHtml5'] = 'true'; |
105 | 105 | } |
106 | 106 | if (!is_null($configtoken)) { |
@@ -128,8 +128,8 @@ discard block |
||
128 | 128 | $data = null; |
129 | 129 | if (!is_null($pname) && !is_null($purl)) { |
130 | 130 | $method = 'POST'; |
131 | - $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='". |
|
132 | - $purl."' /></module></modules>"; |
|
131 | + $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='" . |
|
132 | + $purl . "' /></module></modules>"; |
|
133 | 133 | } |
134 | 134 | $xml = bigbluebuttonbn_wrap_xml_load_file($createmeetingurl, $method, $data); |
135 | 135 | if ($xml) { |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | // Override imported flag with actual ID. |
291 | 291 | $recording['imported'] = $recordimported->id; |
292 | 292 | if (isset($recordimported->protected)) { |
293 | - $recording['protected'] = (string) $recordimported->protected; |
|
293 | + $recording['protected'] = (string)$recordimported->protected; |
|
294 | 294 | } |
295 | 295 | $recordsimportedarray[$recording['recordID']] = $recording; |
296 | 296 | } |
@@ -320,21 +320,21 @@ discard block |
||
320 | 320 | // Add formats. |
321 | 321 | $playbackarray = array(); |
322 | 322 | foreach ($recording->playback->format as $format) { |
323 | - $playbackarray[(string) $format->type] = array('type' => (string) $format->type, |
|
324 | - 'url' => trim((string) $format->url), 'length' => (string) $format->length); |
|
323 | + $playbackarray[(string)$format->type] = array('type' => (string)$format->type, |
|
324 | + 'url' => trim((string)$format->url), 'length' => (string)$format->length); |
|
325 | 325 | // Add preview per format when existing. |
326 | 326 | if ($format->preview) { |
327 | - $playbackarray[(string) $format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview); |
|
327 | + $playbackarray[(string)$format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview); |
|
328 | 328 | } |
329 | 329 | } |
330 | 330 | // Add the metadata to the recordings array. |
331 | 331 | $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata)); |
332 | - $recordingarray = array('recordID' => (string) $recording->recordID, |
|
333 | - 'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name, |
|
334 | - 'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime, |
|
335 | - 'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray); |
|
332 | + $recordingarray = array('recordID' => (string)$recording->recordID, |
|
333 | + 'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name, |
|
334 | + 'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime, |
|
335 | + 'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray); |
|
336 | 336 | if (isset($recording->protected)) { |
337 | - $recordingarray['protected'] = (string) $recording->protected; |
|
337 | + $recordingarray['protected'] = (string)$recording->protected; |
|
338 | 338 | } |
339 | 339 | return $recordingarray + $metadataarray; |
340 | 340 | } |
@@ -349,9 +349,9 @@ discard block |
||
349 | 349 | function bigbluebuttonbn_get_recording_preview_images($preview) { |
350 | 350 | $imagesarray = array(); |
351 | 351 | foreach ($preview->images->image as $image) { |
352 | - $imagearray = array('url' => trim((string) $image)); |
|
352 | + $imagearray = array('url' => trim((string)$image)); |
|
353 | 353 | foreach ($image->attributes() as $attkey => $attvalue) { |
354 | - $imagearray[$attkey] = (string) $attvalue; |
|
354 | + $imagearray[$attkey] = (string)$attvalue; |
|
355 | 355 | } |
356 | 356 | array_push($imagesarray, $imagearray); |
357 | 357 | } |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | if (is_object($value)) { |
372 | 372 | $value = ''; |
373 | 373 | } |
374 | - $metadataarray['meta_'.$key] = $value; |
|
374 | + $metadataarray['meta_' . $key] = $value; |
|
375 | 375 | } |
376 | 376 | return $metadataarray; |
377 | 377 | } |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | $ids = explode(',', $recordids); |
444 | 444 | foreach ($ids as $id) { |
445 | 445 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
446 | - \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params) |
|
446 | + \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params) |
|
447 | 447 | ); |
448 | 448 | if ($xml && $xml->returncode != 'SUCCESS') { |
449 | 449 | return false; |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | return $xml; |
509 | 509 | } catch (Exception $e) { |
510 | 510 | libxml_use_internal_errors($previous); |
511 | - $error = 'Caught exception: '.$e->getMessage(); |
|
511 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
512 | 512 | debugging($error, DEBUG_DEVELOPER); |
513 | 513 | return null; |
514 | 514 | } |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | $response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS); |
520 | 520 | return $response; |
521 | 521 | } catch (Exception $e) { |
522 | - $error = 'Caught exception: '.$e->getMessage(); |
|
522 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
523 | 523 | debugging($error, DEBUG_DEVELOPER); |
524 | 524 | libxml_use_internal_errors($previous); |
525 | 525 | return null; |
@@ -545,8 +545,8 @@ discard block |
||
545 | 545 | } |
546 | 546 | $options = array(); |
547 | 547 | $options['CURLOPT_HTTPHEADER'] = array( |
548 | - 'Content-Type: '.$contenttype, |
|
549 | - 'Content-Length: '.strlen($data), |
|
548 | + 'Content-Type: ' . $contenttype, |
|
549 | + 'Content-Length: ' . strlen($data), |
|
550 | 550 | 'Content-Language: en-US', |
551 | 551 | ); |
552 | 552 | |
@@ -567,7 +567,7 @@ discard block |
||
567 | 567 | * @return void |
568 | 568 | */ |
569 | 569 | function bigbluebuttonbn_end_meeting_if_running($bigbluebuttonbn) { |
570 | - $meetingid = $bigbluebuttonbn->meetingid.'-'.$bigbluebuttonbn->course.'-'.$bigbluebuttonbn->id; |
|
570 | + $meetingid = $bigbluebuttonbn->meetingid . '-' . $bigbluebuttonbn->course . '-' . $bigbluebuttonbn->id; |
|
571 | 571 | if (bigbluebuttonbn_is_meeting_running($meetingid)) { |
572 | 572 | bigbluebuttonbn_end_meeting($meetingid, $bigbluebuttonbn->moderatorpass); |
573 | 573 | } |
@@ -587,9 +587,9 @@ discard block |
||
587 | 587 | if ($userroles) { |
588 | 588 | $where = ''; |
589 | 589 | foreach ($userroles as $userrole) { |
590 | - $where .= (empty($where) ? ' WHERE' : ' OR').' id=' . $userrole->roleid; |
|
590 | + $where .= (empty($where) ? ' WHERE' : ' OR') . ' id=' . $userrole->roleid; |
|
591 | 591 | } |
592 | - $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where); |
|
592 | + $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where); |
|
593 | 593 | } |
594 | 594 | return $userroles; |
595 | 595 | } |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | * @return array $users |
613 | 613 | */ |
614 | 614 | function bigbluebuttonbn_get_users(context $context = null) { |
615 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
615 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
616 | 616 | foreach ($users as $key => $value) { |
617 | 617 | $users[$key] = fullname($value); |
618 | 618 | } |
@@ -627,7 +627,7 @@ discard block |
||
627 | 627 | * @return array $users |
628 | 628 | */ |
629 | 629 | function bigbluebuttonbn_get_users_select(context $context = null) { |
630 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
630 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
631 | 631 | foreach ($users as $key => $value) { |
632 | 632 | $users[$key] = array('id' => $value->id, 'name' => fullname($value)); |
633 | 633 | } |
@@ -642,7 +642,7 @@ discard block |
||
642 | 642 | * @return array $roles |
643 | 643 | */ |
644 | 644 | function bigbluebuttonbn_get_roles(context $context = null) { |
645 | - $roles = (array) role_get_names($context); |
|
645 | + $roles = (array)role_get_names($context); |
|
646 | 646 | foreach ($roles as $key => $value) { |
647 | 647 | $roles[$key] = $value->localname; |
648 | 648 | } |
@@ -657,7 +657,7 @@ discard block |
||
657 | 657 | * @return array $users |
658 | 658 | */ |
659 | 659 | function bigbluebuttonbn_get_roles_select(context $context = null) { |
660 | - $roles = (array) role_get_names($context); |
|
660 | + $roles = (array)role_get_names($context); |
|
661 | 661 | foreach ($roles as $key => $value) { |
662 | 662 | $roles[$key] = array('id' => $value->id, 'name' => $value->localname); |
663 | 663 | } |
@@ -672,7 +672,7 @@ discard block |
||
672 | 672 | * @return object $role |
673 | 673 | */ |
674 | 674 | function bigbluebuttonbn_get_role($id) { |
675 | - $roles = (array) role_get_names(); |
|
675 | + $roles = (array)role_get_names(); |
|
676 | 676 | if (is_numeric($id) && isset($roles[$id])) { |
677 | 677 | return (object)$roles[$id]; |
678 | 678 | } |
@@ -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))); |
@@ -1189,7 +1189,7 @@ discard block |
||
1189 | 1189 | * @return object |
1190 | 1190 | */ |
1191 | 1191 | function bigbluebuttonbn_set_config_xml($meetingid, $configxml) { |
1192 | - $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?'; |
|
1192 | + $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?'; |
|
1193 | 1193 | $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml); |
1194 | 1194 | $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, 'POST', |
1195 | 1195 | $configxmlparams, 'application/x-www-form-urlencoded'); |
@@ -1205,8 +1205,8 @@ discard block |
||
1205 | 1205 | * @return string |
1206 | 1206 | */ |
1207 | 1207 | function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) { |
1208 | - $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid); |
|
1209 | - $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.\mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
1208 | + $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid); |
|
1209 | + $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . \mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
1210 | 1210 | return $configxmlparams; |
1211 | 1211 | } |
1212 | 1212 | |
@@ -1220,7 +1220,7 @@ discard block |
||
1220 | 1220 | */ |
1221 | 1221 | function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) { |
1222 | 1222 | $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml); |
1223 | - $configxmlarray = (array) $configxml; |
|
1223 | + $configxmlarray = (array)$configxml; |
|
1224 | 1224 | if ($configxmlarray['returncode'] != 'SUCCESS') { |
1225 | 1225 | debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER); |
1226 | 1226 | return ''; |
@@ -1312,7 +1312,7 @@ discard block |
||
1312 | 1312 | global $USER; |
1313 | 1313 | $starttime = $starttime - ($starttime % 1000); |
1314 | 1314 | // Set formatted date. |
1315 | - $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z'; |
|
1315 | + $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z'; |
|
1316 | 1316 | return userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone)); |
1317 | 1317 | } |
1318 | 1318 | |
@@ -1428,7 +1428,7 @@ discard block |
||
1428 | 1428 | * @return string |
1429 | 1429 | */ |
1430 | 1430 | function bigbluebuttonbn_get_recording_data_row_preview($recording) { |
1431 | - $options = array('id' => 'preview-'.$recording['recordID']); |
|
1431 | + $options = array('id' => 'preview-' . $recording['recordID']); |
|
1432 | 1432 | if ($recording['published'] === 'false') { |
1433 | 1433 | $options['hidden'] = 'hidden'; |
1434 | 1434 | } |
@@ -1490,7 +1490,7 @@ discard block |
||
1490 | 1490 | if ($recording['published'] === 'false') { |
1491 | 1491 | $visibility = 'hidden '; |
1492 | 1492 | } |
1493 | - $id = 'playbacks-'.$recording['recordID']; |
|
1493 | + $id = 'playbacks-' . $recording['recordID']; |
|
1494 | 1494 | $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported, |
1495 | 1495 | 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
1496 | 1496 | 'title' => $title, $visibility => $visibility)); |
@@ -1515,11 +1515,11 @@ discard block |
||
1515 | 1515 | if (!bigbluebuttonbn_include_recording_data_row_type($recording, $bbbsession, $playback)) { |
1516 | 1516 | return ''; |
1517 | 1517 | } |
1518 | - $text = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'); |
|
1518 | + $text = get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn'); |
|
1519 | 1519 | $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bbbsession['bigbluebuttonbn']->id . |
1520 | - '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
1520 | + '&mid=' . $recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
1521 | 1521 | if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') { |
1522 | - $href .= '&href='.urlencode(trim($playback['url'])); |
|
1522 | + $href .= '&href=' . urlencode(trim($playback['url'])); |
|
1523 | 1523 | } |
1524 | 1524 | $linkattributes = array( |
1525 | 1525 | 'id' => 'recording-play-' . $playback['type'] . '-' . $recording['recordID'], |
@@ -1688,7 +1688,7 @@ discard block |
||
1688 | 1688 | $linkattributes['class'] = 'disabled'; |
1689 | 1689 | unset($linkattributes['onclick']); |
1690 | 1690 | } |
1691 | - $icon = new pix_icon('i/'.$data['tag'], |
|
1691 | + $icon = new pix_icon('i/' . $data['tag'], |
|
1692 | 1692 | get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'), |
1693 | 1693 | 'moodle', $iconattributes); |
1694 | 1694 | return $OUTPUT->action_icon('#', $icon, null, $linkattributes, false); |
@@ -1805,7 +1805,7 @@ discard block |
||
1805 | 1805 | */ |
1806 | 1806 | function bigbluebuttonbn_get_recording_table_row($bbbsession, $recording, $rowdata) { |
1807 | 1807 | $row = new html_table_row(); |
1808 | - $row->id = 'recording-tr-'.$recording['recordID']; |
|
1808 | + $row->id = 'recording-tr-' . $recording['recordID']; |
|
1809 | 1809 | $row->attributes['data-imported'] = 'false'; |
1810 | 1810 | $texthead = ''; |
1811 | 1811 | $texttail = ''; |
@@ -1865,9 +1865,9 @@ discard block |
||
1865 | 1865 | function bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn) { |
1866 | 1866 | $sender = get_admin(); |
1867 | 1867 | // Prepare message. |
1868 | - $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn'). |
|
1869 | - ' "' . $bigbluebuttonbn->name . '" '. |
|
1870 | - get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>'; |
|
1868 | + $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . |
|
1869 | + ' "' . $bigbluebuttonbn->name . '" ' . |
|
1870 | + get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>'; |
|
1871 | 1871 | $context = context_course::instance($bigbluebuttonbn->course); |
1872 | 1872 | \mod_bigbluebuttonbn\locallib\notifier::notification_send($context, $sender, $bigbluebuttonbn, $messagetext); |
1873 | 1873 | } |
@@ -2089,7 +2089,7 @@ discard block |
||
2089 | 2089 | } |
2090 | 2090 | // Prepare select for loading records based on existent bigbluebuttonbns. |
2091 | 2091 | $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE '; |
2092 | - $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')'; |
|
2092 | + $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')'; |
|
2093 | 2093 | // Include only Create events and exclude those with record not true. |
2094 | 2094 | $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?'; |
2095 | 2095 | // Execute select for loading records based on existent bigbluebuttonbns. |
@@ -2239,8 +2239,8 @@ discard block |
||
2239 | 2239 | function bigbluebuttonbn_format_activity_time($time) { |
2240 | 2240 | $activitytime = ''; |
2241 | 2241 | if ($time) { |
2242 | - $activitytime = calendar_day_representation($time).' '. |
|
2243 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
2242 | + $activitytime = calendar_day_representation($time) . ' ' . |
|
2243 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' . |
|
2244 | 2244 | calendar_time_representation($time); |
2245 | 2245 | } |
2246 | 2246 | return $activitytime; |
@@ -2660,7 +2660,7 @@ discard block |
||
2660 | 2660 | * |
2661 | 2661 | * @return string |
2662 | 2662 | */ |
2663 | -function bigbluebuttonbn_render_warning($message, $type='info', $href='', $text='', $class='') { |
|
2663 | +function bigbluebuttonbn_render_warning($message, $type = 'info', $href = '', $text = '', $class = '') { |
|
2664 | 2664 | global $OUTPUT; |
2665 | 2665 | $output = "\n"; |
2666 | 2666 | // Evaluates if config_warning is enabled. |
@@ -2699,11 +2699,11 @@ discard block |
||
2699 | 2699 | if ($class == '') { |
2700 | 2700 | $class = 'btn btn-secondary'; |
2701 | 2701 | } |
2702 | - $output = ' <form method="post" action="' . $href . '" class="form-inline">'."\n"; |
|
2703 | - $output .= ' <button type="submit" class="' . $class . '"'."\n"; |
|
2704 | - $output .= ' title="' . $title . '"'."\n"; |
|
2705 | - $output .= ' >' . $text . '</button>'."\n"; |
|
2706 | - $output .= ' </form>'."\n"; |
|
2702 | + $output = ' <form method="post" action="' . $href . '" class="form-inline">' . "\n"; |
|
2703 | + $output .= ' <button type="submit" class="' . $class . '"' . "\n"; |
|
2704 | + $output .= ' title="' . $title . '"' . "\n"; |
|
2705 | + $output .= ' >' . $text . '</button>' . "\n"; |
|
2706 | + $output .= ' </form>' . "\n"; |
|
2707 | 2707 | return $output; |
2708 | 2708 | } |
2709 | 2709 |
@@ -95,9 +95,9 @@ discard block |
||
95 | 95 | function bigbluebuttonbn_get_join_url($meetingid, $username, $pw, $logouturl, $configtoken = null, |
96 | 96 | $userid = null, $clienttype = BIGBLUEBUTTON_CLIENTTYPE_FLASH) { |
97 | 97 | $data = ['meetingID' => $meetingid, |
98 | - 'fullName' => $username, |
|
99 | - 'password' => $pw, |
|
100 | - 'logoutURL' => $logouturl, |
|
98 | + 'fullName' => $username, |
|
99 | + 'password' => $pw, |
|
100 | + 'logoutURL' => $logouturl, |
|
101 | 101 | ]; |
102 | 102 | // Choose between Adobe Flash or HTML5 Client. |
103 | 103 | if ( $clienttype == BIGBLUEBUTTON_CLIENTTYPE_HTML5 ) { |
@@ -153,23 +153,23 @@ discard block |
||
153 | 153 | function bigbluebuttonbn_get_meeting_info_array($meetingid) { |
154 | 154 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
155 | 155 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
156 | - ); |
|
156 | + ); |
|
157 | 157 | if ($xml && $xml->returncode == 'SUCCESS' && empty($xml->messageKey)) { |
158 | 158 | // Meeting info was returned. |
159 | 159 | return array('returncode' => $xml->returncode, |
160 | - 'meetingID' => $xml->meetingID, |
|
161 | - 'moderatorPW' => $xml->moderatorPW, |
|
162 | - 'attendeePW' => $xml->attendeePW, |
|
163 | - 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded, |
|
164 | - 'running' => $xml->running, |
|
165 | - 'recording' => $xml->recording, |
|
166 | - 'startTime' => $xml->startTime, |
|
167 | - 'endTime' => $xml->endTime, |
|
168 | - 'participantCount' => $xml->participantCount, |
|
169 | - 'moderatorCount' => $xml->moderatorCount, |
|
170 | - 'attendees' => $xml->attendees, |
|
171 | - 'metadata' => $xml->metadata, |
|
172 | - ); |
|
160 | + 'meetingID' => $xml->meetingID, |
|
161 | + 'moderatorPW' => $xml->moderatorPW, |
|
162 | + 'attendeePW' => $xml->attendeePW, |
|
163 | + 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded, |
|
164 | + 'running' => $xml->running, |
|
165 | + 'recording' => $xml->recording, |
|
166 | + 'startTime' => $xml->startTime, |
|
167 | + 'endTime' => $xml->endTime, |
|
168 | + 'participantCount' => $xml->participantCount, |
|
169 | + 'moderatorCount' => $xml->moderatorCount, |
|
170 | + 'attendees' => $xml->attendees, |
|
171 | + 'metadata' => $xml->metadata, |
|
172 | + ); |
|
173 | 173 | } |
174 | 174 | if ($xml) { |
175 | 175 | // Either failure or success without meeting info. |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | function bigbluebuttonbn_get_default_config_xml() { |
306 | 306 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
307 | 307 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getDefaultConfigXML') |
308 | - ); |
|
308 | + ); |
|
309 | 309 | return $xml; |
310 | 310 | } |
311 | 311 | |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | foreach ($ids as $id) { |
407 | 407 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
408 | 408 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('deleteRecordings', ['recordID' => $id]) |
409 | - ); |
|
409 | + ); |
|
410 | 410 | if ($xml && $xml->returncode != 'SUCCESS') { |
411 | 411 | return false; |
412 | 412 | } |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | foreach ($ids as $id) { |
426 | 426 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
427 | 427 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('publishRecordings', ['recordID' => $id, 'publish' => $publish]) |
428 | - ); |
|
428 | + ); |
|
429 | 429 | if ($xml && $xml->returncode != 'SUCCESS') { |
430 | 430 | return false; |
431 | 431 | } |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | foreach ($ids as $id) { |
445 | 445 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
446 | 446 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params) |
447 | - ); |
|
447 | + ); |
|
448 | 448 | if ($xml && $xml->returncode != 'SUCCESS') { |
449 | 449 | return false; |
450 | 450 | } |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | function bigbluebuttonbn_end_meeting($meetingid, $modpw) { |
462 | 462 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
463 | 463 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('end', ['meetingID' => $meetingid, 'password' => $modpw]) |
464 | - ); |
|
464 | + ); |
|
465 | 465 | if ($xml) { |
466 | 466 | // If the xml packet returned failure it displays the message to the user. |
467 | 467 | return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | function bigbluebuttonbn_get_server_version() { |
479 | 479 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
480 | 480 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url() |
481 | - ); |
|
481 | + ); |
|
482 | 482 | if ($xml && $xml->returncode == 'SUCCESS') { |
483 | 483 | return $xml->version; |
484 | 484 | } |
@@ -545,10 +545,10 @@ discard block |
||
545 | 545 | } |
546 | 546 | $options = array(); |
547 | 547 | $options['CURLOPT_HTTPHEADER'] = array( |
548 | - 'Content-Type: '.$contenttype, |
|
549 | - 'Content-Length: '.strlen($data), |
|
550 | - 'Content-Language: en-US', |
|
551 | - ); |
|
548 | + 'Content-Type: '.$contenttype, |
|
549 | + 'Content-Length: '.strlen($data), |
|
550 | + 'Content-Language: en-US', |
|
551 | + ); |
|
552 | 552 | |
553 | 553 | return $c->post($url, $data, $options); |
554 | 554 | } |
@@ -695,16 +695,16 @@ discard block |
||
695 | 695 | 'all' => array( |
696 | 696 | 'name' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'), |
697 | 697 | 'children' => [] |
698 | - ) |
|
699 | - ); |
|
698 | + ) |
|
699 | + ); |
|
700 | 700 | $data['role'] = array( |
701 | 701 | 'name' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'), |
702 | 702 | 'children' => bigbluebuttonbn_get_roles_select($context) |
703 | - ); |
|
703 | + ); |
|
704 | 704 | $data['user'] = array( |
705 | 705 | 'name' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'), |
706 | 706 | 'children' => bigbluebuttonbn_get_users_select($context) |
707 | - ); |
|
707 | + ); |
|
708 | 708 | return $data; |
709 | 709 | } |
710 | 710 | |
@@ -747,7 +747,7 @@ discard block |
||
747 | 747 | 'selectiontype' => 'all', |
748 | 748 | 'selectionid' => 'all', |
749 | 749 | 'role' => BIGBLUEBUTTONBN_ROLE_VIEWER |
750 | - ); |
|
750 | + ); |
|
751 | 751 | $defaultrules = explode(',', \mod_bigbluebuttonbn\locallib\config::get('participant_moderator_default')); |
752 | 752 | foreach ($defaultrules as $defaultrule) { |
753 | 753 | if ($defaultrule == '0') { |
@@ -760,9 +760,9 @@ discard block |
||
760 | 760 | continue; |
761 | 761 | } |
762 | 762 | $participantlist[] = array( |
763 | - 'selectiontype' => 'role', |
|
764 | - 'selectionid' => $defaultrule, |
|
765 | - 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR); |
|
763 | + 'selectiontype' => 'role', |
|
764 | + 'selectionid' => $defaultrule, |
|
765 | + 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR); |
|
766 | 766 | } |
767 | 767 | return $participantlist; |
768 | 768 | } |
@@ -801,11 +801,11 @@ discard block |
||
801 | 801 | 'all' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'), |
802 | 802 | 'role' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'), |
803 | 803 | 'user' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'), |
804 | - ], |
|
804 | + ], |
|
805 | 805 | 'type_selected' => 'all', |
806 | 806 | 'options' => ['all' => '---------------'], |
807 | 807 | 'selected' => 'all', |
808 | - ]; |
|
808 | + ]; |
|
809 | 809 | } |
810 | 810 | |
811 | 811 | /** |
@@ -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 | } |
@@ -1492,8 +1492,8 @@ discard block |
||
1492 | 1492 | } |
1493 | 1493 | $id = 'playbacks-'.$recording['recordID']; |
1494 | 1494 | $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported, |
1495 | - 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
|
1496 | - 'title' => $title, $visibility => $visibility)); |
|
1495 | + 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
|
1496 | + 'title' => $title, $visibility => $visibility)); |
|
1497 | 1497 | foreach ($recording['playbacks'] as $playback) { |
1498 | 1498 | $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bbbsession, $playback); |
1499 | 1499 | } |
@@ -1517,7 +1517,7 @@ discard block |
||
1517 | 1517 | } |
1518 | 1518 | $text = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'); |
1519 | 1519 | $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bbbsession['bigbluebuttonbn']->id . |
1520 | - '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
1520 | + '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
1521 | 1521 | if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') { |
1522 | 1522 | $href .= '&href='.urlencode(trim($playback['url'])); |
1523 | 1523 | } |
@@ -1528,7 +1528,7 @@ discard block |
||
1528 | 1528 | 'data-action' => 'play', |
1529 | 1529 | 'data-target' => $playback['type'], |
1530 | 1530 | 'data-href' => $href, |
1531 | - ); |
|
1531 | + ); |
|
1532 | 1532 | if (!bigbluebuttonbn_is_bn_server() && !bigbluebuttonbn_is_valid_resource(trim($playback['url']))) { |
1533 | 1533 | $linkattributes['class'] = 'btn btn-sm btn-warning'; |
1534 | 1534 | $linkattributes['title'] = get_string('view_recording_format_errror_unreachable', 'bigbluebuttonbn'); |
@@ -1678,10 +1678,10 @@ discard block |
||
1678 | 1678 | 'id' => $id, |
1679 | 1679 | 'onclick' => $onclick, |
1680 | 1680 | 'data-action' => $data['action'] |
1681 | - ); |
|
1681 | + ); |
|
1682 | 1682 | if (!isset($recording['imported'])) { |
1683 | 1683 | $linkattributes['data-links'] = bigbluebuttonbn_count_recording_imported_instances( |
1684 | - $recording['recordID']); |
|
1684 | + $recording['recordID']); |
|
1685 | 1685 | } |
1686 | 1686 | if (isset($data['disabled'])) { |
1687 | 1687 | $iconattributes['class'] .= ' fa-' . $data['disabled']; |
@@ -2167,17 +2167,17 @@ discard block |
||
2167 | 2167 | function bigbluebuttonbn_get_instance_type_profiles() { |
2168 | 2168 | $instanceprofiles = array( |
2169 | 2169 | BIGBLUEBUTTONBN_TYPE_ALL => array('id' => BIGBLUEBUTTONBN_TYPE_ALL, |
2170 | - 'name' => get_string('instance_type_default', 'bigbluebuttonbn'), |
|
2171 | - 'features' => array('all')), |
|
2170 | + 'name' => get_string('instance_type_default', 'bigbluebuttonbn'), |
|
2171 | + 'features' => array('all')), |
|
2172 | 2172 | BIGBLUEBUTTONBN_TYPE_ROOM_ONLY => array('id' => BIGBLUEBUTTONBN_TYPE_ROOM_ONLY, |
2173 | - 'name' => get_string('instance_type_room_only', 'bigbluebuttonbn'), |
|
2174 | - 'features' => array('showroom', 'welcomemessage', 'voicebridge', 'waitformoderator', 'userlimit', |
|
2175 | - 'recording', 'sendnotifications', 'preuploadpresentation', 'permissions', 'schedule', 'groups', |
|
2176 | - 'modstandardelshdr', 'availabilityconditionsheader', 'tagshdr', 'competenciessection', |
|
2177 | - 'clienttype')), |
|
2173 | + 'name' => get_string('instance_type_room_only', 'bigbluebuttonbn'), |
|
2174 | + 'features' => array('showroom', 'welcomemessage', 'voicebridge', 'waitformoderator', 'userlimit', |
|
2175 | + 'recording', 'sendnotifications', 'preuploadpresentation', 'permissions', 'schedule', 'groups', |
|
2176 | + 'modstandardelshdr', 'availabilityconditionsheader', 'tagshdr', 'competenciessection', |
|
2177 | + 'clienttype')), |
|
2178 | 2178 | BIGBLUEBUTTONBN_TYPE_RECORDING_ONLY => array('id' => BIGBLUEBUTTONBN_TYPE_RECORDING_ONLY, |
2179 | - 'name' => get_string('instance_type_recording_only', 'bigbluebuttonbn'), |
|
2180 | - 'features' => array('showrecordings', 'importrecordings')) |
|
2179 | + 'name' => get_string('instance_type_recording_only', 'bigbluebuttonbn'), |
|
2180 | + 'features' => array('showrecordings', 'importrecordings')) |
|
2181 | 2181 | ); |
2182 | 2182 | return $instanceprofiles; |
2183 | 2183 | } |
@@ -2244,8 +2244,8 @@ discard block |
||
2244 | 2244 | $activitytime = ''; |
2245 | 2245 | if ($time) { |
2246 | 2246 | $activitytime = calendar_day_representation($time).' '. |
2247 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
2248 | - calendar_time_representation($time); |
|
2247 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
2248 | + calendar_time_representation($time); |
|
2249 | 2249 | } |
2250 | 2250 | return $activitytime; |
2251 | 2251 | } |
@@ -2545,7 +2545,7 @@ discard block |
||
2545 | 2545 | $renderer->render_group_element('participant_moderator_default', |
2546 | 2546 | $renderer->render_group_element_configmultiselect('participant_moderator_default', |
2547 | 2547 | array_keys($owner), array_merge($owner, $roles)) |
2548 | - ); |
|
2548 | + ); |
|
2549 | 2549 | } |
2550 | 2550 | } |
2551 | 2551 | |
@@ -2581,7 +2581,7 @@ discard block |
||
2581 | 2581 | // Web Client default. |
2582 | 2582 | $default = intval((int)\mod_bigbluebuttonbn\locallib\config::get('clienttype_default')); |
2583 | 2583 | $choices = array(BIGBLUEBUTTON_CLIENTTYPE_FLASH => get_string('mod_form_block_clienttype_flash', 'bigbluebuttonbn'), |
2584 | - BIGBLUEBUTTON_CLIENTTYPE_HTML5 => get_string('mod_form_block_clienttype_html5', 'bigbluebuttonbn')); |
|
2584 | + BIGBLUEBUTTON_CLIENTTYPE_HTML5 => get_string('mod_form_block_clienttype_html5', 'bigbluebuttonbn')); |
|
2585 | 2585 | $renderer->render_group_element('clienttype_default', |
2586 | 2586 | $renderer->render_group_element_configselect('clienttype_default', |
2587 | 2587 | $default, $choices)); |
@@ -2674,7 +2674,7 @@ discard block |
||
2674 | 2674 | return $output; |
2675 | 2675 | } |
2676 | 2676 | $output .= $OUTPUT->box_start('box boxalignleft adminerror alert alert-' . $type . ' alert-block fade in', |
2677 | - 'bigbluebuttonbn_view_general_warning') . "\n"; |
|
2677 | + 'bigbluebuttonbn_view_general_warning') . "\n"; |
|
2678 | 2678 | $output .= ' ' . $message . "\n"; |
2679 | 2679 | $output .= ' <div class="singlebutton pull-right">' . "\n"; |
2680 | 2680 | if (!empty($href)) { |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | * Helper function to retrieve imported recordings from the Moodle database. |
273 | 273 | * The references are stored as events in bigbluebuttonbn_logs. |
274 | 274 | * |
275 | - * @param string $courseid |
|
275 | + * @param integer $courseid |
|
276 | 276 | * @param string $bigbluebuttonbnid |
277 | 277 | * @param bool $subset |
278 | 278 | * |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | /** |
301 | 301 | * Helper function to retrive the default config.xml file. |
302 | 302 | * |
303 | - * @return string |
|
303 | + * @return null|SimpleXMLElement |
|
304 | 304 | */ |
305 | 305 | function bigbluebuttonbn_get_default_config_xml() { |
306 | 306 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | * @param object $a |
383 | 383 | * @param object $b |
384 | 384 | * |
385 | - * @return array |
|
385 | + * @return integer |
|
386 | 386 | */ |
387 | 387 | function bigbluebuttonbn_recording_build_sorter($a, $b) { |
388 | 388 | if ($a['startTime'] < $b['startTime']) { |
@@ -493,7 +493,7 @@ discard block |
||
493 | 493 | * @param string $data |
494 | 494 | * @param string $contenttype |
495 | 495 | * |
496 | - * @return object |
|
496 | + * @return null|SimpleXMLElement |
|
497 | 497 | */ |
498 | 498 | function bigbluebuttonbn_wrap_xml_load_file($url, $method = 'GET', $data = null, $contenttype = 'text/xml') { |
499 | 499 | if (extension_loaded('curl')) { |
@@ -534,7 +534,7 @@ discard block |
||
534 | 534 | * @param string $data |
535 | 535 | * @param string $contenttype |
536 | 536 | * |
537 | - * @return object |
|
537 | + * @return string |
|
538 | 538 | */ |
539 | 539 | function bigbluebuttonbn_wrap_xml_load_file_curl_request($url, $method = 'GET', $data = null, $contenttype = 'text/xml') { |
540 | 540 | $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; |
@@ -1186,7 +1186,7 @@ discard block |
||
1186 | 1186 | * @param string $meetingid |
1187 | 1187 | * @param string $configxml |
1188 | 1188 | * |
1189 | - * @return object |
|
1189 | + * @return null|SimpleXMLElement |
|
1190 | 1190 | */ |
1191 | 1191 | function bigbluebuttonbn_set_config_xml($meetingid, $configxml) { |
1192 | 1192 | $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?'; |
@@ -1235,7 +1235,7 @@ discard block |
||
1235 | 1235 | * @param array $recording |
1236 | 1236 | * @param array $tools |
1237 | 1237 | * |
1238 | - * @return array |
|
1238 | + * @return null|stdClass |
|
1239 | 1239 | */ |
1240 | 1240 | function bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools = ['protect', 'publish', 'delete']) { |
1241 | 1241 | if (!bigbluebuttonbn_include_recording_table_row($bbbsession, $recording)) { |
@@ -1799,7 +1799,7 @@ discard block |
||
1799 | 1799 | * |
1800 | 1800 | * @param array $bbbsession |
1801 | 1801 | * @param array $recording |
1802 | - * @param object $rowdata |
|
1802 | + * @param stdClass $rowdata |
|
1803 | 1803 | * |
1804 | 1804 | * @return object |
1805 | 1805 | */ |
@@ -1994,7 +1994,7 @@ discard block |
||
1994 | 1994 | * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included |
1995 | 1995 | * in the getRecordings request considering only those that belong to deleted activities. |
1996 | 1996 | * |
1997 | - * @param string $courseid |
|
1997 | + * @param integer $courseid |
|
1998 | 1998 | * @param string $bigbluebuttonbnid |
1999 | 1999 | * @param bool $subset |
2000 | 2000 | * |
@@ -2018,7 +2018,7 @@ discard block |
||
2018 | 2018 | * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included |
2019 | 2019 | * in the getRecordings request considering only those that belong to imported recordings. |
2020 | 2020 | * |
2021 | - * @param string $courseid |
|
2021 | + * @param integer $courseid |
|
2022 | 2022 | * @param string $bigbluebuttonbnid |
2023 | 2023 | * @param bool $subset |
2024 | 2024 | * |
@@ -2041,7 +2041,7 @@ discard block |
||
2041 | 2041 | /** |
2042 | 2042 | * Helper function to get recordings and imported recordings together. |
2043 | 2043 | * |
2044 | - * @param string $courseid |
|
2044 | + * @param integer $courseid |
|
2045 | 2045 | * @param string $bigbluebuttonbnid |
2046 | 2046 | * @param bool $subset |
2047 | 2047 | * @param bool $includedeleted |
@@ -2059,7 +2059,7 @@ discard block |
||
2059 | 2059 | * Helper function to retrieve recordings from the BigBlueButton. The references are stored as events |
2060 | 2060 | * in bigbluebuttonbn_logs. |
2061 | 2061 | * |
2062 | - * @param string $courseid |
|
2062 | + * @param integer $courseid |
|
2063 | 2063 | * @param string $bigbluebuttonbnid |
2064 | 2064 | * @param bool $subset |
2065 | 2065 | * @param bool $includedeleted |
@@ -2218,7 +2218,6 @@ discard block |
||
2218 | 2218 | * Helper function returns an array with the profiles (with features per profile) for the different types |
2219 | 2219 | * of bigbluebuttonbn instances allowed for the user. |
2220 | 2220 | * |
2221 | - * @param array $profiles |
|
2222 | 2221 | * |
2223 | 2222 | * @return array |
2224 | 2223 | */ |
@@ -28,7 +28,6 @@ |
||
28 | 28 | defined('MOODLE_INTERNAL') || die(); |
29 | 29 | |
30 | 30 | use context_module; |
31 | -use mod_bigbluebuttonbn_external; |
|
32 | 31 | require_once($CFG->dirroot . '/mod/bigbluebuttonbn/locallib.php'); |
33 | 32 | |
34 | 33 | /** |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | global $OUTPUT, $SESSION, $CFG; |
56 | 56 | |
57 | - $args = (object) $args; |
|
57 | + $args = (object)$args; |
|
58 | 58 | $viewinstance = bigbluebuttonbn_view_validator($args->cmid, null); |
59 | 59 | if (!$viewinstance) { |
60 | 60 | $error = get_string('view_error_url_missing_parameters', 'bigbluebuttonbn'); |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $bigbluebuttonbn = $viewinstance['bigbluebuttonbn']; |
67 | 67 | $context = context_module::instance($cm->id); |
68 | 68 | |
69 | - require_login($course->id, false , $cm, true, true); |
|
69 | + require_login($course->id, false, $cm, true, true); |
|
70 | 70 | require_capability('mod/bigbluebuttonbn:join', $context); |
71 | 71 | |
72 | 72 | // Add view event. |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | |
112 | 112 | // Check if the BBB server is working. |
113 | 113 | $serverversion = bigbluebuttonbn_get_server_version(); |
114 | - $bbbsession['serverversion'] = (string) $serverversion; |
|
114 | + $bbbsession['serverversion'] = (string)$serverversion; |
|
115 | 115 | if (is_null($serverversion)) { |
116 | 116 | |
117 | 117 | if ($bbbsession['administrator']) { |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | |
139 | 139 | // Operation URLs. |
140 | 140 | $bbbsession['bigbluebuttonbnURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id; |
141 | - $bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id='.$args->cmid . |
|
141 | + $bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id=' . $args->cmid . |
|
142 | 142 | '&bn=' . $bbbsession['bigbluebuttonbn']->id; |
143 | 143 | $bbbsession['recordingReadyURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_broker.php?action=recording_' . |
144 | 144 | 'ready&bigbluebuttonbn=' . $bbbsession['bigbluebuttonbn']->id; |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | } |
182 | 182 | if ($response['returncode'] == 'FAILED') { |
183 | 183 | // The meeting could not be created. |
184 | - $errorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create'); |
|
184 | + $errorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create'); |
|
185 | 185 | $e = get_string($errorkey, 'bigbluebuttonbn'); |
186 | 186 | return(self::mobile_print_error($e)); |
187 | 187 | } |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['meeting_create'], $bigbluebuttonbn); |
195 | 195 | // Insert a record that meeting was created. |
196 | 196 | $overrides = array('meetingid' => $bbbsession['meetingid']); |
197 | - $meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}'; |
|
197 | + $meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}'; |
|
198 | 198 | bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_CREATE, $overrides, $meta); |
199 | 199 | } |
200 | 200 | |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | |
213 | 213 | $data = array( |
214 | 214 | 'bigbluebuttonbn' => $bigbluebuttonbn, |
215 | - 'bbbsession' => (object) $bbbsession, |
|
215 | + 'bbbsession' => (object)$bbbsession, |
|
216 | 216 | 'urltojoin' => $urltojoin, |
217 | 217 | 'cmid' => $cm->id, |
218 | 218 | 'courseid' => $args->courseid |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $session['importrecordings'] = ($session['managerecordings']); |
59 | 59 | $session['modPW'] = $session['bigbluebuttonbn']->moderatorpass; |
60 | 60 | $session['viewerPW'] = $session['bigbluebuttonbn']->viewerpass; |
61 | - $session['meetingid'] = $session['bigbluebuttonbn']->meetingid.'-'.$session['course']->id.'-'. |
|
61 | + $session['meetingid'] = $session['bigbluebuttonbn']->meetingid . '-' . $session['course']->id . '-' . |
|
62 | 62 | $session['bigbluebuttonbn']->id; |
63 | 63 | $session['meetingname'] = $session['bigbluebuttonbn']->name; |
64 | 64 | $session['meetingdescription'] = $session['bigbluebuttonbn']->intro; |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $session['welcome'] = get_string('mod_form_field_welcome_default', 'bigbluebuttonbn'); |
78 | 78 | } |
79 | 79 | if ($session['bigbluebuttonbn']->record) { |
80 | - $session['welcome'] .= '<br><br>'.get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
|
80 | + $session['welcome'] .= '<br><br>' . get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
|
81 | 81 | } |
82 | 82 | $session['openingtime'] = $session['bigbluebuttonbn']->openingtime; |
83 | 83 | $session['closingtime'] = $session['bigbluebuttonbn']->closingtime; |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $session['originServerName'] = $parsedurl['host']; |
89 | 89 | $session['originServerUrl'] = $CFG->wwwroot; |
90 | 90 | $session['originServerCommonName'] = ''; |
91 | - $session['originTag'] = 'moodle-mod_bigbluebuttonbn ('.get_config('mod_bigbluebuttonbn', 'version').')'; |
|
91 | + $session['originTag'] = 'moodle-mod_bigbluebuttonbn (' . get_config('mod_bigbluebuttonbn', 'version') . ')'; |
|
92 | 92 | $session['bnserver'] = bigbluebuttonbn_is_bn_server(); |
93 | 93 | $session['clienttype'] = \mod_bigbluebuttonbn\locallib\config::get('clienttype_default'); |
94 | 94 | |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | $data['welcome'] .= '<br><br>'; |
202 | 202 | $data['welcome'] .= str_replace( |
203 | 203 | '%duration%', |
204 | - (string) $durationtime, |
|
204 | + (string)$durationtime, |
|
205 | 205 | get_string('bbbdurationwarning', 'bigbluebuttonbn') |
206 | 206 | ); |
207 | 207 | } |