@@ -22,8 +22,8 @@ discard block |
||
22 | 22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v2 or later |
23 | 23 | */ |
24 | 24 | |
25 | -require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); |
|
26 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
25 | +require_once(dirname(dirname(dirname(__FILE__))) . '/config.php'); |
|
26 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
27 | 27 | |
28 | 28 | use \Firebase\JWT\JWT; |
29 | 29 | |
@@ -39,13 +39,13 @@ discard block |
||
39 | 39 | $params['meta'] = optional_param('meta', '', PARAM_TEXT); |
40 | 40 | |
41 | 41 | if (empty($params['action'])) { |
42 | - header('HTTP/1.0 400 Bad Request. Parameter ['.$params['action'].'] was not included'); |
|
42 | + header('HTTP/1.0 400 Bad Request. Parameter [' . $params['action'] . '] was not included'); |
|
43 | 43 | return; |
44 | 44 | } |
45 | 45 | |
46 | 46 | $error = bigbluebuttonbn_broker_validate_parameters($params); |
47 | 47 | if (!empty($error)) { |
48 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
48 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
49 | 49 | return; |
50 | 50 | } |
51 | 51 | |
@@ -139,11 +139,11 @@ discard block |
||
139 | 139 | return; |
140 | 140 | } |
141 | 141 | |
142 | - header('HTTP/1.0 400 Bad request. The action '. $a . ' doesn\'t exist'); |
|
142 | + header('HTTP/1.0 400 Bad request. The action ' . $a . ' doesn\'t exist'); |
|
143 | 143 | return; |
144 | 144 | |
145 | 145 | } catch (Exception $e) { |
146 | - header('HTTP/1.0 500 Internal Server Error. '.$e->getMessage()); |
|
146 | + header('HTTP/1.0 500 Internal Server Error. ' . $e->getMessage()); |
|
147 | 147 | return; |
148 | 148 | } |
149 | 149 | |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | function bigbluebuttonbn_broker_recording_info_current($recording, $params) { |
284 | 284 | $callbackresponse['status'] = true; |
285 | 285 | $callbackresponse['found'] = true; |
286 | - $callbackresponse['published'] = (string) $recording['published']; |
|
286 | + $callbackresponse['published'] = (string)$recording['published']; |
|
287 | 287 | if (!isset($params['meta']) || empty($params['meta'])) { |
288 | 288 | return $callbackresponse; |
289 | 289 | } |
@@ -545,8 +545,8 @@ discard block |
||
545 | 545 | $decodedparameters = JWT::decode($params['signed_parameters'], (string)\mod_bigbluebuttonbn\locallib\config::get('shared_secret'), |
546 | 546 | array('HS256')); |
547 | 547 | } catch (Exception $e) { |
548 | - $error = 'Caught exception: '.$e->getMessage(); |
|
549 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
548 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
549 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
550 | 550 | return; |
551 | 551 | } |
552 | 552 | |
@@ -564,8 +564,8 @@ discard block |
||
564 | 564 | bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn); |
565 | 565 | header('HTTP/1.0 202 Accepted'); |
566 | 566 | } catch (Exception $e) { |
567 | - $error = 'Caught exception: '.$e->getMessage(); |
|
568 | - header('HTTP/1.0 503 Service Unavailable. '.$error); |
|
567 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
568 | + header('HTTP/1.0 503 Service Unavailable. ' . $error); |
|
569 | 569 | } |
570 | 570 | } |
571 | 571 | |
@@ -580,7 +580,7 @@ discard block |
||
580 | 580 | $importrecordings = $SESSION->bigbluebuttonbn_importrecordings; |
581 | 581 | if (!isset($importrecordings[$params['id']])) { |
582 | 582 | $error = "Recording {$params['id']} could not be found. It can not be imported"; |
583 | - header('HTTP/1.0 404 Not found. '.$error); |
|
583 | + header('HTTP/1.0 404 Not found. ' . $error); |
|
584 | 584 | return; |
585 | 585 | } |
586 | 586 | |
@@ -588,7 +588,7 @@ discard block |
||
588 | 588 | |
589 | 589 | $importrecordings[$params['id']]['imported'] = true; |
590 | 590 | $overrides = array('meetingid' => $importrecordings[$params['id']]['meetingID']); |
591 | - $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}'; |
|
591 | + $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}'; |
|
592 | 592 | bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta); |
593 | 593 | // Moodle event logger: Create an event for recording imported. |
594 | 594 | if (isset($bbbsession['bigbluebutton']) && isset($bbbsession['cm'])) { |
@@ -606,8 +606,8 @@ discard block |
||
606 | 606 | $decodedparameters = JWT::decode($params['signed_parameters'], (string)\mod_bigbluebuttonbn\locallib\config::get('shared_secret'), |
607 | 607 | array('HS256')); |
608 | 608 | } catch (Exception $e) { |
609 | - $error = 'Caught exception: '.$e->getMessage(); |
|
610 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
609 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
610 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
611 | 611 | return; |
612 | 612 | } |
613 | 613 | |
@@ -645,7 +645,7 @@ discard block |
||
645 | 645 | |
646 | 646 | $action = strtolower($params['action']); |
647 | 647 | if (!array_key_exists($action, $requiredparams)) { |
648 | - return 'Action '.$params['action'].' can not be performed.'; |
|
648 | + return 'Action ' . $params['action'] . ' can not be performed.'; |
|
649 | 649 | } |
650 | 650 | |
651 | 651 | return bigbluebuttonbn_broker_validate_parameters_message($params, $requiredparams[$action]); |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | global $CFG; |
29 | 29 | |
30 | -require_once(dirname(__FILE__).'/lib.php'); |
|
30 | +require_once(dirname(__FILE__) . '/lib.php'); |
|
31 | 31 | |
32 | 32 | const BIGBLUEBUTTONBN_FORCED = true; |
33 | 33 | |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | if (isset($meta)) { |
80 | 80 | $log->meta = $meta; |
81 | 81 | } else if ($event == BIGBLUEBUTTONBN_LOG_EVENT_CREATE) { |
82 | - $log->meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}'; |
|
82 | + $log->meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}'; |
|
83 | 83 | } |
84 | 84 | $DB->insert_record('bigbluebuttonbn_logs', $log); |
85 | 85 | } |
@@ -119,8 +119,8 @@ discard block |
||
119 | 119 | $data = null; |
120 | 120 | if (!is_null($pname) && !is_null($purl)) { |
121 | 121 | $method = BIGBLUEBUTTONBN_METHOD_POST; |
122 | - $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='". |
|
123 | - $purl."' /></module></modules>"; |
|
122 | + $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='" . |
|
123 | + $purl . "' /></module></modules>"; |
|
124 | 124 | } |
125 | 125 | $xml = bigbluebuttonbn_wrap_xml_load_file($createmeetingurl, $method, $data); |
126 | 126 | if ($xml) { |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | 'moderatorPW' => $meeting->moderatorPW, |
160 | 160 | 'attendeePW' => $meeting->attendeePW, |
161 | 161 | 'hasBeenForciblyEnded' => $meeting->hasBeenForciblyEnded, |
162 | - 'running' => $meeting->running, ); |
|
162 | + 'running' => $meeting->running,); |
|
163 | 163 | } |
164 | 164 | return $meetings; |
165 | 165 | } |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | // Override imported flag with actual ID. |
300 | 300 | $recording['imported'] = $recordimported->id; |
301 | 301 | if (isset($recordimported->protected)) { |
302 | - $recording['protected'] = (string) $recordimported->protected; |
|
302 | + $recording['protected'] = (string)$recordimported->protected; |
|
303 | 303 | } |
304 | 304 | $recordsimportedarray[$recording['recordID']] = $recording; |
305 | 305 | } |
@@ -315,36 +315,36 @@ discard block |
||
315 | 315 | |
316 | 316 | function bigbluebuttonbn_get_default_config_xml_array() { |
317 | 317 | $defaultconfigxml = bigbluebuttonbn_getDefaultConfigXML(); |
318 | - return (array) $defaultconfigxml; |
|
318 | + return (array)$defaultconfigxml; |
|
319 | 319 | } |
320 | 320 | |
321 | 321 | function bigbluebuttonbn_get_recording_array_value($recording) { |
322 | 322 | // Add formats. |
323 | 323 | $playbackarray = array(); |
324 | 324 | foreach ($recording->playback->format as $format) { |
325 | - $playbackarray[(string) $format->type] = array('type' => (string) $format->type, |
|
326 | - 'url' => trim((string) $format->url), 'length' => (string) $format->length); |
|
325 | + $playbackarray[(string)$format->type] = array('type' => (string)$format->type, |
|
326 | + 'url' => trim((string)$format->url), 'length' => (string)$format->length); |
|
327 | 327 | // Add preview per format when existing. |
328 | 328 | if ($format->preview) { |
329 | 329 | $imagesarray = array(); |
330 | 330 | foreach ($format->preview->images->image as $image) { |
331 | - $imagearray = array('url' => trim((string) $image)); |
|
331 | + $imagearray = array('url' => trim((string)$image)); |
|
332 | 332 | foreach ($image->attributes() as $attkey => $attvalue) { |
333 | - $imagearray[$attkey] = (string) $attvalue; |
|
333 | + $imagearray[$attkey] = (string)$attvalue; |
|
334 | 334 | } |
335 | 335 | array_push($imagesarray, $imagearray); |
336 | 336 | } |
337 | - $playbackarray[(string) $format->type]['preview'] = $imagesarray; |
|
337 | + $playbackarray[(string)$format->type]['preview'] = $imagesarray; |
|
338 | 338 | } |
339 | 339 | } |
340 | 340 | // Add the metadata to the recordings array. |
341 | 341 | $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata)); |
342 | - $recordingarray = array('recordID' => (string) $recording->recordID, |
|
343 | - 'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name, |
|
344 | - 'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime, |
|
345 | - 'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray); |
|
342 | + $recordingarray = array('recordID' => (string)$recording->recordID, |
|
343 | + 'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name, |
|
344 | + 'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime, |
|
345 | + 'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray); |
|
346 | 346 | if (isset($recording->protected)) { |
347 | - $recordingarray['protected'] = (string) $recording->protected; |
|
347 | + $recordingarray['protected'] = (string)$recording->protected; |
|
348 | 348 | } |
349 | 349 | return $recordingarray + $metadataarray; |
350 | 350 | } |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | if (is_object($value)) { |
356 | 356 | $value = ''; |
357 | 357 | } |
358 | - $metadataarray['meta_'.$key] = $value; |
|
358 | + $metadataarray['meta_' . $key] = $value; |
|
359 | 359 | } |
360 | 360 | return $metadataarray; |
361 | 361 | } |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | $ids = explode(',', $recordids); |
412 | 412 | foreach ($ids as $id) { |
413 | 413 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
414 | - \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params) |
|
414 | + \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params) |
|
415 | 415 | ); |
416 | 416 | if ($xml && $xml->returncode != 'SUCCESS') { |
417 | 417 | return false; |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | return $xml; |
479 | 479 | } catch (Exception $e) { |
480 | 480 | libxml_use_internal_errors($previous); |
481 | - $error = 'Caught exception: '.$e->getMessage(); |
|
481 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
482 | 482 | debugging($error, DEBUG_DEVELOPER); |
483 | 483 | return null; |
484 | 484 | } |
@@ -489,7 +489,7 @@ discard block |
||
489 | 489 | $response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS); |
490 | 490 | return $response; |
491 | 491 | } catch (Exception $e) { |
492 | - $error = 'Caught exception: '.$e->getMessage(); |
|
492 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
493 | 493 | debugging($error, DEBUG_DEVELOPER); |
494 | 494 | libxml_use_internal_errors($previous); |
495 | 495 | return null; |
@@ -507,8 +507,8 @@ discard block |
||
507 | 507 | |
508 | 508 | $options = array(); |
509 | 509 | $options['CURLOPT_HTTPHEADER'] = array( |
510 | - 'Content-Type: '.$contenttype, |
|
511 | - 'Content-Length: '.strlen($data), |
|
510 | + 'Content-Type: ' . $contenttype, |
|
511 | + 'Content-Length: ' . strlen($data), |
|
512 | 512 | 'Content-Language: en-US', |
513 | 513 | ); |
514 | 514 | |
@@ -523,9 +523,9 @@ discard block |
||
523 | 523 | if ($userroles) { |
524 | 524 | $where = ''; |
525 | 525 | foreach ($userroles as $value) { |
526 | - $where .= (empty($where) ? ' WHERE' : ' OR').' id='.$value->roleid; |
|
526 | + $where .= (empty($where) ? ' WHERE' : ' OR') . ' id=' . $value->roleid; |
|
527 | 527 | } |
528 | - $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where); |
|
528 | + $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where); |
|
529 | 529 | } |
530 | 530 | return $userroles; |
531 | 531 | } |
@@ -536,7 +536,7 @@ discard block |
||
536 | 536 | } |
537 | 537 | |
538 | 538 | function bigbluebuttonbn_get_users(context $context = null) { |
539 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
539 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
540 | 540 | foreach ($users as $key => $value) { |
541 | 541 | $users[$key] = fullname($value); |
542 | 542 | } |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | } |
545 | 545 | |
546 | 546 | function bigbluebuttonbn_get_users_select(context $context = null) { |
547 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
547 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
548 | 548 | foreach ($users as $key => $value) { |
549 | 549 | $users[$key] = array('id' => $value->id, 'name' => fullname($value)); |
550 | 550 | } |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | } |
553 | 553 | |
554 | 554 | function bigbluebuttonbn_get_roles(context $context = null) { |
555 | - $roles = (array) role_get_names($context); |
|
555 | + $roles = (array)role_get_names($context); |
|
556 | 556 | foreach ($roles as $key => $value) { |
557 | 557 | $roles[$key] = $value->localname; |
558 | 558 | } |
@@ -560,7 +560,7 @@ discard block |
||
560 | 560 | } |
561 | 561 | |
562 | 562 | function bigbluebuttonbn_get_roles_select(context $context = null) { |
563 | - $roles = (array) role_get_names($context); |
|
563 | + $roles = (array)role_get_names($context); |
|
564 | 564 | foreach ($roles as $key => $value) { |
565 | 565 | $roles[$key] = array('id' => $value->id, 'name' => $value->localname); |
566 | 566 | } |
@@ -568,7 +568,7 @@ discard block |
||
568 | 568 | } |
569 | 569 | |
570 | 570 | function bigbluebuttonbn_get_role($id) { |
571 | - $roles = (array) role_get_names(); |
|
571 | + $roles = (array)role_get_names(); |
|
572 | 572 | if (is_numeric($id)) { |
573 | 573 | return (object)$roles[$id]; |
574 | 574 | } |
@@ -648,11 +648,11 @@ discard block |
||
648 | 648 | return array(); |
649 | 649 | } |
650 | 650 | foreach ($rules as $key => $rule) { |
651 | - if ( $rule['selectiontype'] !== 'role' || is_numeric($rule['selectionid']) ) { |
|
651 | + if ($rule['selectiontype'] !== 'role' || is_numeric($rule['selectionid'])) { |
|
652 | 652 | continue; |
653 | 653 | } |
654 | 654 | $role = bigbluebuttonbn_get_role($rule['selectionid']); |
655 | - if ( $role == null ) { |
|
655 | + if ($role == null) { |
|
656 | 656 | unset($rules[$key]); |
657 | 657 | continue; |
658 | 658 | } |
@@ -691,10 +691,10 @@ discard block |
||
691 | 691 | if (empty($userroles)) { |
692 | 692 | $userroles = get_user_roles($context, $userid, true); |
693 | 693 | } |
694 | - return bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles); |
|
694 | + return bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles); |
|
695 | 695 | } |
696 | 696 | |
697 | -function bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles) { |
|
697 | +function bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles) { |
|
698 | 698 | // Iterate participant rules. |
699 | 699 | foreach ($participantlist as $participant) { |
700 | 700 | if (bigbluebuttonbn_is_moderator_validate_rule($participant, $userid, $userroles)) { |
@@ -739,9 +739,9 @@ discard block |
||
739 | 739 | $isunique = true; |
740 | 740 | if ($voicebridge != 0) { |
741 | 741 | $table = 'bigbluebuttonbn'; |
742 | - $select = 'voicebridge = '.$voicebridge; |
|
742 | + $select = 'voicebridge = ' . $voicebridge; |
|
743 | 743 | if ($id) { |
744 | - $select .= ' AND id <> '.$id; |
|
744 | + $select .= ' AND id <> ' . $id; |
|
745 | 745 | } |
746 | 746 | if ($DB->get_records_select($table, $select)) { |
747 | 747 | $isunique = false; |
@@ -795,7 +795,7 @@ discard block |
||
795 | 795 | function bigbluebuttonbn_generate_nonce() { |
796 | 796 | $mt = microtime(); |
797 | 797 | $rand = mt_rand(); |
798 | - return md5($mt.$rand); |
|
798 | + return md5($mt . $rand); |
|
799 | 799 | } |
800 | 800 | |
801 | 801 | function bigbluebuttonbn_random_password($length = 8) { |
@@ -806,41 +806,41 @@ discard block |
||
806 | 806 | |
807 | 807 | function bigbluebuttonbn_events() { |
808 | 808 | return array( |
809 | - (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
810 | - (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
811 | - (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
812 | - (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
813 | - (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
814 | - (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
815 | - (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
816 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
817 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
818 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
819 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
820 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
821 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
822 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
823 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
809 | + (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
810 | + (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
811 | + (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
812 | + (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
813 | + (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
814 | + (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
815 | + (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
816 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
817 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
818 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
819 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
820 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
821 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
822 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
823 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
824 | 824 | ); |
825 | 825 | } |
826 | 826 | |
827 | 827 | function bigbluebuttonbn_events_action() { |
828 | 828 | return array( |
829 | - 'view' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
830 | - 'view_management' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
831 | - 'live_action' => (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
832 | - 'meeting_create' => (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
833 | - 'meeting_end' => (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
834 | - 'meeting_join' => (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
835 | - 'meeting_left' => (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
836 | - 'recording_delete' => (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
837 | - 'recording_import' => (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
838 | - 'recording_protect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
839 | - 'recording_publish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
840 | - 'recording_unprotect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
841 | - 'recording_unpublish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
842 | - 'recording_edit' => (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
843 | - 'recording_play' => (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
829 | + 'view' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
830 | + 'view_management' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
831 | + 'live_action' => (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
832 | + 'meeting_create' => (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
833 | + 'meeting_end' => (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
834 | + 'meeting_join' => (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
835 | + 'meeting_left' => (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
836 | + 'recording_delete' => (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
837 | + 'recording_import' => (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
838 | + 'recording_protect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
839 | + 'recording_publish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
840 | + 'recording_unprotect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
841 | + 'recording_unpublish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
842 | + 'recording_edit' => (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
843 | + 'recording_play' => (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
844 | 844 | ); |
845 | 845 | } |
846 | 846 | |
@@ -861,7 +861,7 @@ discard block |
||
861 | 861 | if (array_key_exists('other', $options)) { |
862 | 862 | $eventproperties['other'] = $options['other']; |
863 | 863 | } |
864 | - $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create', |
|
864 | + $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_' . $eventtype . '::create', |
|
865 | 865 | array($eventproperties)); |
866 | 866 | $event->trigger(); |
867 | 867 | } |
@@ -902,10 +902,10 @@ discard block |
||
902 | 902 | $now = time(); |
903 | 903 | if (!$forced && isset($result) && $now < ($result['creation_time'] + $cachettl)) { |
904 | 904 | // Use the value in the cache. |
905 | - return (array) json_decode($result['meeting_info']); |
|
905 | + return (array)json_decode($result['meeting_info']); |
|
906 | 906 | } |
907 | 907 | // Ping again and refresh the cache. |
908 | - $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file( |
|
908 | + $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file( |
|
909 | 909 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
910 | 910 | ); |
911 | 911 | $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); |
@@ -980,8 +980,8 @@ discard block |
||
980 | 980 | * @param string $configxml |
981 | 981 | */ |
982 | 982 | function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) { |
983 | - $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid); |
|
984 | - $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.\mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
983 | + $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid); |
|
984 | + $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . \mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
985 | 985 | return $configxmlparams; |
986 | 986 | } |
987 | 987 | |
@@ -990,7 +990,7 @@ discard block |
||
990 | 990 | * @param string $configxml |
991 | 991 | */ |
992 | 992 | function bigbluebuttonbn_set_config_xml($meetingid, $configxml) { |
993 | - $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?'; |
|
993 | + $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?'; |
|
994 | 994 | $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml); |
995 | 995 | $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, BIGBLUEBUTTONBN_METHOD_POST, |
996 | 996 | $configxmlparams, 'application/x-www-form-urlencoded'); |
@@ -1003,7 +1003,7 @@ discard block |
||
1003 | 1003 | */ |
1004 | 1004 | function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) { |
1005 | 1005 | $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml); |
1006 | - $configxmlarray = (array) $configxml; |
|
1006 | + $configxmlarray = (array)$configxml; |
|
1007 | 1007 | if ($configxmlarray['returncode'] != 'SUCCESS') { |
1008 | 1008 | debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER); |
1009 | 1009 | return ''; |
@@ -1053,7 +1053,7 @@ discard block |
||
1053 | 1053 | global $USER; |
1054 | 1054 | $starttime = $starttime - ($starttime % 1000); |
1055 | 1055 | // Set formatted date. |
1056 | - $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z'; |
|
1056 | + $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z'; |
|
1057 | 1057 | return userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone)); |
1058 | 1058 | } |
1059 | 1059 | |
@@ -1069,7 +1069,7 @@ discard block |
||
1069 | 1069 | function bigbluebuttonbn_get_recording_data_row_actionbar($recording, $tools) { |
1070 | 1070 | $actionbar = ''; |
1071 | 1071 | foreach ($tools as $tool) { |
1072 | - if ( $tool == 'protect' && !isset($recording['protected']) ) { |
|
1072 | + if ($tool == 'protect' && !isset($recording['protected'])) { |
|
1073 | 1073 | continue; |
1074 | 1074 | } |
1075 | 1075 | $buttonpayload = bigbluebuttonbn_get_recording_data_row_actionbar_payload($recording, $tool); |
@@ -1113,7 +1113,7 @@ discard block |
||
1113 | 1113 | $visibility = 'hidden '; |
1114 | 1114 | } |
1115 | 1115 | $recordingpreview = html_writer::start_tag('div', |
1116 | - array('id' => 'preview-'.$recording['recordID'], $visibility => $visibility)); |
|
1116 | + array('id' => 'preview-' . $recording['recordID'], $visibility => $visibility)); |
|
1117 | 1117 | foreach ($recording['playbacks'] as $playback) { |
1118 | 1118 | if (isset($playback['preview'])) { |
1119 | 1119 | foreach ($playback['preview'] as $image) { |
@@ -1141,13 +1141,13 @@ discard block |
||
1141 | 1141 | if ($recording['published'] === 'false') { |
1142 | 1142 | $visibility = 'hidden '; |
1143 | 1143 | } |
1144 | - $id = 'playbacks-'.$recording['recordID']; |
|
1144 | + $id = 'playbacks-' . $recording['recordID']; |
|
1145 | 1145 | $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported, |
1146 | 1146 | 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
1147 | 1147 | 'title' => $title, $visibility => $visibility)); |
1148 | 1148 | foreach ($recording['playbacks'] as $playback) { |
1149 | 1149 | $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bigbluebuttonbnid, |
1150 | - $playback).' '; |
|
1150 | + $playback) . ' '; |
|
1151 | 1151 | } |
1152 | 1152 | $recordingtypes .= html_writer::end_tag('div'); |
1153 | 1153 | return $recordingtypes; |
@@ -1155,12 +1155,12 @@ discard block |
||
1155 | 1155 | |
1156 | 1156 | function bigbluebuttonbn_get_recording_data_row_type($recording, $bigbluebuttonbnid, $playback) { |
1157 | 1157 | global $CFG, $OUTPUT; |
1158 | - $title = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'); |
|
1158 | + $title = get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn'); |
|
1159 | 1159 | $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_play(this);'; |
1160 | - $href = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=play&bn='.$bigbluebuttonbnid. |
|
1161 | - '&mid='.$recording['meetingID'].'&rid='.$recording['recordID'].'&rtype='.$playback['type']; |
|
1160 | + $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bigbluebuttonbnid . |
|
1161 | + '&mid=' . $recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
1162 | 1162 | if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') { |
1163 | - $href .= '&href='.urlencode(trim($playback['url'])); |
|
1163 | + $href .= '&href=' . urlencode(trim($playback['url'])); |
|
1164 | 1164 | } |
1165 | 1165 | $id = 'recording-play-' . $playback['type'] . '-' . $recording['recordID']; |
1166 | 1166 | $linkattributes = array( |
@@ -1242,11 +1242,11 @@ discard block |
||
1242 | 1242 | $target .= '-' . $data['target']; |
1243 | 1243 | } |
1244 | 1244 | $id = 'recording-' . $target . '-' . $recording['recordID']; |
1245 | - $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_'.$data['action'].'(this);'; |
|
1245 | + $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_' . $data['action'] . '(this);'; |
|
1246 | 1246 | if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recording_icons_enabled')) { |
1247 | 1247 | // With icon for $manageaction. |
1248 | 1248 | $iconattributes = array('id' => $id, 'class' => 'iconsmall'); |
1249 | - $icon = new pix_icon('i/'.$data['tag'], |
|
1249 | + $icon = new pix_icon('i/' . $data['tag'], |
|
1250 | 1250 | get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'), |
1251 | 1251 | 'moodle', $iconattributes); |
1252 | 1252 | $linkattributes = array( |
@@ -1328,7 +1328,7 @@ discard block |
||
1328 | 1328 | if (isset($recordings) && !array_key_exists('messageKey', $recordings)) { |
1329 | 1329 | // There are recordings for this meeting. |
1330 | 1330 | foreach ($recordings as $recording) { |
1331 | - if ( !bigbluebuttonbn_include_recording_table_row($bbbsession, $recording) ) { |
|
1331 | + if (!bigbluebuttonbn_include_recording_table_row($bbbsession, $recording)) { |
|
1332 | 1332 | continue; |
1333 | 1333 | } |
1334 | 1334 | bigbluebuttonbn_get_recording_table_row($bbbsession, $recording, $tools, $table); |
@@ -1343,7 +1343,7 @@ discard block |
||
1343 | 1343 | return; |
1344 | 1344 | } |
1345 | 1345 | $row = new html_table_row(); |
1346 | - $row->id = 'recording-td-'.$recording['recordID']; |
|
1346 | + $row->id = 'recording-td-' . $recording['recordID']; |
|
1347 | 1347 | $row->attributes['data-imported'] = 'false'; |
1348 | 1348 | $texthead = ''; |
1349 | 1349 | $texttail = ''; |
@@ -1367,7 +1367,7 @@ discard block |
||
1367 | 1367 | } |
1368 | 1368 | |
1369 | 1369 | function bigbluebuttonbn_include_recording_table_row($bbbsession, $recording) { |
1370 | - if ( isset($recording['imported']) || !isset($bbbsession['group']) || $recording['meetingID'] == $bbbsession['meetingid'] ) { |
|
1370 | + if (isset($recording['imported']) || !isset($bbbsession['group']) || $recording['meetingID'] == $bbbsession['meetingid']) { |
|
1371 | 1371 | return true; |
1372 | 1372 | } |
1373 | 1373 | return false; |
@@ -1380,9 +1380,9 @@ discard block |
||
1380 | 1380 | // Build the message_body. |
1381 | 1381 | $msg->activity_type = ''; |
1382 | 1382 | $msg->activity_title = $bigbluebuttonbn->name; |
1383 | - $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn').' '. |
|
1384 | - $msg->activity_type.' "'.$msg->activity_title.'" '. |
|
1385 | - get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>'; |
|
1383 | + $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . ' ' . |
|
1384 | + $msg->activity_type . ' "' . $msg->activity_title . '" ' . |
|
1385 | + get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>'; |
|
1386 | 1386 | bigbluebuttonbn_send_notification($sender, $bigbluebuttonbn, $messagetext); |
1387 | 1387 | } |
1388 | 1388 | |
@@ -1472,15 +1472,15 @@ discard block |
||
1472 | 1472 | |
1473 | 1473 | function bigbluebuttonbn_get_recordings_sql_selectdeleted($courseid, $bigbluebuttonbnid = null, $subset = true) { |
1474 | 1474 | if ($bigbluebuttonbnid === null) { |
1475 | - return "courseid = '{$courseid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE. |
|
1475 | + return "courseid = '{$courseid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE . |
|
1476 | 1476 | "' AND meta like '%has_recordings%' AND meta like '%true%'"; |
1477 | 1477 | } |
1478 | 1478 | if ($subset) { |
1479 | - return "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE. |
|
1479 | + return "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE . |
|
1480 | 1480 | "' AND meta like '%has_recordings%' AND meta like '%true%'"; |
1481 | 1481 | } |
1482 | - return "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '". |
|
1483 | - BIGBLUEBUTTONBN_LOG_EVENT_DELETE."' AND meta like '%has_recordings%' AND meta like '%true%'"; |
|
1482 | + return "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '" . |
|
1483 | + BIGBLUEBUTTONBN_LOG_EVENT_DELETE . "' AND meta like '%has_recordings%' AND meta like '%true%'"; |
|
1484 | 1484 | } |
1485 | 1485 | |
1486 | 1486 | function bigbluebuttonbn_get_allrecordings($courseid, $bigbluebuttonbnid = null, $subset = true, |
@@ -1525,7 +1525,7 @@ discard block |
||
1525 | 1525 | } |
1526 | 1526 | // Prepare select for loading records based on existent bigbluebuttonbns. |
1527 | 1527 | $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE '; |
1528 | - $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')'; |
|
1528 | + $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')'; |
|
1529 | 1529 | // Include only Create events and exclude those with record not true. |
1530 | 1530 | $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?'; |
1531 | 1531 | // Execute select for loading records based on existent bigbluebuttonbns. |
@@ -1600,8 +1600,8 @@ discard block |
||
1600 | 1600 | function bigbluebuttonbn_format_activity_time($time) { |
1601 | 1601 | $activitytime = ''; |
1602 | 1602 | if ($time) { |
1603 | - $activitytime = calendar_day_representation($time).' '. |
|
1604 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
1603 | + $activitytime = calendar_day_representation($time) . ' ' . |
|
1604 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' . |
|
1605 | 1605 | calendar_time_representation($time); |
1606 | 1606 | } |
1607 | 1607 | return $activitytime; |
@@ -1711,7 +1711,7 @@ discard block |
||
1711 | 1711 | // This feature only works if curl is installed. |
1712 | 1712 | $preuploadpresentationdescrip = get_string('config_preuploadpresentation_description', 'bigbluebuttonbn'); |
1713 | 1713 | if (!extension_loaded('curl')) { |
1714 | - $preuploadpresentationdescrip .= '<div class="form-defaultinfo">'.get_string('config_warning_curl_not_installed', 'bigbluebuttonbn').'</div><br>'; |
|
1714 | + $preuploadpresentationdescrip .= '<div class="form-defaultinfo">' . get_string('config_warning_curl_not_installed', 'bigbluebuttonbn') . '</div><br>'; |
|
1715 | 1715 | } |
1716 | 1716 | $renderer->render_group_header('preuploadpresentation', null, $preuploadpresentationdescrip); |
1717 | 1717 | if (extension_loaded('curl')) { |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | defined('MOODLE_INTERNAL') || die(); |
28 | 28 | |
29 | 29 | require_once($CFG->dirroot . '/mod/bigbluebuttonbn/locallib.php'); |
30 | -require_once($CFG->libdir.'/adminlib.php'); |
|
30 | +require_once($CFG->libdir . '/adminlib.php'); |
|
31 | 31 | |
32 | 32 | class renderer { |
33 | 33 | |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $itemname = get_string('config_' . $name, 'bigbluebuttonbn'); |
46 | 46 | } |
47 | 47 | if ($itemdescription == null) { |
48 | - $itemdescription = get_string('config_' .$name . '_description', 'bigbluebuttonbn'); |
|
48 | + $itemdescription = get_string('config_' . $name . '_description', 'bigbluebuttonbn'); |
|
49 | 49 | } |
50 | 50 | $item = new \admin_setting_heading('bigbluebuttonbn_config_' . $name, $itemname, $itemdescription); |
51 | 51 | $this->settings->add($item); |
@@ -27,7 +27,7 @@ |
||
27 | 27 | |
28 | 28 | global $CFG; |
29 | 29 | |
30 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
30 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
31 | 31 | |
32 | 32 | if ($ADMIN->fulltree) { |
33 | 33 | // Configuration for BigBlueButton. |
@@ -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 | class mod_bigbluebuttonbn_mod_form extends moodleform_mod { |
33 | 33 | |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $serverversion = bigbluebuttonbn_get_server_version(); |
38 | 38 | if (is_null($serverversion)) { |
39 | 39 | print_error('general_error_unable_connect', 'bigbluebuttonbn', |
40 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
40 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
41 | 41 | return; |
42 | 42 | } |
43 | 43 | // Context. |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | ); |
111 | 111 | $defaultvalues['presentation'] = $draftitemid; |
112 | 112 | } catch (Exception $e) { |
113 | - debugging('Presentation could not be loaded: '.$e->getMessage(), DEBUG_DEVELOPER); |
|
113 | + debugging('Presentation could not be loaded: ' . $e->getMessage(), DEBUG_DEVELOPER); |
|
114 | 114 | return null; |
115 | 115 | } |
116 | 116 | } |
@@ -282,10 +282,10 @@ discard block |
||
282 | 282 | html_writer::select($participantselection['type_options'], 'bigbluebuttonbn_participant_selection_type', |
283 | 283 | $participantselection['type_selected'], array(), |
284 | 284 | array('id' => 'bigbluebuttonbn_participant_selection_type', |
285 | - 'onchange' => 'M.mod_bigbluebuttonbn.modform.participant_selection_set(); return 0;')).' '. |
|
285 | + 'onchange' => 'M.mod_bigbluebuttonbn.modform.participant_selection_set(); return 0;')) . ' ' . |
|
286 | 286 | html_writer::select($participantselection['options'], 'bigbluebuttonbn_participant_selection', |
287 | 287 | $participantselection['selected'], array(), |
288 | - array('id' => 'bigbluebuttonbn_participant_selection', 'disabled' => 'disabled')).' '. |
|
288 | + array('id' => 'bigbluebuttonbn_participant_selection', 'disabled' => 'disabled')) . ' ' . |
|
289 | 289 | html_writer::tag('input', '', array('id' => 'id_addselectionid', 'type' => 'button', 'class' => 'btn btn-secondary', |
290 | 290 | 'value' => get_string('mod_form_field_participant_list_action_add', 'bigbluebuttonbn'), |
291 | 291 | 'onclick' => 'M.mod_bigbluebuttonbn.modform.participant_add(); return 0;' |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | // Render elements for participant list. |
303 | 303 | $htmllist = html_writer::tag('div', |
304 | 304 | html_writer::label(get_string('mod_form_field_participant_list', 'bigbluebuttonbn'), |
305 | - 'bigbluebuttonbn_participant_list'). |
|
305 | + 'bigbluebuttonbn_participant_list') . |
|
306 | 306 | html_writer::table($table) |
307 | 307 | ); |
308 | 308 | $mform->addElement('html', "\n\n"); |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | return; |
333 | 333 | } |
334 | 334 | $mform->addElement($type, $name, get_string($descriptionkey, 'bigbluebuttonbn'), $options); |
335 | - if (get_string_manager()->string_exists($descriptionkey.'_help', 'bigbluebuttonbn')) { |
|
335 | + if (get_string_manager()->string_exists($descriptionkey . '_help', 'bigbluebuttonbn')) { |
|
336 | 336 | $mform->addHelpButton($name, $descriptionkey, 'bigbluebuttonbn'); |
337 | 337 | } |
338 | 338 | if (!empty($rule)) { |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public static function defaultvalues() { |
46 | 46 | return array( |
47 | - 'server_url' => (string) BIGBLUEBUTTONBN_DEFAULT_SERVER_URL, |
|
48 | - 'shared_secret' => (string) BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET, |
|
47 | + 'server_url' => (string)BIGBLUEBUTTONBN_DEFAULT_SERVER_URL, |
|
48 | + 'shared_secret' => (string)BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET, |
|
49 | 49 | 'importrecordings_enabled' => 'false', |
50 | 50 | 'voicebridge_editable' => 'false', |
51 | 51 | 'importrecordings_enabled' => 'false', |
@@ -99,10 +99,10 @@ discard block |
||
99 | 99 | public static function get($setting) { |
100 | 100 | global $CFG; |
101 | 101 | if (isset($CFG->bigbluebuttonbn[$setting])) { |
102 | - return (string) $CFG->bigbluebuttonbn[$setting]; |
|
102 | + return (string)$CFG->bigbluebuttonbn[$setting]; |
|
103 | 103 | } |
104 | - if (isset($CFG->{'bigbluebuttonbn_'.$setting})) { |
|
105 | - return (string)$CFG->{'bigbluebuttonbn_'.$setting}; |
|
104 | + if (isset($CFG->{'bigbluebuttonbn_' . $setting})) { |
|
105 | + return (string)$CFG->{'bigbluebuttonbn_' . $setting}; |
|
106 | 106 | } |
107 | 107 | return self::defaultvalue($setting); |
108 | 108 | } |
@@ -85,10 +85,10 @@ |
||
85 | 85 | // Migrate settings. |
86 | 86 | unset_config('recordingtagging_default', 'mod_bigbluebuttonbn'); |
87 | 87 | unset_config('recordingtagging_editable', 'mod_bigbluebuttonbn'); |
88 | - $cfgvalue = get_config('mod_bigbluebuttonbn', 'importrecordings_from_deleted_activities_enabled'); |
|
88 | + $cfgvalue = get_config('mod_bigbluebuttonbn', 'importrecordings_from_deleted_activities_enabled'); |
|
89 | 89 | set_config('importrecordings_from_deleted_enabled', $cfgvalue, 'mod_bigbluebuttonbn'); |
90 | 90 | unset_config('importrecordings_from_deleted_activities_enabled', 'mod_bigbluebuttonbn'); |
91 | - $cfgvalue = get_config('mod_bigbluebuttonbn', 'moderator_default'); |
|
91 | + $cfgvalue = get_config('mod_bigbluebuttonbn', 'moderator_default'); |
|
92 | 92 | set_config('participant_moderator_default', $cfgvalue, 'mod_bigbluebuttonbn'); |
93 | 93 | unset_config('moderator_default', 'mod_bigbluebuttonbn'); |
94 | 94 | // Update db version tag. |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v2 or later |
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 | $id = required_param('id', PARAM_INT); |
30 | 30 | $bn = optional_param('n', 0, PARAM_INT); |
@@ -56,21 +56,21 @@ discard block |
||
56 | 56 | if (is_null($serverversion)) { |
57 | 57 | if ($bbbsession['administrator']) { |
58 | 58 | print_error('view_error_unable_join', 'bigbluebuttonbn', |
59 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
59 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
60 | 60 | exit; |
61 | 61 | } |
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 | |
69 | 69 | print_error('view_error_unable_join_student', 'bigbluebuttonbn', |
70 | - $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course); |
|
70 | + $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course); |
|
71 | 71 | exit; |
72 | 72 | } |
73 | -$bbbsession['serverversion'] = (string) $serverversion; |
|
73 | +$bbbsession['serverversion'] = (string)$serverversion; |
|
74 | 74 | |
75 | 75 | // Mark viewed by user (if required). |
76 | 76 | $completion = new completion_info($course); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | |
79 | 79 | // Print the page header. |
80 | 80 | $PAGE->set_context($context); |
81 | -$PAGE->set_url($CFG->wwwroot.'/mod/bigbluebuttonbn/view.php', array('id' => $cm->id)); |
|
81 | +$PAGE->set_url($CFG->wwwroot . '/mod/bigbluebuttonbn/view.php', array('id' => $cm->id)); |
|
82 | 82 | $PAGE->set_title(format_string($bigbluebuttonbn->name)); |
83 | 83 | $PAGE->set_cacheable(false); |
84 | 84 | $PAGE->set_heading($course->fullname); |
@@ -88,11 +88,11 @@ discard block |
||
88 | 88 | if (!has_capability('moodle/category:manage', $context) && !has_capability('mod/bigbluebuttonbn:join', $context)) { |
89 | 89 | echo $OUTPUT->header(); |
90 | 90 | if (isguestuser()) { |
91 | - echo $OUTPUT->confirm('<p>'.get_string('view_noguests', 'bigbluebuttonbn').'</p>'.get_string('liketologin'), |
|
92 | - get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id); |
|
91 | + echo $OUTPUT->confirm('<p>' . get_string('view_noguests', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'), |
|
92 | + get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id); |
|
93 | 93 | } else { |
94 | - echo $OUTPUT->confirm('<p>'.get_string('view_nojoin', 'bigbluebuttonbn').'</p>'.get_string('liketologin'), |
|
95 | - get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id); |
|
94 | + echo $OUTPUT->confirm('<p>' . get_string('view_nojoin', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'), |
|
95 | + get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id); |
|
96 | 96 | } |
97 | 97 | echo $OUTPUT->footer(); |
98 | 98 | exit; |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | |
101 | 101 | // Operation URLs. |
102 | 102 | $bbbsession['bigbluebuttonbnURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id; |
103 | -$bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id='.$id . |
|
103 | +$bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id=' . $id . |
|
104 | 104 | '&bn=' . $bbbsession['bigbluebuttonbn']->id; |
105 | 105 | $bbbsession['recordingReadyURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_broker.php?action=recording_' . |
106 | 106 | 'ready&bigbluebuttonbn=' . $bbbsession['bigbluebuttonbn']->id; |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | echo $OUTPUT->footer(); |
121 | 121 | |
122 | 122 | // Shows version as a comment. |
123 | -echo '<!-- '.$bbbsession['originTag'].' -->'."\n"; |
|
123 | +echo '<!-- ' . $bbbsession['originTag'] . ' -->' . "\n"; |
|
124 | 124 | |
125 | 125 | // Initialize session variable used across views. |
126 | 126 | $SESSION->bigbluebuttonbn_bbbsession = $bbbsession; |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $bbbsession['viewerPW'] = $bigbluebuttonbn->viewerpass; |
151 | 151 | |
152 | 152 | // Database info related to the activity. |
153 | - $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'. |
|
153 | + $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' . |
|
154 | 154 | $bbbsession['bigbluebuttonbn']->id; |
155 | 155 | $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name; |
156 | 156 | $bbbsession['meetingdescription'] = $bigbluebuttonbn->intro; |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | $bbbsession['welcome'] = get_string('mod_form_field_welcome_default', 'bigbluebuttonbn'); |
172 | 172 | } |
173 | 173 | if ($bigbluebuttonbn->record) { |
174 | - $bbbsession['welcome'] .= '<br><br>'.get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
|
174 | + $bbbsession['welcome'] .= '<br><br>' . get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | $bbbsession['openingtime'] = $bigbluebuttonbn->openingtime; |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | $bbbsession['originServerName'] = $parsedurl['host']; |
188 | 188 | $bbbsession['originServerUrl'] = $CFG->wwwroot; |
189 | 189 | $bbbsession['originServerCommonName'] = ''; |
190 | - $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn ('.get_config('mod_bigbluebuttonbn', 'version').')'; |
|
190 | + $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn (' . get_config('mod_bigbluebuttonbn', 'version') . ')'; |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | function bigbluebuttonbn_view_bbbsession_roles($context, $userid) { |
@@ -249,9 +249,9 @@ discard block |
||
249 | 249 | } |
250 | 250 | |
251 | 251 | // Assign group default values. |
252 | - $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'. |
|
253 | - $bbbsession['bigbluebuttonbn']->id.'['.$bbbsession['group'].']'; |
|
254 | - $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name.' ('.$groupname.')'; |
|
252 | + $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' . |
|
253 | + $bbbsession['bigbluebuttonbn']->id . '[' . $bbbsession['group'] . ']'; |
|
254 | + $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name . ' (' . $groupname . ')'; |
|
255 | 255 | |
256 | 256 | if (count($groups) == 0) { |
257 | 257 | // Only the All participants group exists. |
@@ -267,11 +267,11 @@ discard block |
||
267 | 267 | bigbluebuttonbn_view_message_box($bbbsession, get_string('view_groups_selection_warning', 'bigbluebuttonbn'), 'warning'); |
268 | 268 | |
269 | 269 | groups_print_activity_menu( |
270 | - $bbbsession['cm'], $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bbbsession['cm']->id); |
|
270 | + $bbbsession['cm'], $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id); |
|
271 | 271 | echo '<br><br>'; |
272 | 272 | } |
273 | 273 | |
274 | -function bigbluebuttonbn_view_message_box(&$bbbsession, $message, $type='warning', $onlymoderator=false) { |
|
274 | +function bigbluebuttonbn_view_message_box(&$bbbsession, $message, $type = 'warning', $onlymoderator = false) { |
|
275 | 275 | global $OUTPUT; |
276 | 276 | if ($onlymoderator && !$bbbsession['moderator'] && !$bbbsession['administrator']) { |
277 | 277 | return; |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | 'M.mod_bigbluebuttonbn.recordings.init', array($jsvars)); |
321 | 321 | } |
322 | 322 | |
323 | - echo $output.html_writer::empty_tag('br').html_writer::empty_tag('br').html_writer::empty_tag('br'); |
|
323 | + echo $output . html_writer::empty_tag('br') . html_writer::empty_tag('br') . html_writer::empty_tag('br'); |
|
324 | 324 | $PAGE->requires->yui_module('moodle-mod_bigbluebuttonbn-broker', 'M.mod_bigbluebuttonbn.broker.init', array($jsvars)); |
325 | 325 | } |
326 | 326 | |
@@ -344,21 +344,21 @@ discard block |
||
344 | 344 | return $output; |
345 | 345 | } |
346 | 346 | |
347 | -function bigbluebuttonbn_view_render_warning($message, $type='info', $href='', $text='', $class='') { |
|
347 | +function bigbluebuttonbn_view_render_warning($message, $type = 'info', $href = '', $text = '', $class = '') { |
|
348 | 348 | global $OUTPUT; |
349 | 349 | $output = "\n"; |
350 | 350 | // Evaluates if config_warning is enabled. |
351 | 351 | if (empty($message)) { |
352 | 352 | return $output; |
353 | 353 | } |
354 | - $output .= $OUTPUT->box_start('box boxalignleft adminerror alert alert-' . $type . ' alert-block fade in', 'bigbluebuttonbn_view_general_warning')."\n"; |
|
355 | - $output .= ' <button type="button" class="close" data-dismiss="alert">×</button>'.$message."\n"; |
|
356 | - $output .= ' <div class="singlebutton">'."\n"; |
|
354 | + $output .= $OUTPUT->box_start('box boxalignleft adminerror alert alert-' . $type . ' alert-block fade in', 'bigbluebuttonbn_view_general_warning') . "\n"; |
|
355 | + $output .= ' <button type="button" class="close" data-dismiss="alert">×</button>' . $message . "\n"; |
|
356 | + $output .= ' <div class="singlebutton">' . "\n"; |
|
357 | 357 | if (!empty($href)) { |
358 | 358 | $output .= bigbluebutton_view_render_general_warning_button($href, $text, $class); |
359 | 359 | } |
360 | - $output .= ' </div>'."\n"; |
|
361 | - $output .= $OUTPUT->box_end()."\n"; |
|
360 | + $output .= ' </div>' . "\n"; |
|
361 | + $output .= $OUTPUT->box_end() . "\n"; |
|
362 | 362 | return $output; |
363 | 363 | } |
364 | 364 | |
@@ -369,11 +369,11 @@ discard block |
||
369 | 369 | if ($class == '') { |
370 | 370 | $class = 'btn btn-secondary'; |
371 | 371 | } |
372 | - $output = ' <form method="post" action="' . $href . '" class="form-inline">'."\n"; |
|
373 | - $output .= ' <button type="submit" class="' . $class . '"'."\n"; |
|
374 | - $output .= ' title=""'."\n"; |
|
375 | - $output .= ' >' . $text . '</button>'."\n"; |
|
376 | - $output .= ' </form>'."\n"; |
|
372 | + $output = ' <form method="post" action="' . $href . '" class="form-inline">' . "\n"; |
|
373 | + $output .= ' <button type="submit" class="' . $class . '"' . "\n"; |
|
374 | + $output .= ' title=""' . "\n"; |
|
375 | + $output .= ' >' . $text . '</button>' . "\n"; |
|
376 | + $output .= ' </form>' . "\n"; |
|
377 | 377 | return $output; |
378 | 378 | } |
379 | 379 | |
@@ -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 | |
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 | |
411 | 411 | if ($activity == 'ended') { |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | |
432 | 432 | // Get recordings. |
433 | 433 | $recordings = array(); |
434 | - if ( bigbluebuttonbn_view_include_recordings($bbbsession) ) { |
|
434 | + if (bigbluebuttonbn_view_include_recordings($bbbsession)) { |
|
435 | 435 | $recordings = bigbluebuttonbn_get_recordings( |
436 | 436 | $bbbsession['course']->id, $bigbluebuttonbnid, $showroom, |
437 | 437 | $bbbsession['bigbluebuttonbn']->recordings_deleted |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | // If there are meetings with recordings load the data to the table. |
463 | 463 | if ($bbbsession['bigbluebuttonbn']->recordings_html) { |
464 | 464 | // Render a plain html table. |
465 | - return bigbluebutton_output_recording_table($bbbsession, $recordings)."\n"; |
|
465 | + return bigbluebutton_output_recording_table($bbbsession, $recordings) . "\n"; |
|
466 | 466 | } |
467 | 467 | |
468 | 468 | // JavaScript variables for recordings with YUI. |
@@ -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::start_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')); |
@@ -498,10 +498,10 @@ discard block |
||
498 | 498 | $attributes = array('title' => $bbbsession['presentation']['name']); |
499 | 499 | $icon = new pix_icon($bbbsession['presentation']['icon'], $bbbsession['presentation']['mimetype_description']); |
500 | 500 | |
501 | - return '<h4>'.get_string('view_section_title_presentation', 'bigbluebuttonbn').'</h4>'. |
|
502 | - ''.$OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false).''. |
|
503 | - ''.$OUTPUT->action_link($bbbsession['presentation']['url'], |
|
504 | - $bbbsession['presentation']['name'], null, $attributes).'<br><br>'; |
|
501 | + return '<h4>' . get_string('view_section_title_presentation', 'bigbluebuttonbn') . '</h4>' . |
|
502 | + '' . $OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false) . '' . |
|
503 | + '' . $OUTPUT->action_link($bbbsession['presentation']['url'], |
|
504 | + $bbbsession['presentation']['name'], null, $attributes) . '<br><br>'; |
|
505 | 505 | } |
506 | 506 | |
507 | 507 | return ''; |