@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | * recordings from a different activity even from a different course. |
| 99 | 99 | **/ |
| 100 | 100 | |
| 101 | - /* |
|
| 101 | + /* |
|
| 102 | 102 | * When the value is set to 1 (checked) the bigbluebuttonbn rooms or |
| 103 | 103 | * activities will have the 'import recordings' capability enabled. |
| 104 | 104 | * $CFG->bigbluebuttonbn['importrecordings_enabled'] = 0; |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | * 'Join session' button enabled |
| 120 | 120 | **/ |
| 121 | 121 | |
| 122 | - /* |
|
| 122 | + /* |
|
| 123 | 123 | * When the value is set to 1 (checked) the bigbluebuttonbn rooms or |
| 124 | 124 | * activities will have the 'wait for moderator' capability enabled by |
| 125 | 125 | * default. |
@@ -259,13 +259,13 @@ discard block |
||
| 259 | 259 | * $CFG->bigbluebuttonbn['recordings_imported_editable'] = 1; |
| 260 | 260 | */ |
| 261 | 261 | |
| 262 | - /* |
|
| 262 | + /* |
|
| 263 | 263 | * When the value is set to 1 (checked) the bigbluebuttonbn resources |
| 264 | 264 | * will show the recodings with thumbnails. |
| 265 | 265 | * $CFG->bigbluebuttonbn['recordings_preview_default'] = 1; |
| 266 | 266 | */ |
| 267 | 267 | |
| 268 | - /* |
|
| 268 | + /* |
|
| 269 | 269 | * When the value is set to 1 (checked) the 'preview ui' capability can be |
| 270 | 270 | * enabled/disabled by the user creating or editing the resource. |
| 271 | 271 | * $CFG->bigbluebuttonbn['recordings_preview_editable'] = 0; |
@@ -310,27 +310,27 @@ discard block |
||
| 310 | 310 | * $CFG->bigbluebuttonbn['general_warning_message'] = "Would you like to record your BigBlueButton sessions for later viewing? "; |
| 311 | 311 | */ |
| 312 | 312 | |
| 313 | - /* |
|
| 313 | + /* |
|
| 314 | 314 | * The warning box is always shown to administrators, but it is also possible to define other roles |
| 315 | 315 | * to whom the it will be shown. The roles are based on the shortnames defined by Moodle: |
| 316 | 316 | * 'manager,coursecreator,editingteacher,teacher,student,guest,user,frontpage' |
| 317 | 317 | * $CFG->bigbluebuttonbn['general_warning_roles'] = 'editingteacher,teacher'; |
| 318 | 318 | */ |
| 319 | 319 | |
| 320 | - /* |
|
| 320 | + /* |
|
| 321 | 321 | * As the general_warning_message is shown in a box, its type can be defined with general_warning_type |
| 322 | 322 | * The default type is 'info' which is normaly rendered in blue when using a bootstrap theme. |
| 323 | 323 | * All the modifiers for boxed in bootstrap can be used [info|success|warning|danger]. |
| 324 | 324 | * $CFG->bigbluebuttonbn['general_warning_box_type'] = 'info'; |
| 325 | 325 | */ |
| 326 | 326 | |
| 327 | - /* |
|
| 327 | + /* |
|
| 328 | 328 | * Additionally, when general_warning_button_href value is different than "", a button |
| 329 | 329 | * can also be shown right after the message. |
| 330 | 330 | * $CFG->bigbluebuttonbn['general_warning_button_href'] = "http://blindsidenetworks.com/"; |
| 331 | 331 | */ |
| 332 | 332 | |
| 333 | - /* |
|
| 333 | + /* |
|
| 334 | 334 | * Finally, the text and class for the button can be modified |
| 335 | 335 | * $CFG->bigbluebuttonbn['general_warning_button_text'] = "Upgrade your site"; |
| 336 | 336 | * $CFG->bigbluebuttonbn['general_warning_button_class'] = "btn btn-primary"; |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | defined('MOODLE_INTERNAL') || die(); |
| 29 | 29 | |
| 30 | 30 | require_once($CFG->dirroot . '/mod/bigbluebuttonbn/locallib.php'); |
| 31 | -require_once($CFG->libdir.'/adminlib.php'); |
|
| 31 | +require_once($CFG->libdir . '/adminlib.php'); |
|
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * Helper class for rendering HTML for settings.php. |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | $itemname = get_string('config_' . $name, 'bigbluebuttonbn'); |
| 67 | 67 | } |
| 68 | 68 | if ($itemdescription === null) { |
| 69 | - $itemdescription = get_string('config_' .$name . '_description', 'bigbluebuttonbn'); |
|
| 69 | + $itemdescription = get_string('config_' . $name . '_description', 'bigbluebuttonbn'); |
|
| 70 | 70 | } |
| 71 | 71 | $item = new \admin_setting_heading('bigbluebuttonbn_config_' . $name, $itemname, $itemdescription); |
| 72 | 72 | $this->settings->add($item); |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | public function render_warning_message($name, $message, $type = 'warning', $closable = true) { |
| 149 | 149 | global $OUTPUT; |
| 150 | 150 | $output = $OUTPUT->box_start('box boxalignleft adminerror alert alert-' . $type . ' alert-block fade in', |
| 151 | - 'bigbluebuttonbn_' . $name)."\n"; |
|
| 151 | + 'bigbluebuttonbn_' . $name) . "\n"; |
|
| 152 | 152 | if ($closable) { |
| 153 | 153 | $output .= ' <button type="button" class="close" data-dismiss="alert">×</button>' . "\n"; |
| 154 | 154 | } |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | $params .= '&' . $key . '=' . urlencode($value); |
| 53 | 53 | } |
| 54 | 54 | foreach ($metadata as $key => $value) { |
| 55 | - $params .= '&' . 'meta_' . $key.'=' . urlencode($value); |
|
| 55 | + $params .= '&' . 'meta_' . $key . '=' . urlencode($value); |
|
| 56 | 56 | } |
| 57 | 57 | return $baseurl . $params . '&checksum=' . sha1($action . $params . self::sanitized_secret()); |
| 58 | 58 | } |
@@ -437,26 +437,26 @@ discard block |
||
| 437 | 437 | return array( |
| 438 | 438 | 'status' => false, |
| 439 | 439 | 'message' => get_string('view_recording_publish_link_deleted', 'bigbluebuttonbn') |
| 440 | - ); |
|
| 440 | + ); |
|
| 441 | 441 | } |
| 442 | 442 | if ($realrecordings[$params['id']]['published'] !== 'true') { |
| 443 | 443 | return array( |
| 444 | 444 | 'status' => false, |
| 445 | 445 | 'message' => get_string('view_recording_publish_link_not_published', 'bigbluebuttonbn') |
| 446 | - ); |
|
| 446 | + ); |
|
| 447 | 447 | } |
| 448 | 448 | return array( |
| 449 | 449 | 'status' => bigbluebuttonbn_publish_recording_imported( |
| 450 | 450 | $recordings[$params['id']]['imported'], true |
| 451 | 451 | ) |
| 452 | - ); |
|
| 452 | + ); |
|
| 453 | 453 | } |
| 454 | 454 | // As the recordingid was not identified as imported recording link, execute actual publish. |
| 455 | 455 | return array( |
| 456 | 456 | 'status' => bigbluebuttonbn_publish_recordings( |
| 457 | 457 | $params['id'], 'true' |
| 458 | 458 | ) |
| 459 | - ); |
|
| 459 | + ); |
|
| 460 | 460 | } |
| 461 | 461 | |
| 462 | 462 | /** |
@@ -477,26 +477,26 @@ discard block |
||
| 477 | 477 | return array( |
| 478 | 478 | 'status' => false, |
| 479 | 479 | 'message' => get_string('view_recording_unprotect_link_deleted', 'bigbluebuttonbn') |
| 480 | - ); |
|
| 480 | + ); |
|
| 481 | 481 | } |
| 482 | 482 | if ($realrecordings[$params['id']]['protected'] === 'true') { |
| 483 | 483 | return array( |
| 484 | 484 | 'status' => false, |
| 485 | 485 | 'message' => get_string('view_recording_unprotect_link_not_unprotected', 'bigbluebuttonbn') |
| 486 | - ); |
|
| 486 | + ); |
|
| 487 | 487 | } |
| 488 | 488 | return array( |
| 489 | 489 | 'status' => bigbluebuttonbn_protect_recording_imported( |
| 490 | 490 | $recordings[$params['id']]['imported'], false |
| 491 | 491 | ) |
| 492 | - ); |
|
| 492 | + ); |
|
| 493 | 493 | } |
| 494 | 494 | // As the recordingid was not identified as imported recording link, execute actual uprotect. |
| 495 | 495 | return array( |
| 496 | 496 | 'status' => bigbluebuttonbn_update_recordings( |
| 497 | 497 | $params['id'], array('protect' => 'false') |
| 498 | 498 | ) |
| 499 | - ); |
|
| 499 | + ); |
|
| 500 | 500 | } |
| 501 | 501 | |
| 502 | 502 | /** |
@@ -515,7 +515,7 @@ discard block |
||
| 515 | 515 | 'status' => bigbluebuttonbn_publish_recording_imported( |
| 516 | 516 | $recordings[$params['id']]['imported'], false |
| 517 | 517 | ) |
| 518 | - ); |
|
| 518 | + ); |
|
| 519 | 519 | } |
| 520 | 520 | // As the recordingid was not identified as imported recording link, execute unpublish on a real recording. |
| 521 | 521 | // First: Unpublish imported links associated to the recording. |
@@ -533,7 +533,7 @@ discard block |
||
| 533 | 533 | 'status' => bigbluebuttonbn_publish_recordings( |
| 534 | 534 | $params['id'], 'false' |
| 535 | 535 | ) |
| 536 | - ); |
|
| 536 | + ); |
|
| 537 | 537 | } |
| 538 | 538 | |
| 539 | 539 | /** |
@@ -552,7 +552,7 @@ discard block |
||
| 552 | 552 | 'status' => bigbluebuttonbn_protect_recording_imported( |
| 553 | 553 | $recordings[$params['id']]['imported'], true |
| 554 | 554 | ) |
| 555 | - ); |
|
| 555 | + ); |
|
| 556 | 556 | } |
| 557 | 557 | // As the recordingid was not identified as imported recording link, execute protect on a real recording. |
| 558 | 558 | // First: Protect imported links associated to the recording. |
@@ -570,7 +570,7 @@ discard block |
||
| 570 | 570 | 'status' => bigbluebuttonbn_update_recordings( |
| 571 | 571 | $params['id'], array('protect' => 'true') |
| 572 | 572 | ) |
| 573 | - ); |
|
| 573 | + ); |
|
| 574 | 574 | } |
| 575 | 575 | |
| 576 | 576 | /** |
@@ -589,7 +589,7 @@ discard block |
||
| 589 | 589 | 'status' => bigbluebuttonbn_delete_recording_imported( |
| 590 | 590 | $recordings[$params['id']]['imported'] |
| 591 | 591 | ) |
| 592 | - ); |
|
| 592 | + ); |
|
| 593 | 593 | } |
| 594 | 594 | // As the recordingid was not identified as imported recording link, execute delete on a real recording. |
| 595 | 595 | // First: Delete imported links associated to the recording. |
@@ -603,7 +603,7 @@ discard block |
||
| 603 | 603 | // Second: Execute the actual delete. |
| 604 | 604 | return array( |
| 605 | 605 | 'status' => bigbluebuttonbn_delete_recordings($params['id']) |
| 606 | - ); |
|
| 606 | + ); |
|
| 607 | 607 | } |
| 608 | 608 | |
| 609 | 609 | /** |
@@ -621,7 +621,7 @@ discard block |
||
| 621 | 621 | 'status' => bigbluebuttonbn_update_recording_imported( |
| 622 | 622 | $recordings[$params['id']]['imported'], json_decode($params['meta'], true) |
| 623 | 623 | ) |
| 624 | - ); |
|
| 624 | + ); |
|
| 625 | 625 | } |
| 626 | 626 | |
| 627 | 627 | // As the recordingid was not identified as imported recording link, execute update on a real recording. |
@@ -631,7 +631,7 @@ discard block |
||
| 631 | 631 | 'status' => bigbluebuttonbn_update_recordings( |
| 632 | 632 | $params['id'], json_decode($params['meta']) |
| 633 | 633 | ) |
| 634 | - ); |
|
| 634 | + ); |
|
| 635 | 635 | } |
| 636 | 636 | |
| 637 | 637 | /** |
@@ -802,10 +802,10 @@ discard block |
||
| 802 | 802 | $params['recording_import'] = ['id' => 'The recordingID must be specified.']; |
| 803 | 803 | $params['recording_ready'] = [ |
| 804 | 804 | 'signed_parameters' => 'A JWT encoded string must be included as [signed_parameters].' |
| 805 | - ]; |
|
| 805 | + ]; |
|
| 806 | 806 | $params['live_session_events'] = [ |
| 807 | 807 | 'signed_parameters' => 'A JWT encoded string must be included as [signed_parameters].' |
| 808 | - ]; |
|
| 808 | + ]; |
|
| 809 | 809 | return $params; |
| 810 | 810 | } |
| 811 | 811 | |
@@ -23,8 +23,8 @@ discard block |
||
| 23 | 23 | * @author Jesus Federico (jesus [at] blindsidenetworks [dt] com) |
| 24 | 24 | */ |
| 25 | 25 | |
| 26 | -require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); |
|
| 27 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
| 26 | +require_once(dirname(dirname(dirname(__FILE__))) . '/config.php'); |
|
| 27 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
| 28 | 28 | |
| 29 | 29 | use \Firebase\JWT\JWT; |
| 30 | 30 | |
@@ -42,13 +42,13 @@ discard block |
||
| 42 | 42 | require_login(0, false); |
| 43 | 43 | |
| 44 | 44 | if (empty($params['action'])) { |
| 45 | - header('HTTP/1.0 400 Bad Request. Parameter ['.$params['action'].'] was not included'); |
|
| 45 | + header('HTTP/1.0 400 Bad Request. Parameter [' . $params['action'] . '] was not included'); |
|
| 46 | 46 | return; |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | $error = bigbluebuttonbn_broker_validate_parameters($params); |
| 50 | 50 | if (!empty($error)) { |
| 51 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
| 51 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
| 52 | 52 | return; |
| 53 | 53 | } |
| 54 | 54 | |
@@ -132,11 +132,11 @@ discard block |
||
| 132 | 132 | bigbluebuttonbn_broker_live_session_events($params, $bigbluebuttonbn, $cm); |
| 133 | 133 | return; |
| 134 | 134 | } |
| 135 | - header('HTTP/1.0 400 Bad request. The action '. $a . ' doesn\'t exist'); |
|
| 135 | + header('HTTP/1.0 400 Bad request. The action ' . $a . ' doesn\'t exist'); |
|
| 136 | 136 | return; |
| 137 | 137 | |
| 138 | 138 | } catch (Exception $e) { |
| 139 | - header('HTTP/1.0 500 Internal Server Error. '.$e->getMessage()); |
|
| 139 | + header('HTTP/1.0 500 Internal Server Error. ' . $e->getMessage()); |
|
| 140 | 140 | return; |
| 141 | 141 | } |
| 142 | 142 | |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | function bigbluebuttonbn_broker_recording_info_current($recording, $params) { |
| 323 | 323 | $callbackresponse['status'] = true; |
| 324 | 324 | $callbackresponse['found'] = true; |
| 325 | - $callbackresponse['published'] = (string) $recording['published']; |
|
| 325 | + $callbackresponse['published'] = (string)$recording['published']; |
|
| 326 | 326 | if (!isset($params['meta']) || empty($params['meta'])) { |
| 327 | 327 | return $callbackresponse; |
| 328 | 328 | } |
@@ -650,8 +650,8 @@ discard block |
||
| 650 | 650 | $decodedparameters = JWT::decode($params['signed_parameters'], |
| 651 | 651 | \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256')); |
| 652 | 652 | } catch (Exception $e) { |
| 653 | - $error = 'Caught exception: '.$e->getMessage(); |
|
| 654 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
| 653 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
| 654 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
| 655 | 655 | return; |
| 656 | 656 | } |
| 657 | 657 | // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received. |
@@ -667,8 +667,8 @@ discard block |
||
| 667 | 667 | bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn); |
| 668 | 668 | header('HTTP/1.0 202 Accepted'); |
| 669 | 669 | } catch (Exception $e) { |
| 670 | - $error = 'Caught exception: '.$e->getMessage(); |
|
| 671 | - header('HTTP/1.0 503 Service Unavailable. '.$error); |
|
| 670 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
| 671 | + header('HTTP/1.0 503 Service Unavailable. ' . $error); |
|
| 672 | 672 | } |
| 673 | 673 | } |
| 674 | 674 | |
@@ -689,13 +689,13 @@ discard block |
||
| 689 | 689 | $importrecordings = $SESSION->bigbluebuttonbn_importrecordings; |
| 690 | 690 | if (!isset($importrecordings[$params['id']])) { |
| 691 | 691 | $error = "Recording {$params['id']} could not be found. It can not be imported"; |
| 692 | - header('HTTP/1.0 404 Not found. '.$error); |
|
| 692 | + header('HTTP/1.0 404 Not found. ' . $error); |
|
| 693 | 693 | return; |
| 694 | 694 | } |
| 695 | 695 | $callbackresponse = array('status' => true); |
| 696 | 696 | $importrecordings[$params['id']]['imported'] = true; |
| 697 | 697 | $overrides = array('meetingid' => $importrecordings[$params['id']]['meetingID']); |
| 698 | - $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}'; |
|
| 698 | + $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}'; |
|
| 699 | 699 | bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta); |
| 700 | 700 | // Moodle event logger: Create an event for recording imported. |
| 701 | 701 | if (isset($bbbsession['bigbluebutton']) && isset($bbbsession['cm'])) { |
@@ -721,8 +721,8 @@ discard block |
||
| 721 | 721 | $decodedparameters = JWT::decode($params['signed_parameters'], |
| 722 | 722 | \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256')); |
| 723 | 723 | } catch (Exception $e) { |
| 724 | - $error = 'Caught exception: '.$e->getMessage(); |
|
| 725 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
| 724 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
| 725 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
| 726 | 726 | return; |
| 727 | 727 | } |
| 728 | 728 | // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received. |
@@ -763,7 +763,7 @@ discard block |
||
| 763 | 763 | } |
| 764 | 764 | $action = strtolower($params['action']); |
| 765 | 765 | if (!array_key_exists($action, $requiredparams)) { |
| 766 | - return 'Action '.$params['action'].' can not be performed.'; |
|
| 766 | + return 'Action ' . $params['action'] . ' can not be performed.'; |
|
| 767 | 767 | } |
| 768 | 768 | return bigbluebuttonbn_broker_validate_parameters_message($params, $requiredparams[$action]); |
| 769 | 769 | } |
@@ -205,7 +205,7 @@ |
||
| 205 | 205 | !isset($CFG->bigbluebuttonbn['recordings_imported_editable']) || |
| 206 | 206 | !isset($CFG->bigbluebuttonbn['recordings_preview_default']) || |
| 207 | 207 | !isset($CFG->bigbluebuttonbn['recordings_preview_editable']) |
| 208 | - ); |
|
| 208 | + ); |
|
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | /** |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | defined('MOODLE_INTERNAL') || die(); |
| 29 | 29 | |
| 30 | 30 | require_once($CFG->dirroot . '/mod/bigbluebuttonbn/locallib.php'); |
| 31 | -require_once($CFG->libdir.'/adminlib.php'); |
|
| 31 | +require_once($CFG->libdir . '/adminlib.php'); |
|
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * Helper class for validating settings used HTML for settings.php. |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | */ |
| 41 | 41 | protected function init() { |
| 42 | 42 | parent::init(); |
| 43 | - $this->description = "The user with id '##userid' viewed the bigbluebuttonbn activity management page for ". |
|
| 43 | + $this->description = "The user with id '##userid' viewed the bigbluebuttonbn activity management page for " . |
|
| 44 | 44 | "the course module id '##contextinstanceid'."; |
| 45 | 45 | } |
| 46 | 46 | |
@@ -80,7 +80,7 @@ |
||
| 80 | 80 | 'objectid' => $this->objectid, |
| 81 | 81 | 'contextinstanceid' => $this->contextinstanceid, |
| 82 | 82 | 'other' => $this->other |
| 83 | - ); |
|
| 83 | + ); |
|
| 84 | 84 | $string = $this->description; |
| 85 | 85 | foreach ($vars as $key => $value) { |
| 86 | 86 | $string = str_replace("##" . $key, $value, $string); |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | |
| 27 | 27 | defined('MOODLE_INTERNAL') || die(); |
| 28 | 28 | |
| 29 | -require_once(dirname(dirname(__FILE__)).'/locallib.php'); |
|
| 29 | +require_once(dirname(dirname(__FILE__)) . '/locallib.php'); |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * Performs data migrations and updates on upgrade. |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | * Helper function to retrieve imported recordings from the Moodle database. |
| 263 | 263 | * The references are stored as events in bigbluebuttonbn_logs. |
| 264 | 264 | * |
| 265 | - * @param string $courseid |
|
| 265 | + * @param integer $courseid |
|
| 266 | 266 | * @param string $bigbluebuttonbnid |
| 267 | 267 | * @param bool $subset |
| 268 | 268 | * |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | /** |
| 291 | 291 | * Helper function to retrive the default config.xml file. |
| 292 | 292 | * |
| 293 | - * @return string |
|
| 293 | + * @return null|SimpleXMLElement |
|
| 294 | 294 | */ |
| 295 | 295 | function bigbluebuttonbn_get_default_config_xml() { |
| 296 | 296 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
@@ -372,7 +372,7 @@ discard block |
||
| 372 | 372 | * @param object $a |
| 373 | 373 | * @param object $b |
| 374 | 374 | * |
| 375 | - * @return array |
|
| 375 | + * @return integer |
|
| 376 | 376 | */ |
| 377 | 377 | function bigbluebuttonbn_recording_build_sorter($a, $b) { |
| 378 | 378 | if ($a['startTime'] < $b['startTime']) { |
@@ -498,7 +498,7 @@ discard block |
||
| 498 | 498 | * @param string $data |
| 499 | 499 | * @param string $contenttype |
| 500 | 500 | * |
| 501 | - * @return object |
|
| 501 | + * @return null|SimpleXMLElement |
|
| 502 | 502 | */ |
| 503 | 503 | function bigbluebuttonbn_wrap_xml_load_file($url, $method = 'GET', $data = null, $contenttype = 'text/xml') { |
| 504 | 504 | if (extension_loaded('curl')) { |
@@ -539,7 +539,7 @@ discard block |
||
| 539 | 539 | * @param string $data |
| 540 | 540 | * @param string $contenttype |
| 541 | 541 | * |
| 542 | - * @return object |
|
| 542 | + * @return string |
|
| 543 | 543 | */ |
| 544 | 544 | function bigbluebuttonbn_wrap_xml_load_file_curl_request($url, $method = 'GET', $data = null, $contenttype = 'text/xml') { |
| 545 | 545 | $c = new curl(); |
@@ -904,7 +904,7 @@ discard block |
||
| 904 | 904 | * @param integer $instance |
| 905 | 905 | * @param integer $voicebridge |
| 906 | 906 | * |
| 907 | - * @return string |
|
| 907 | + * @return boolean |
|
| 908 | 908 | */ |
| 909 | 909 | function bigbluebuttonbn_voicebridge_unique($instance, $voicebridge) { |
| 910 | 910 | global $DB; |
@@ -1170,7 +1170,7 @@ discard block |
||
| 1170 | 1170 | * @param string $meetingid |
| 1171 | 1171 | * @param string $configxml |
| 1172 | 1172 | * |
| 1173 | - * @return object |
|
| 1173 | + * @return null|SimpleXMLElement |
|
| 1174 | 1174 | */ |
| 1175 | 1175 | function bigbluebuttonbn_set_config_xml($meetingid, $configxml) { |
| 1176 | 1176 | $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?'; |
@@ -1219,7 +1219,7 @@ discard block |
||
| 1219 | 1219 | * @param array $recording |
| 1220 | 1220 | * @param array $tools |
| 1221 | 1221 | * |
| 1222 | - * @return array |
|
| 1222 | + * @return null|stdClass |
|
| 1223 | 1223 | */ |
| 1224 | 1224 | function bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools = ['protect', 'publish', 'delete']) { |
| 1225 | 1225 | if (!bigbluebuttonbn_include_recording_table_row($bbbsession, $recording)) { |
@@ -1723,7 +1723,7 @@ discard block |
||
| 1723 | 1723 | * |
| 1724 | 1724 | * @param array $bbbsession |
| 1725 | 1725 | * @param array $recording |
| 1726 | - * @param object $rowdata |
|
| 1726 | + * @param stdClass $rowdata |
|
| 1727 | 1727 | * |
| 1728 | 1728 | * @return object |
| 1729 | 1729 | */ |
@@ -1918,7 +1918,7 @@ discard block |
||
| 1918 | 1918 | * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included |
| 1919 | 1919 | * in the getRecordings request considering only those that belong to deleted activities. |
| 1920 | 1920 | * |
| 1921 | - * @param string $courseid |
|
| 1921 | + * @param integer $courseid |
|
| 1922 | 1922 | * @param string $bigbluebuttonbnid |
| 1923 | 1923 | * @param bool $subset |
| 1924 | 1924 | * |
@@ -1942,7 +1942,7 @@ discard block |
||
| 1942 | 1942 | * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included |
| 1943 | 1943 | * in the getRecordings request considering only those that belong to imported recordings. |
| 1944 | 1944 | * |
| 1945 | - * @param string $courseid |
|
| 1945 | + * @param integer $courseid |
|
| 1946 | 1946 | * @param string $bigbluebuttonbnid |
| 1947 | 1947 | * @param bool $subset |
| 1948 | 1948 | * |
@@ -1965,7 +1965,7 @@ discard block |
||
| 1965 | 1965 | /** |
| 1966 | 1966 | * Helper function to get recordings and imported recordings together. |
| 1967 | 1967 | * |
| 1968 | - * @param string $courseid |
|
| 1968 | + * @param integer $courseid |
|
| 1969 | 1969 | * @param string $bigbluebuttonbnid |
| 1970 | 1970 | * @param bool $subset |
| 1971 | 1971 | * @param bool $includedeleted |
@@ -1983,7 +1983,7 @@ discard block |
||
| 1983 | 1983 | * Helper function to retrieve recordings from the BigBlueButton. The references are stored as events |
| 1984 | 1984 | * in bigbluebuttonbn_logs. |
| 1985 | 1985 | * |
| 1986 | - * @param string $courseid |
|
| 1986 | + * @param integer $courseid |
|
| 1987 | 1987 | * @param string $bigbluebuttonbnid |
| 1988 | 1988 | * @param bool $subset |
| 1989 | 1989 | * @param bool $includedeleted |
@@ -121,9 +121,9 @@ discard block |
||
| 121 | 121 | */ |
| 122 | 122 | function bigbluebuttonbn_get_join_url($meetingid, $username, $pw, $logouturl, $configtoken = null, $userid = null) { |
| 123 | 123 | $data = ['meetingID' => $meetingid, |
| 124 | - 'fullName' => $username, |
|
| 125 | - 'password' => $pw, |
|
| 126 | - 'logoutURL' => $logouturl, |
|
| 124 | + 'fullName' => $username, |
|
| 125 | + 'password' => $pw, |
|
| 126 | + 'logoutURL' => $logouturl, |
|
| 127 | 127 | ]; |
| 128 | 128 | if (!is_null($configtoken)) { |
| 129 | 129 | $data['configToken'] = $configtoken; |
@@ -175,23 +175,23 @@ discard block |
||
| 175 | 175 | function bigbluebuttonbn_get_meeting_info_array($meetingid) { |
| 176 | 176 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 177 | 177 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
| 178 | - ); |
|
| 178 | + ); |
|
| 179 | 179 | if ($xml && $xml->returncode == 'SUCCESS' && empty($xml->messageKey)) { |
| 180 | 180 | // Meeting info was returned. |
| 181 | 181 | return array('returncode' => $xml->returncode, |
| 182 | - 'meetingID' => $xml->meetingID, |
|
| 183 | - 'moderatorPW' => $xml->moderatorPW, |
|
| 184 | - 'attendeePW' => $xml->attendeePW, |
|
| 185 | - 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded, |
|
| 186 | - 'running' => $xml->running, |
|
| 187 | - 'recording' => $xml->recording, |
|
| 188 | - 'startTime' => $xml->startTime, |
|
| 189 | - 'endTime' => $xml->endTime, |
|
| 190 | - 'participantCount' => $xml->participantCount, |
|
| 191 | - 'moderatorCount' => $xml->moderatorCount, |
|
| 192 | - 'attendees' => $xml->attendees, |
|
| 193 | - 'metadata' => $xml->metadata, |
|
| 194 | - ); |
|
| 182 | + 'meetingID' => $xml->meetingID, |
|
| 183 | + 'moderatorPW' => $xml->moderatorPW, |
|
| 184 | + 'attendeePW' => $xml->attendeePW, |
|
| 185 | + 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded, |
|
| 186 | + 'running' => $xml->running, |
|
| 187 | + 'recording' => $xml->recording, |
|
| 188 | + 'startTime' => $xml->startTime, |
|
| 189 | + 'endTime' => $xml->endTime, |
|
| 190 | + 'participantCount' => $xml->participantCount, |
|
| 191 | + 'moderatorCount' => $xml->moderatorCount, |
|
| 192 | + 'attendees' => $xml->attendees, |
|
| 193 | + 'metadata' => $xml->metadata, |
|
| 194 | + ); |
|
| 195 | 195 | } |
| 196 | 196 | if ($xml) { |
| 197 | 197 | // Either failure or success without meeting info. |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | function bigbluebuttonbn_get_default_config_xml() { |
| 328 | 328 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 329 | 329 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getDefaultConfigXML') |
| 330 | - ); |
|
| 330 | + ); |
|
| 331 | 331 | return $xml; |
| 332 | 332 | } |
| 333 | 333 | |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | foreach ($ids as $id) { |
| 429 | 429 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 430 | 430 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('deleteRecordings', ['recordID' => $id]) |
| 431 | - ); |
|
| 431 | + ); |
|
| 432 | 432 | if ($xml && $xml->returncode != 'SUCCESS') { |
| 433 | 433 | return false; |
| 434 | 434 | } |
@@ -447,7 +447,7 @@ discard block |
||
| 447 | 447 | foreach ($ids as $id) { |
| 448 | 448 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 449 | 449 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('publishRecordings', ['recordID' => $id, 'publish' => $publish]) |
| 450 | - ); |
|
| 450 | + ); |
|
| 451 | 451 | if ($xml && $xml->returncode != 'SUCCESS') { |
| 452 | 452 | return false; |
| 453 | 453 | } |
@@ -466,7 +466,7 @@ discard block |
||
| 466 | 466 | foreach ($ids as $id) { |
| 467 | 467 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 468 | 468 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params) |
| 469 | - ); |
|
| 469 | + ); |
|
| 470 | 470 | if ($xml && $xml->returncode != 'SUCCESS') { |
| 471 | 471 | return false; |
| 472 | 472 | } |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | function bigbluebuttonbn_end_meeting($meetingid, $modpw) { |
| 484 | 484 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 485 | 485 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('end', ['meetingID' => $meetingid, 'password' => $modpw]) |
| 486 | - ); |
|
| 486 | + ); |
|
| 487 | 487 | if ($xml) { |
| 488 | 488 | // If the xml packet returned failure it displays the message to the user. |
| 489 | 489 | return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); |
@@ -500,7 +500,7 @@ discard block |
||
| 500 | 500 | function bigbluebuttonbn_get_server_version() { |
| 501 | 501 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 502 | 502 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url() |
| 503 | - ); |
|
| 503 | + ); |
|
| 504 | 504 | if ($xml && $xml->returncode == 'SUCCESS') { |
| 505 | 505 | return $xml->version; |
| 506 | 506 | } |
@@ -567,10 +567,10 @@ discard block |
||
| 567 | 567 | } |
| 568 | 568 | $options = array(); |
| 569 | 569 | $options['CURLOPT_HTTPHEADER'] = array( |
| 570 | - 'Content-Type: '.$contenttype, |
|
| 571 | - 'Content-Length: '.strlen($data), |
|
| 572 | - 'Content-Language: en-US', |
|
| 573 | - ); |
|
| 570 | + 'Content-Type: '.$contenttype, |
|
| 571 | + 'Content-Length: '.strlen($data), |
|
| 572 | + 'Content-Language: en-US', |
|
| 573 | + ); |
|
| 574 | 574 | |
| 575 | 575 | return $c->post($url, $data, $options); |
| 576 | 576 | } |
@@ -717,16 +717,16 @@ discard block |
||
| 717 | 717 | 'all' => array( |
| 718 | 718 | 'name' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'), |
| 719 | 719 | 'children' => [] |
| 720 | - ) |
|
| 721 | - ); |
|
| 720 | + ) |
|
| 721 | + ); |
|
| 722 | 722 | $data['role'] = array( |
| 723 | 723 | 'name' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'), |
| 724 | 724 | 'children' => bigbluebuttonbn_get_roles_select($context) |
| 725 | - ); |
|
| 725 | + ); |
|
| 726 | 726 | $data['user'] = array( |
| 727 | 727 | 'name' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'), |
| 728 | 728 | 'children' => bigbluebuttonbn_get_users_select($context) |
| 729 | - ); |
|
| 729 | + ); |
|
| 730 | 730 | return $data; |
| 731 | 731 | } |
| 732 | 732 | |
@@ -771,9 +771,9 @@ discard block |
||
| 771 | 771 | continue; |
| 772 | 772 | } |
| 773 | 773 | $participantlistarray[] = array( |
| 774 | - 'selectiontype' => 'role', |
|
| 775 | - 'selectionid' => $moderatordefault, |
|
| 776 | - 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR); |
|
| 774 | + 'selectiontype' => 'role', |
|
| 775 | + 'selectionid' => $moderatordefault, |
|
| 776 | + 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR); |
|
| 777 | 777 | } |
| 778 | 778 | return $participantlistarray; |
| 779 | 779 | } |
@@ -816,11 +816,11 @@ discard block |
||
| 816 | 816 | 'all' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'), |
| 817 | 817 | 'role' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'), |
| 818 | 818 | 'user' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'), |
| 819 | - ], |
|
| 819 | + ], |
|
| 820 | 820 | 'type_selected' => 'all', |
| 821 | 821 | 'options' => ['all' => '---------------'], |
| 822 | 822 | 'selected' => 'all', |
| 823 | - ]; |
|
| 823 | + ]; |
|
| 824 | 824 | } |
| 825 | 825 | |
| 826 | 826 | /** |
@@ -1100,7 +1100,7 @@ discard block |
||
| 1100 | 1100 | // Ping again and refresh the cache. |
| 1101 | 1101 | $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file( |
| 1102 | 1102 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
| 1103 | - ); |
|
| 1103 | + ); |
|
| 1104 | 1104 | $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); |
| 1105 | 1105 | return $meetinginfo; |
| 1106 | 1106 | } |
@@ -1512,8 +1512,8 @@ discard block |
||
| 1512 | 1512 | } |
| 1513 | 1513 | $id = 'playbacks-'.$recording['recordID']; |
| 1514 | 1514 | $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported, |
| 1515 | - 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
|
| 1516 | - 'title' => $title, $visibility => $visibility)); |
|
| 1515 | + 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
|
| 1516 | + 'title' => $title, $visibility => $visibility)); |
|
| 1517 | 1517 | foreach ($recording['playbacks'] as $playback) { |
| 1518 | 1518 | $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bbbsession, $playback); |
| 1519 | 1519 | } |
@@ -1537,7 +1537,7 @@ discard block |
||
| 1537 | 1537 | } |
| 1538 | 1538 | $text = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'); |
| 1539 | 1539 | $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bbbsession['bigbluebuttonbn']->id . |
| 1540 | - '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
| 1540 | + '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
| 1541 | 1541 | if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') { |
| 1542 | 1542 | $href .= '&href='.urlencode(trim($playback['url'])); |
| 1543 | 1543 | } |
@@ -1548,7 +1548,7 @@ discard block |
||
| 1548 | 1548 | 'data-action' => 'play', |
| 1549 | 1549 | 'data-target' => $playback['type'], |
| 1550 | 1550 | 'data-href' => $href, |
| 1551 | - ); |
|
| 1551 | + ); |
|
| 1552 | 1552 | if (!bigbluebuttonbn_validate_resource(trim($playback['url']))) { |
| 1553 | 1553 | $linkattributes['class'] = 'btn btn-sm btn-warning'; |
| 1554 | 1554 | $linkattributes['title'] = get_string('view_recording_format_errror_unreachable', 'bigbluebuttonbn'); |
@@ -1684,10 +1684,10 @@ discard block |
||
| 1684 | 1684 | 'id' => $id, |
| 1685 | 1685 | 'onclick' => $onclick, |
| 1686 | 1686 | 'data-action' => $data['action'] |
| 1687 | - ); |
|
| 1687 | + ); |
|
| 1688 | 1688 | if (!isset($recording['imported'])) { |
| 1689 | 1689 | $linkattributes['data-links'] = bigbluebuttonbn_count_recording_imported_instances( |
| 1690 | - $recording['recordID']); |
|
| 1690 | + $recording['recordID']); |
|
| 1691 | 1691 | } |
| 1692 | 1692 | if (isset($data['disabled'])) { |
| 1693 | 1693 | $iconattributes['class'] .= ' fa-' . $data['disabled']; |
@@ -2228,8 +2228,8 @@ discard block |
||
| 2228 | 2228 | $activitytime = ''; |
| 2229 | 2229 | if ($time) { |
| 2230 | 2230 | $activitytime = calendar_day_representation($time).' '. |
| 2231 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
| 2232 | - calendar_time_representation($time); |
|
| 2231 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
| 2232 | + calendar_time_representation($time); |
|
| 2233 | 2233 | } |
| 2234 | 2234 | return $activitytime; |
| 2235 | 2235 | } |
@@ -2529,7 +2529,7 @@ discard block |
||
| 2529 | 2529 | $renderer->render_group_element('participant_moderator_default', |
| 2530 | 2530 | $renderer->render_group_element_configmultiselect('participant_moderator_default', |
| 2531 | 2531 | array_keys($owner), array_merge($owner, $roles)) |
| 2532 | - ); |
|
| 2532 | + ); |
|
| 2533 | 2533 | } |
| 2534 | 2534 | } |
| 2535 | 2535 | |
@@ -2633,7 +2633,7 @@ discard block |
||
| 2633 | 2633 | return $output; |
| 2634 | 2634 | } |
| 2635 | 2635 | $output .= $OUTPUT->box_start('box boxalignleft adminerror alert alert-' . $type . ' alert-block fade in', |
| 2636 | - 'bigbluebuttonbn_view_general_warning') . "\n"; |
|
| 2636 | + 'bigbluebuttonbn_view_general_warning') . "\n"; |
|
| 2637 | 2637 | $output .= ' ' . $message . "\n"; |
| 2638 | 2638 | $output .= ' <div class="singlebutton pull-right">' . "\n"; |
| 2639 | 2639 | if (!empty($href)) { |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | global $CFG; |
| 30 | 30 | |
| 31 | -require_once(dirname(__FILE__).'/lib.php'); |
|
| 31 | +require_once(dirname(__FILE__) . '/lib.php'); |
|
| 32 | 32 | |
| 33 | 33 | /** @var BIGBLUEBUTTONBN_UPDATE_CACHE boolean set to true indicates that cache has to be updated */ |
| 34 | 34 | const BIGBLUEBUTTONBN_UPDATE_CACHE = true; |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | if (isset($meta)) { |
| 103 | 103 | $log->meta = $meta; |
| 104 | 104 | } else if ($event == BIGBLUEBUTTONBN_LOG_EVENT_CREATE) { |
| 105 | - $log->meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}'; |
|
| 105 | + $log->meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}'; |
|
| 106 | 106 | } |
| 107 | 107 | $DB->insert_record('bigbluebuttonbn_logs', $log); |
| 108 | 108 | } |
@@ -150,8 +150,8 @@ discard block |
||
| 150 | 150 | $data = null; |
| 151 | 151 | if (!is_null($pname) && !is_null($purl)) { |
| 152 | 152 | $method = 'POST'; |
| 153 | - $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='". |
|
| 154 | - $purl."' /></module></modules>"; |
|
| 153 | + $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='" . |
|
| 154 | + $purl . "' /></module></modules>"; |
|
| 155 | 155 | } |
| 156 | 156 | $xml = bigbluebuttonbn_wrap_xml_load_file($createmeetingurl, $method, $data); |
| 157 | 157 | if ($xml) { |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | // Override imported flag with actual ID. |
| 313 | 313 | $recording['imported'] = $recordimported->id; |
| 314 | 314 | if (isset($recordimported->protected)) { |
| 315 | - $recording['protected'] = (string) $recordimported->protected; |
|
| 315 | + $recording['protected'] = (string)$recordimported->protected; |
|
| 316 | 316 | } |
| 317 | 317 | $recordsimportedarray[$recording['recordID']] = $recording; |
| 318 | 318 | } |
@@ -342,21 +342,21 @@ discard block |
||
| 342 | 342 | // Add formats. |
| 343 | 343 | $playbackarray = array(); |
| 344 | 344 | foreach ($recording->playback->format as $format) { |
| 345 | - $playbackarray[(string) $format->type] = array('type' => (string) $format->type, |
|
| 346 | - 'url' => trim((string) $format->url), 'length' => (string) $format->length); |
|
| 345 | + $playbackarray[(string)$format->type] = array('type' => (string)$format->type, |
|
| 346 | + 'url' => trim((string)$format->url), 'length' => (string)$format->length); |
|
| 347 | 347 | // Add preview per format when existing. |
| 348 | 348 | if ($format->preview) { |
| 349 | - $playbackarray[(string) $format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview); |
|
| 349 | + $playbackarray[(string)$format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview); |
|
| 350 | 350 | } |
| 351 | 351 | } |
| 352 | 352 | // Add the metadata to the recordings array. |
| 353 | 353 | $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata)); |
| 354 | - $recordingarray = array('recordID' => (string) $recording->recordID, |
|
| 355 | - 'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name, |
|
| 356 | - 'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime, |
|
| 357 | - 'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray); |
|
| 354 | + $recordingarray = array('recordID' => (string)$recording->recordID, |
|
| 355 | + 'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name, |
|
| 356 | + 'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime, |
|
| 357 | + 'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray); |
|
| 358 | 358 | if (isset($recording->protected)) { |
| 359 | - $recordingarray['protected'] = (string) $recording->protected; |
|
| 359 | + $recordingarray['protected'] = (string)$recording->protected; |
|
| 360 | 360 | } |
| 361 | 361 | return $recordingarray + $metadataarray; |
| 362 | 362 | } |
@@ -371,9 +371,9 @@ discard block |
||
| 371 | 371 | function bigbluebuttonbn_get_recording_preview_images($preview) { |
| 372 | 372 | $imagesarray = array(); |
| 373 | 373 | foreach ($preview->images->image as $image) { |
| 374 | - $imagearray = array('url' => trim((string) $image)); |
|
| 374 | + $imagearray = array('url' => trim((string)$image)); |
|
| 375 | 375 | foreach ($image->attributes() as $attkey => $attvalue) { |
| 376 | - $imagearray[$attkey] = (string) $attvalue; |
|
| 376 | + $imagearray[$attkey] = (string)$attvalue; |
|
| 377 | 377 | } |
| 378 | 378 | array_push($imagesarray, $imagearray); |
| 379 | 379 | } |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | if (is_object($value)) { |
| 394 | 394 | $value = ''; |
| 395 | 395 | } |
| 396 | - $metadataarray['meta_'.$key] = $value; |
|
| 396 | + $metadataarray['meta_' . $key] = $value; |
|
| 397 | 397 | } |
| 398 | 398 | return $metadataarray; |
| 399 | 399 | } |
@@ -465,7 +465,7 @@ discard block |
||
| 465 | 465 | $ids = explode(',', $recordids); |
| 466 | 466 | foreach ($ids as $id) { |
| 467 | 467 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 468 | - \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params) |
|
| 468 | + \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params) |
|
| 469 | 469 | ); |
| 470 | 470 | if ($xml && $xml->returncode != 'SUCCESS') { |
| 471 | 471 | return false; |
@@ -530,7 +530,7 @@ discard block |
||
| 530 | 530 | return $xml; |
| 531 | 531 | } catch (Exception $e) { |
| 532 | 532 | libxml_use_internal_errors($previous); |
| 533 | - $error = 'Caught exception: '.$e->getMessage(); |
|
| 533 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
| 534 | 534 | debugging($error, DEBUG_DEVELOPER); |
| 535 | 535 | return null; |
| 536 | 536 | } |
@@ -541,7 +541,7 @@ discard block |
||
| 541 | 541 | $response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS); |
| 542 | 542 | return $response; |
| 543 | 543 | } catch (Exception $e) { |
| 544 | - $error = 'Caught exception: '.$e->getMessage(); |
|
| 544 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
| 545 | 545 | debugging($error, DEBUG_DEVELOPER); |
| 546 | 546 | libxml_use_internal_errors($previous); |
| 547 | 547 | return null; |
@@ -567,8 +567,8 @@ discard block |
||
| 567 | 567 | } |
| 568 | 568 | $options = array(); |
| 569 | 569 | $options['CURLOPT_HTTPHEADER'] = array( |
| 570 | - 'Content-Type: '.$contenttype, |
|
| 571 | - 'Content-Length: '.strlen($data), |
|
| 570 | + 'Content-Type: ' . $contenttype, |
|
| 571 | + 'Content-Length: ' . strlen($data), |
|
| 572 | 572 | 'Content-Language: en-US', |
| 573 | 573 | ); |
| 574 | 574 | |
@@ -589,7 +589,7 @@ discard block |
||
| 589 | 589 | * @return void |
| 590 | 590 | */ |
| 591 | 591 | function bigbluebuttonbn_end_meeting_if_running($bigbluebuttonbn) { |
| 592 | - $meetingid = $bigbluebuttonbn->meetingid.'-'.$bigbluebuttonbn->course.'-'.$bigbluebuttonbn->id; |
|
| 592 | + $meetingid = $bigbluebuttonbn->meetingid . '-' . $bigbluebuttonbn->course . '-' . $bigbluebuttonbn->id; |
|
| 593 | 593 | if (bigbluebuttonbn_is_meeting_running($meetingid)) { |
| 594 | 594 | bigbluebuttonbn_end_meeting($meetingid, $bigbluebuttonbn->moderatorpass); |
| 595 | 595 | } |
@@ -609,9 +609,9 @@ discard block |
||
| 609 | 609 | if ($userroles) { |
| 610 | 610 | $where = ''; |
| 611 | 611 | foreach ($userroles as $userrole) { |
| 612 | - $where .= (empty($where) ? ' WHERE' : ' OR').' id=' . $userrole->roleid; |
|
| 612 | + $where .= (empty($where) ? ' WHERE' : ' OR') . ' id=' . $userrole->roleid; |
|
| 613 | 613 | } |
| 614 | - $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where); |
|
| 614 | + $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where); |
|
| 615 | 615 | } |
| 616 | 616 | return $userroles; |
| 617 | 617 | } |
@@ -634,7 +634,7 @@ discard block |
||
| 634 | 634 | * @return array $users |
| 635 | 635 | */ |
| 636 | 636 | function bigbluebuttonbn_get_users(context $context = null) { |
| 637 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
| 637 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
| 638 | 638 | foreach ($users as $key => $value) { |
| 639 | 639 | $users[$key] = fullname($value); |
| 640 | 640 | } |
@@ -649,7 +649,7 @@ discard block |
||
| 649 | 649 | * @return array $users |
| 650 | 650 | */ |
| 651 | 651 | function bigbluebuttonbn_get_users_select(context $context = null) { |
| 652 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
| 652 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
| 653 | 653 | foreach ($users as $key => $value) { |
| 654 | 654 | $users[$key] = array('id' => $value->id, 'name' => fullname($value)); |
| 655 | 655 | } |
@@ -664,7 +664,7 @@ discard block |
||
| 664 | 664 | * @return array $roles |
| 665 | 665 | */ |
| 666 | 666 | function bigbluebuttonbn_get_roles(context $context = null) { |
| 667 | - $roles = (array) role_get_names($context); |
|
| 667 | + $roles = (array)role_get_names($context); |
|
| 668 | 668 | foreach ($roles as $key => $value) { |
| 669 | 669 | $roles[$key] = $value->localname; |
| 670 | 670 | } |
@@ -679,7 +679,7 @@ discard block |
||
| 679 | 679 | * @return array $users |
| 680 | 680 | */ |
| 681 | 681 | function bigbluebuttonbn_get_roles_select(context $context = null) { |
| 682 | - $roles = (array) role_get_names($context); |
|
| 682 | + $roles = (array)role_get_names($context); |
|
| 683 | 683 | foreach ($roles as $key => $value) { |
| 684 | 684 | $roles[$key] = array('id' => $value->id, 'name' => $value->localname); |
| 685 | 685 | } |
@@ -694,7 +694,7 @@ discard block |
||
| 694 | 694 | * @return object $role |
| 695 | 695 | */ |
| 696 | 696 | function bigbluebuttonbn_get_role($id) { |
| 697 | - $roles = (array) role_get_names(); |
|
| 697 | + $roles = (array)role_get_names(); |
|
| 698 | 698 | if (is_numeric($id) && isset($roles[$id])) { |
| 699 | 699 | return (object)$roles[$id]; |
| 700 | 700 | } |
@@ -849,7 +849,7 @@ discard block |
||
| 849 | 849 | if (!isguestuser()) { |
| 850 | 850 | $userroles = bigbluebuttonbn_get_user_roles($context, $userid); |
| 851 | 851 | } |
| 852 | - return bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles); |
|
| 852 | + return bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles); |
|
| 853 | 853 | } |
| 854 | 854 | |
| 855 | 855 | /** |
@@ -1005,7 +1005,7 @@ discard block |
||
| 1005 | 1005 | function bigbluebuttonbn_generate_nonce() { |
| 1006 | 1006 | $mt = microtime(); |
| 1007 | 1007 | $rand = mt_rand(); |
| 1008 | - return md5($mt.$rand); |
|
| 1008 | + return md5($mt . $rand); |
|
| 1009 | 1009 | } |
| 1010 | 1010 | |
| 1011 | 1011 | /** |
@@ -1095,10 +1095,10 @@ discard block |
||
| 1095 | 1095 | $now = time(); |
| 1096 | 1096 | if (!$updatecache && isset($result) && $now < ($result['creation_time'] + $cachettl)) { |
| 1097 | 1097 | // Use the value in the cache. |
| 1098 | - return (array) json_decode($result['meeting_info']); |
|
| 1098 | + return (array)json_decode($result['meeting_info']); |
|
| 1099 | 1099 | } |
| 1100 | 1100 | // Ping again and refresh the cache. |
| 1101 | - $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file( |
|
| 1101 | + $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file( |
|
| 1102 | 1102 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
| 1103 | 1103 | ); |
| 1104 | 1104 | $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); |
@@ -1209,7 +1209,7 @@ discard block |
||
| 1209 | 1209 | * @return object |
| 1210 | 1210 | */ |
| 1211 | 1211 | function bigbluebuttonbn_set_config_xml($meetingid, $configxml) { |
| 1212 | - $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?'; |
|
| 1212 | + $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?'; |
|
| 1213 | 1213 | $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml); |
| 1214 | 1214 | $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, 'POST', |
| 1215 | 1215 | $configxmlparams, 'application/x-www-form-urlencoded'); |
@@ -1225,8 +1225,8 @@ discard block |
||
| 1225 | 1225 | * @return string |
| 1226 | 1226 | */ |
| 1227 | 1227 | function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) { |
| 1228 | - $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid); |
|
| 1229 | - $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.\mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
| 1228 | + $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid); |
|
| 1229 | + $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . \mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
| 1230 | 1230 | return $configxmlparams; |
| 1231 | 1231 | } |
| 1232 | 1232 | |
@@ -1240,7 +1240,7 @@ discard block |
||
| 1240 | 1240 | */ |
| 1241 | 1241 | function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) { |
| 1242 | 1242 | $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml); |
| 1243 | - $configxmlarray = (array) $configxml; |
|
| 1243 | + $configxmlarray = (array)$configxml; |
|
| 1244 | 1244 | if ($configxmlarray['returncode'] != 'SUCCESS') { |
| 1245 | 1245 | debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER); |
| 1246 | 1246 | return ''; |
@@ -1332,7 +1332,7 @@ discard block |
||
| 1332 | 1332 | global $USER; |
| 1333 | 1333 | $starttime = $starttime - ($starttime % 1000); |
| 1334 | 1334 | // Set formatted date. |
| 1335 | - $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z'; |
|
| 1335 | + $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z'; |
|
| 1336 | 1336 | return userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone)); |
| 1337 | 1337 | } |
| 1338 | 1338 | |
@@ -1448,7 +1448,7 @@ discard block |
||
| 1448 | 1448 | * @return string |
| 1449 | 1449 | */ |
| 1450 | 1450 | function bigbluebuttonbn_get_recording_data_row_preview($recording) { |
| 1451 | - $options = array('id' => 'preview-'.$recording['recordID']); |
|
| 1451 | + $options = array('id' => 'preview-' . $recording['recordID']); |
|
| 1452 | 1452 | if ($recording['published'] === 'false') { |
| 1453 | 1453 | $options['hidden'] = 'hidden'; |
| 1454 | 1454 | } |
@@ -1510,7 +1510,7 @@ discard block |
||
| 1510 | 1510 | if ($recording['published'] === 'false') { |
| 1511 | 1511 | $visibility = 'hidden '; |
| 1512 | 1512 | } |
| 1513 | - $id = 'playbacks-'.$recording['recordID']; |
|
| 1513 | + $id = 'playbacks-' . $recording['recordID']; |
|
| 1514 | 1514 | $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported, |
| 1515 | 1515 | 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
| 1516 | 1516 | 'title' => $title, $visibility => $visibility)); |
@@ -1535,11 +1535,11 @@ discard block |
||
| 1535 | 1535 | if (!bigbluebuttonbn_include_recording_data_row_type($recording, $bbbsession, $playback)) { |
| 1536 | 1536 | return ''; |
| 1537 | 1537 | } |
| 1538 | - $text = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'); |
|
| 1538 | + $text = get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn'); |
|
| 1539 | 1539 | $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bbbsession['bigbluebuttonbn']->id . |
| 1540 | - '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
| 1540 | + '&mid=' . $recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
| 1541 | 1541 | if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') { |
| 1542 | - $href .= '&href='.urlencode(trim($playback['url'])); |
|
| 1542 | + $href .= '&href=' . urlencode(trim($playback['url'])); |
|
| 1543 | 1543 | } |
| 1544 | 1544 | $linkattributes = array( |
| 1545 | 1545 | 'id' => 'recording-play-' . $playback['type'] . '-' . $recording['recordID'], |
@@ -1694,7 +1694,7 @@ discard block |
||
| 1694 | 1694 | $linkattributes['class'] = 'disabled'; |
| 1695 | 1695 | unset($linkattributes['onclick']); |
| 1696 | 1696 | } |
| 1697 | - $icon = new pix_icon('i/'.$data['tag'], |
|
| 1697 | + $icon = new pix_icon('i/' . $data['tag'], |
|
| 1698 | 1698 | get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'), |
| 1699 | 1699 | 'moodle', $iconattributes); |
| 1700 | 1700 | return $OUTPUT->action_icon('#', $icon, null, $linkattributes, false); |
@@ -1811,7 +1811,7 @@ discard block |
||
| 1811 | 1811 | */ |
| 1812 | 1812 | function bigbluebuttonbn_get_recording_table_row($bbbsession, $recording, $rowdata) { |
| 1813 | 1813 | $row = new html_table_row(); |
| 1814 | - $row->id = 'recording-tr-'.$recording['recordID']; |
|
| 1814 | + $row->id = 'recording-tr-' . $recording['recordID']; |
|
| 1815 | 1815 | $row->attributes['data-imported'] = 'false'; |
| 1816 | 1816 | $texthead = ''; |
| 1817 | 1817 | $texttail = ''; |
@@ -1871,9 +1871,9 @@ discard block |
||
| 1871 | 1871 | function bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn) { |
| 1872 | 1872 | $sender = get_admin(); |
| 1873 | 1873 | // Prepare message. |
| 1874 | - $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn'). |
|
| 1875 | - ' "' . $bigbluebuttonbn->name . '" '. |
|
| 1876 | - get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>'; |
|
| 1874 | + $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . |
|
| 1875 | + ' "' . $bigbluebuttonbn->name . '" ' . |
|
| 1876 | + get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>'; |
|
| 1877 | 1877 | $context = context_course::instance($bigbluebuttonbn->course); |
| 1878 | 1878 | \mod_bigbluebuttonbn\locallib\notifier::notification_send($context, $sender, $bigbluebuttonbn, $messagetext); |
| 1879 | 1879 | } |
@@ -2095,7 +2095,7 @@ discard block |
||
| 2095 | 2095 | } |
| 2096 | 2096 | // Prepare select for loading records based on existent bigbluebuttonbns. |
| 2097 | 2097 | $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE '; |
| 2098 | - $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')'; |
|
| 2098 | + $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')'; |
|
| 2099 | 2099 | // Include only Create events and exclude those with record not true. |
| 2100 | 2100 | $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?'; |
| 2101 | 2101 | // Execute select for loading records based on existent bigbluebuttonbns. |
@@ -2227,8 +2227,8 @@ discard block |
||
| 2227 | 2227 | function bigbluebuttonbn_format_activity_time($time) { |
| 2228 | 2228 | $activitytime = ''; |
| 2229 | 2229 | if ($time) { |
| 2230 | - $activitytime = calendar_day_representation($time).' '. |
|
| 2231 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
| 2230 | + $activitytime = calendar_day_representation($time) . ' ' . |
|
| 2231 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' . |
|
| 2232 | 2232 | calendar_time_representation($time); |
| 2233 | 2233 | } |
| 2234 | 2234 | return $activitytime; |
@@ -2625,7 +2625,7 @@ discard block |
||
| 2625 | 2625 | * |
| 2626 | 2626 | * @return string |
| 2627 | 2627 | */ |
| 2628 | -function bigbluebuttonbn_render_warning($message, $type='info', $href='', $text='', $class='') { |
|
| 2628 | +function bigbluebuttonbn_render_warning($message, $type = 'info', $href = '', $text = '', $class = '') { |
|
| 2629 | 2629 | global $OUTPUT; |
| 2630 | 2630 | $output = "\n"; |
| 2631 | 2631 | // Evaluates if config_warning is enabled. |
@@ -2664,11 +2664,11 @@ discard block |
||
| 2664 | 2664 | if ($class == '') { |
| 2665 | 2665 | $class = 'btn btn-secondary'; |
| 2666 | 2666 | } |
| 2667 | - $output = ' <form method="post" action="' . $href . '" class="form-inline">'."\n"; |
|
| 2668 | - $output .= ' <button type="submit" class="' . $class . '"'."\n"; |
|
| 2669 | - $output .= ' title="' . $title . '"'."\n"; |
|
| 2670 | - $output .= ' >' . $text . '</button>'."\n"; |
|
| 2671 | - $output .= ' </form>'."\n"; |
|
| 2667 | + $output = ' <form method="post" action="' . $href . '" class="form-inline">' . "\n"; |
|
| 2668 | + $output .= ' <button type="submit" class="' . $class . '"' . "\n"; |
|
| 2669 | + $output .= ' title="' . $title . '"' . "\n"; |
|
| 2670 | + $output .= ' >' . $text . '</button>' . "\n"; |
|
| 2671 | + $output .= ' </form>' . "\n"; |
|
| 2672 | 2672 | return $output; |
| 2673 | 2673 | } |
| 2674 | 2674 | |