@@ -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 | 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. |
@@ -265,12 +265,12 @@ discard block |
||
265 | 265 | } |
266 | 266 | |
267 | 267 | bigbluebuttonbn_view_message_box($bbbsession, get_string('view_groups_selection_warning', 'bigbluebuttonbn'), 'warning'); |
268 | - $urltoroot = $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bbbsession['cm']->id; |
|
268 | + $urltoroot = $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id; |
|
269 | 269 | groups_print_activity_menu($bbbsession['cm'], $urltoroot); |
270 | 270 | echo '<br><br>'; |
271 | 271 | } |
272 | 272 | |
273 | -function bigbluebuttonbn_view_message_box(&$bbbsession, $message, $type='warning', $onlymoderator=false) { |
|
273 | +function bigbluebuttonbn_view_message_box(&$bbbsession, $message, $type = 'warning', $onlymoderator = false) { |
|
274 | 274 | global $OUTPUT; |
275 | 275 | if ($onlymoderator && !$bbbsession['moderator'] && !$bbbsession['administrator']) { |
276 | 276 | return; |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | 'M.mod_bigbluebuttonbn.recordings.init', array($jsvars)); |
320 | 320 | } |
321 | 321 | |
322 | - echo $output.html_writer::empty_tag('br').html_writer::empty_tag('br').html_writer::empty_tag('br'); |
|
322 | + echo $output . html_writer::empty_tag('br') . html_writer::empty_tag('br') . html_writer::empty_tag('br'); |
|
323 | 323 | $PAGE->requires->yui_module('moodle-mod_bigbluebuttonbn-broker', 'M.mod_bigbluebuttonbn.broker.init', array($jsvars)); |
324 | 324 | } |
325 | 325 | |
@@ -343,21 +343,21 @@ discard block |
||
343 | 343 | return $output; |
344 | 344 | } |
345 | 345 | |
346 | -function bigbluebuttonbn_view_render_warning($message, $type='info', $href='', $text='', $class='') { |
|
346 | +function bigbluebuttonbn_view_render_warning($message, $type = 'info', $href = '', $text = '', $class = '') { |
|
347 | 347 | global $OUTPUT; |
348 | 348 | $output = "\n"; |
349 | 349 | // Evaluates if config_warning is enabled. |
350 | 350 | if (empty($message)) { |
351 | 351 | return $output; |
352 | 352 | } |
353 | - $output .= $OUTPUT->box_start('box boxalignleft adminerror alert alert-' . $type . ' alert-block fade in', 'bigbluebuttonbn_view_general_warning')."\n"; |
|
354 | - $output .= ' <button type="button" class="close" data-dismiss="alert">×</button>'.$message."\n"; |
|
355 | - $output .= ' <div class="singlebutton">'."\n"; |
|
353 | + $output .= $OUTPUT->box_start('box boxalignleft adminerror alert alert-' . $type . ' alert-block fade in', 'bigbluebuttonbn_view_general_warning') . "\n"; |
|
354 | + $output .= ' <button type="button" class="close" data-dismiss="alert">×</button>' . $message . "\n"; |
|
355 | + $output .= ' <div class="singlebutton">' . "\n"; |
|
356 | 356 | if (!empty($href)) { |
357 | 357 | $output .= bigbluebutton_view_render_general_warning_button($href, $text, $class); |
358 | 358 | } |
359 | - $output .= ' </div>'."\n"; |
|
360 | - $output .= $OUTPUT->box_end()."\n"; |
|
359 | + $output .= ' </div>' . "\n"; |
|
360 | + $output .= $OUTPUT->box_end() . "\n"; |
|
361 | 361 | return $output; |
362 | 362 | } |
363 | 363 | |
@@ -368,11 +368,11 @@ discard block |
||
368 | 368 | if ($class == '') { |
369 | 369 | $class = 'btn btn-secondary'; |
370 | 370 | } |
371 | - $output = ' <form method="post" action="' . $href . '" class="form-inline">'."\n"; |
|
372 | - $output .= ' <button type="submit" class="' . $class . '"'."\n"; |
|
373 | - $output .= ' title=""'."\n"; |
|
374 | - $output .= ' >' . $text . '</button>'."\n"; |
|
375 | - $output .= ' </form>'."\n"; |
|
371 | + $output = ' <form method="post" action="' . $href . '" class="form-inline">' . "\n"; |
|
372 | + $output .= ' <button type="submit" class="' . $class . '"' . "\n"; |
|
373 | + $output .= ' title=""' . "\n"; |
|
374 | + $output .= ' >' . $text . '</button>' . "\n"; |
|
375 | + $output .= ' </form>' . "\n"; |
|
376 | 376 | return $output; |
377 | 377 | } |
378 | 378 | |
@@ -382,12 +382,12 @@ discard block |
||
382 | 382 | // JavaScript variables for room. |
383 | 383 | $openingtime = ''; |
384 | 384 | if ($bbbsession['openingtime']) { |
385 | - $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn').': '. |
|
385 | + $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn') . ': ' . |
|
386 | 386 | userdate($bbbsession['openingtime']); |
387 | 387 | } |
388 | 388 | $closingtime = ''; |
389 | 389 | if ($bbbsession['closingtime']) { |
390 | - $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn').': '. |
|
390 | + $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn') . ': ' . |
|
391 | 391 | userdate($bbbsession['closingtime']); |
392 | 392 | } |
393 | 393 | $jsvars += array( |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | $output .= $OUTPUT->box_end(); |
405 | 405 | |
406 | 406 | $output .= $OUTPUT->box_start('generalbox boxaligncenter', 'bigbluebuttonbn_view_action_button_box'); |
407 | - $output .= '<br><br><span id="join_button"></span> <span id="end_button"></span>'."\n"; |
|
407 | + $output .= '<br><br><span id="join_button"></span> <span id="end_button"></span>' . "\n"; |
|
408 | 408 | $output .= $OUTPUT->box_end(); |
409 | 409 | |
410 | 410 | if ($activity == 'ended') { |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | |
431 | 431 | // Get recordings. |
432 | 432 | $recordings = array(); |
433 | - if ( bigbluebuttonbn_view_include_recordings($bbbsession) ) { |
|
433 | + if (bigbluebuttonbn_view_include_recordings($bbbsession)) { |
|
434 | 434 | $recordings = bigbluebuttonbn_get_recordings( |
435 | 435 | $bbbsession['course']->id, $bigbluebuttonbnid, $showroom, |
436 | 436 | $bbbsession['bigbluebuttonbn']->recordings_deleted |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | // If there are meetings with recordings load the data to the table. |
462 | 462 | if ($bbbsession['bigbluebuttonbn']->recordings_html) { |
463 | 463 | // Render a plain html table. |
464 | - return bigbluebutton_output_recording_table($bbbsession, $recordings)."\n"; |
|
464 | + return bigbluebutton_output_recording_table($bbbsession, $recordings) . "\n"; |
|
465 | 465 | } |
466 | 466 | |
467 | 467 | // JavaScript variables for recordings with YUI. |
@@ -481,8 +481,8 @@ discard block |
||
481 | 481 | array('type' => 'button', |
482 | 482 | 'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'), |
483 | 483 | 'class' => 'btn btn-secondary', |
484 | - 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='. |
|
485 | - $bbbsession['bigbluebuttonbn']->id.'\'')); |
|
484 | + 'onclick' => 'window.location=\'' . $CFG->wwwroot . '/mod/bigbluebuttonbn/import_view.php?bn=' . |
|
485 | + $bbbsession['bigbluebuttonbn']->id . '\'')); |
|
486 | 486 | $output = html_writer::start_tag('br'); |
487 | 487 | $output .= html_writer::tag('span', $button, array('id' => 'import_recording_links_button')); |
488 | 488 | $output .= html_writer::tag('span', '', array('id' => 'import_recording_links_table')); |
@@ -497,10 +497,10 @@ discard block |
||
497 | 497 | $attributes = array('title' => $bbbsession['presentation']['name']); |
498 | 498 | $icon = new pix_icon($bbbsession['presentation']['icon'], $bbbsession['presentation']['mimetype_description']); |
499 | 499 | |
500 | - return '<h4>'.get_string('view_section_title_presentation', 'bigbluebuttonbn').'</h4>'. |
|
501 | - ''.$OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false).''. |
|
502 | - ''.$OUTPUT->action_link($bbbsession['presentation']['url'], |
|
503 | - $bbbsession['presentation']['name'], null, $attributes).'<br><br>'; |
|
500 | + return '<h4>' . get_string('view_section_title_presentation', 'bigbluebuttonbn') . '</h4>' . |
|
501 | + '' . $OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false) . '' . |
|
502 | + '' . $OUTPUT->action_link($bbbsession['presentation']['url'], |
|
503 | + $bbbsession['presentation']['name'], null, $attributes) . '<br><br>'; |
|
504 | 504 | } |
505 | 505 | |
506 | 506 | return ''; |
@@ -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 | |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | |
520 | 520 | function bigbluebuttonbn_end_meeting_if_running($bigbluebuttonbn) { |
521 | 521 | // End the session associated with this instance (if it's running). |
522 | - $meetingid = $bigbluebuttonbn->meetingid.'-'.$bigbluebuttonbn->course.'-'.$bigbluebuttonbn->id; |
|
522 | + $meetingid = $bigbluebuttonbn->meetingid . '-' . $bigbluebuttonbn->course . '-' . $bigbluebuttonbn->id; |
|
523 | 523 | if (bigbluebuttonbn_is_meeting_running($meetingid)) { |
524 | 524 | bigbluebuttonbn_end_meeting($meetingid, $bigbluebuttonbn->moderatorpass); |
525 | 525 | } |
@@ -531,9 +531,9 @@ discard block |
||
531 | 531 | if ($userroles) { |
532 | 532 | $where = ''; |
533 | 533 | foreach ($userroles as $value) { |
534 | - $where .= (empty($where) ? ' WHERE' : ' OR').' id='.$value->roleid; |
|
534 | + $where .= (empty($where) ? ' WHERE' : ' OR') . ' id=' . $value->roleid; |
|
535 | 535 | } |
536 | - $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where); |
|
536 | + $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where); |
|
537 | 537 | } |
538 | 538 | return $userroles; |
539 | 539 | } |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | } |
545 | 545 | |
546 | 546 | function bigbluebuttonbn_get_users(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] = fullname($value); |
550 | 550 | } |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | } |
553 | 553 | |
554 | 554 | function bigbluebuttonbn_get_users_select(context $context = null) { |
555 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
555 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
556 | 556 | foreach ($users as $key => $value) { |
557 | 557 | $users[$key] = array('id' => $value->id, 'name' => fullname($value)); |
558 | 558 | } |
@@ -560,7 +560,7 @@ discard block |
||
560 | 560 | } |
561 | 561 | |
562 | 562 | function bigbluebuttonbn_get_roles(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] = $value->localname; |
566 | 566 | } |
@@ -568,7 +568,7 @@ discard block |
||
568 | 568 | } |
569 | 569 | |
570 | 570 | function bigbluebuttonbn_get_roles_select(context $context = null) { |
571 | - $roles = (array) role_get_names($context); |
|
571 | + $roles = (array)role_get_names($context); |
|
572 | 572 | foreach ($roles as $key => $value) { |
573 | 573 | $roles[$key] = array('id' => $value->id, 'name' => $value->localname); |
574 | 574 | } |
@@ -576,7 +576,7 @@ discard block |
||
576 | 576 | } |
577 | 577 | |
578 | 578 | function bigbluebuttonbn_get_role($id) { |
579 | - $roles = (array) role_get_names(); |
|
579 | + $roles = (array)role_get_names(); |
|
580 | 580 | if (is_numeric($id)) { |
581 | 581 | return (object)$roles[$id]; |
582 | 582 | } |
@@ -656,11 +656,11 @@ discard block |
||
656 | 656 | return array(); |
657 | 657 | } |
658 | 658 | foreach ($rules as $key => $rule) { |
659 | - if ( $rule['selectiontype'] !== 'role' || is_numeric($rule['selectionid']) ) { |
|
659 | + if ($rule['selectiontype'] !== 'role' || is_numeric($rule['selectionid'])) { |
|
660 | 660 | continue; |
661 | 661 | } |
662 | 662 | $role = bigbluebuttonbn_get_role($rule['selectionid']); |
663 | - if ( $role == null ) { |
|
663 | + if ($role == null) { |
|
664 | 664 | unset($rules[$key]); |
665 | 665 | continue; |
666 | 666 | } |
@@ -699,10 +699,10 @@ discard block |
||
699 | 699 | if (empty($userroles)) { |
700 | 700 | $userroles = get_user_roles($context, $userid, true); |
701 | 701 | } |
702 | - return bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles); |
|
702 | + return bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles); |
|
703 | 703 | } |
704 | 704 | |
705 | -function bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles) { |
|
705 | +function bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles) { |
|
706 | 706 | // Iterate participant rules. |
707 | 707 | foreach ($participantlist as $participant) { |
708 | 708 | if (bigbluebuttonbn_is_moderator_validate_rule($participant, $userid, $userroles)) { |
@@ -747,9 +747,9 @@ discard block |
||
747 | 747 | $isunique = true; |
748 | 748 | if ($voicebridge != 0) { |
749 | 749 | $table = 'bigbluebuttonbn'; |
750 | - $select = 'voicebridge = '.$voicebridge; |
|
750 | + $select = 'voicebridge = ' . $voicebridge; |
|
751 | 751 | if ($id) { |
752 | - $select .= ' AND id <> '.$id; |
|
752 | + $select .= ' AND id <> ' . $id; |
|
753 | 753 | } |
754 | 754 | if ($DB->get_records_select($table, $select)) { |
755 | 755 | $isunique = false; |
@@ -803,7 +803,7 @@ discard block |
||
803 | 803 | function bigbluebuttonbn_generate_nonce() { |
804 | 804 | $mt = microtime(); |
805 | 805 | $rand = mt_rand(); |
806 | - return md5($mt.$rand); |
|
806 | + return md5($mt . $rand); |
|
807 | 807 | } |
808 | 808 | |
809 | 809 | function bigbluebuttonbn_random_password($length = 8) { |
@@ -814,41 +814,41 @@ discard block |
||
814 | 814 | |
815 | 815 | function bigbluebuttonbn_events() { |
816 | 816 | return array( |
817 | - (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
818 | - (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
819 | - (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
820 | - (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
821 | - (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
822 | - (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
823 | - (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
824 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
825 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
826 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
827 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
828 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
829 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
830 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
831 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
817 | + (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
818 | + (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
819 | + (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
820 | + (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
821 | + (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
822 | + (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
823 | + (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
824 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
825 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
826 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
827 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
828 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
829 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
830 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
831 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
832 | 832 | ); |
833 | 833 | } |
834 | 834 | |
835 | 835 | function bigbluebuttonbn_events_action() { |
836 | 836 | return array( |
837 | - 'view' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
838 | - 'view_management' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
839 | - 'live_action' => (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
840 | - 'meeting_create' => (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
841 | - 'meeting_end' => (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
842 | - 'meeting_join' => (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
843 | - 'meeting_left' => (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
844 | - 'recording_delete' => (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
845 | - 'recording_import' => (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
846 | - 'recording_protect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
847 | - 'recording_publish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
848 | - 'recording_unprotect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
849 | - 'recording_unpublish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
850 | - 'recording_edit' => (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
851 | - 'recording_play' => (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
837 | + 'view' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
838 | + 'view_management' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
839 | + 'live_action' => (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
840 | + 'meeting_create' => (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
841 | + 'meeting_end' => (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
842 | + 'meeting_join' => (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
843 | + 'meeting_left' => (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
844 | + 'recording_delete' => (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
845 | + 'recording_import' => (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
846 | + 'recording_protect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
847 | + 'recording_publish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
848 | + 'recording_unprotect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
849 | + 'recording_unpublish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
850 | + 'recording_edit' => (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
851 | + 'recording_play' => (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
852 | 852 | ); |
853 | 853 | } |
854 | 854 | |
@@ -869,7 +869,7 @@ discard block |
||
869 | 869 | if (array_key_exists('other', $options)) { |
870 | 870 | $eventproperties['other'] = $options['other']; |
871 | 871 | } |
872 | - $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create', |
|
872 | + $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_' . $eventtype . '::create', |
|
873 | 873 | array($eventproperties)); |
874 | 874 | $event->trigger(); |
875 | 875 | } |
@@ -910,10 +910,10 @@ discard block |
||
910 | 910 | $now = time(); |
911 | 911 | if (!$forced && isset($result) && $now < ($result['creation_time'] + $cachettl)) { |
912 | 912 | // Use the value in the cache. |
913 | - return (array) json_decode($result['meeting_info']); |
|
913 | + return (array)json_decode($result['meeting_info']); |
|
914 | 914 | } |
915 | 915 | // Ping again and refresh the cache. |
916 | - $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file( |
|
916 | + $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file( |
|
917 | 917 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
918 | 918 | ); |
919 | 919 | $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); |
@@ -988,8 +988,8 @@ discard block |
||
988 | 988 | * @param string $configxml |
989 | 989 | */ |
990 | 990 | function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) { |
991 | - $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid); |
|
992 | - $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.\mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
991 | + $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid); |
|
992 | + $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . \mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
993 | 993 | return $configxmlparams; |
994 | 994 | } |
995 | 995 | |
@@ -998,7 +998,7 @@ discard block |
||
998 | 998 | * @param string $configxml |
999 | 999 | */ |
1000 | 1000 | function bigbluebuttonbn_set_config_xml($meetingid, $configxml) { |
1001 | - $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?'; |
|
1001 | + $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?'; |
|
1002 | 1002 | $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml); |
1003 | 1003 | $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, BIGBLUEBUTTONBN_METHOD_POST, |
1004 | 1004 | $configxmlparams, 'application/x-www-form-urlencoded'); |
@@ -1011,7 +1011,7 @@ discard block |
||
1011 | 1011 | */ |
1012 | 1012 | function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) { |
1013 | 1013 | $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml); |
1014 | - $configxmlarray = (array) $configxml; |
|
1014 | + $configxmlarray = (array)$configxml; |
|
1015 | 1015 | if ($configxmlarray['returncode'] != 'SUCCESS') { |
1016 | 1016 | debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER); |
1017 | 1017 | return ''; |
@@ -1061,7 +1061,7 @@ discard block |
||
1061 | 1061 | global $USER; |
1062 | 1062 | $starttime = $starttime - ($starttime % 1000); |
1063 | 1063 | // Set formatted date. |
1064 | - $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z'; |
|
1064 | + $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z'; |
|
1065 | 1065 | return userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone)); |
1066 | 1066 | } |
1067 | 1067 | |
@@ -1077,7 +1077,7 @@ discard block |
||
1077 | 1077 | function bigbluebuttonbn_get_recording_data_row_actionbar($recording, $tools) { |
1078 | 1078 | $actionbar = ''; |
1079 | 1079 | foreach ($tools as $tool) { |
1080 | - if ( $tool == 'protect' && !isset($recording['protected']) ) { |
|
1080 | + if ($tool == 'protect' && !isset($recording['protected'])) { |
|
1081 | 1081 | continue; |
1082 | 1082 | } |
1083 | 1083 | $buttonpayload = bigbluebuttonbn_get_recording_data_row_actionbar_payload($recording, $tool); |
@@ -1121,7 +1121,7 @@ discard block |
||
1121 | 1121 | $visibility = 'hidden '; |
1122 | 1122 | } |
1123 | 1123 | $recordingpreview = html_writer::start_tag('div', |
1124 | - array('id' => 'preview-'.$recording['recordID'], $visibility => $visibility)); |
|
1124 | + array('id' => 'preview-' . $recording['recordID'], $visibility => $visibility)); |
|
1125 | 1125 | foreach ($recording['playbacks'] as $playback) { |
1126 | 1126 | if (isset($playback['preview'])) { |
1127 | 1127 | foreach ($playback['preview'] as $image) { |
@@ -1149,13 +1149,13 @@ discard block |
||
1149 | 1149 | if ($recording['published'] === 'false') { |
1150 | 1150 | $visibility = 'hidden '; |
1151 | 1151 | } |
1152 | - $id = 'playbacks-'.$recording['recordID']; |
|
1152 | + $id = 'playbacks-' . $recording['recordID']; |
|
1153 | 1153 | $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported, |
1154 | 1154 | 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
1155 | 1155 | 'title' => $title, $visibility => $visibility)); |
1156 | 1156 | foreach ($recording['playbacks'] as $playback) { |
1157 | 1157 | $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bigbluebuttonbnid, |
1158 | - $playback).' '; |
|
1158 | + $playback) . ' '; |
|
1159 | 1159 | } |
1160 | 1160 | $recordingtypes .= html_writer::end_tag('div'); |
1161 | 1161 | return $recordingtypes; |
@@ -1163,12 +1163,12 @@ discard block |
||
1163 | 1163 | |
1164 | 1164 | function bigbluebuttonbn_get_recording_data_row_type($recording, $bigbluebuttonbnid, $playback) { |
1165 | 1165 | global $CFG, $OUTPUT; |
1166 | - $title = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'); |
|
1166 | + $title = get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn'); |
|
1167 | 1167 | $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_play(this);'; |
1168 | - $href = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=play&bn='.$bigbluebuttonbnid. |
|
1169 | - '&mid='.$recording['meetingID'].'&rid='.$recording['recordID'].'&rtype='.$playback['type']; |
|
1168 | + $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bigbluebuttonbnid . |
|
1169 | + '&mid=' . $recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
1170 | 1170 | if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') { |
1171 | - $href .= '&href='.urlencode(trim($playback['url'])); |
|
1171 | + $href .= '&href=' . urlencode(trim($playback['url'])); |
|
1172 | 1172 | } |
1173 | 1173 | $id = 'recording-play-' . $playback['type'] . '-' . $recording['recordID']; |
1174 | 1174 | $linkattributes = array( |
@@ -1250,11 +1250,11 @@ discard block |
||
1250 | 1250 | $target .= '-' . $data['target']; |
1251 | 1251 | } |
1252 | 1252 | $id = 'recording-' . $target . '-' . $recording['recordID']; |
1253 | - $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_'.$data['action'].'(this);'; |
|
1253 | + $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_' . $data['action'] . '(this);'; |
|
1254 | 1254 | if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recording_icons_enabled')) { |
1255 | 1255 | // With icon for $manageaction. |
1256 | 1256 | $iconattributes = array('id' => $id, 'class' => 'iconsmall'); |
1257 | - $icon = new pix_icon('i/'.$data['tag'], |
|
1257 | + $icon = new pix_icon('i/' . $data['tag'], |
|
1258 | 1258 | get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'), |
1259 | 1259 | 'moodle', $iconattributes); |
1260 | 1260 | $linkattributes = array( |
@@ -1336,7 +1336,7 @@ discard block |
||
1336 | 1336 | if (isset($recordings) && !array_key_exists('messageKey', $recordings)) { |
1337 | 1337 | // There are recordings for this meeting. |
1338 | 1338 | foreach ($recordings as $recording) { |
1339 | - if ( !bigbluebuttonbn_include_recording_table_row($bbbsession, $recording) ) { |
|
1339 | + if (!bigbluebuttonbn_include_recording_table_row($bbbsession, $recording)) { |
|
1340 | 1340 | continue; |
1341 | 1341 | } |
1342 | 1342 | bigbluebuttonbn_get_recording_table_row($bbbsession, $recording, $tools, $table); |
@@ -1351,7 +1351,7 @@ discard block |
||
1351 | 1351 | return; |
1352 | 1352 | } |
1353 | 1353 | $row = new html_table_row(); |
1354 | - $row->id = 'recording-td-'.$recording['recordID']; |
|
1354 | + $row->id = 'recording-td-' . $recording['recordID']; |
|
1355 | 1355 | $row->attributes['data-imported'] = 'false'; |
1356 | 1356 | $texthead = ''; |
1357 | 1357 | $texttail = ''; |
@@ -1375,7 +1375,7 @@ discard block |
||
1375 | 1375 | } |
1376 | 1376 | |
1377 | 1377 | function bigbluebuttonbn_include_recording_table_row($bbbsession, $recording) { |
1378 | - if ( isset($recording['imported']) || !isset($bbbsession['group']) || $recording['meetingID'] == $bbbsession['meetingid'] ) { |
|
1378 | + if (isset($recording['imported']) || !isset($bbbsession['group']) || $recording['meetingID'] == $bbbsession['meetingid']) { |
|
1379 | 1379 | return true; |
1380 | 1380 | } |
1381 | 1381 | return false; |
@@ -1388,9 +1388,9 @@ discard block |
||
1388 | 1388 | // Build the message_body. |
1389 | 1389 | $msg->activity_type = ''; |
1390 | 1390 | $msg->activity_title = $bigbluebuttonbn->name; |
1391 | - $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn').' '. |
|
1392 | - $msg->activity_type.' "'.$msg->activity_title.'" '. |
|
1393 | - get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>'; |
|
1391 | + $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . ' ' . |
|
1392 | + $msg->activity_type . ' "' . $msg->activity_title . '" ' . |
|
1393 | + get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>'; |
|
1394 | 1394 | bigbluebuttonbn_send_notification($sender, $bigbluebuttonbn, $messagetext); |
1395 | 1395 | } |
1396 | 1396 | |
@@ -1480,15 +1480,15 @@ discard block |
||
1480 | 1480 | |
1481 | 1481 | function bigbluebuttonbn_get_recordings_sql_selectdeleted($courseid, $bigbluebuttonbnid = null, $subset = true) { |
1482 | 1482 | if ($bigbluebuttonbnid === null) { |
1483 | - return "courseid = '{$courseid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE. |
|
1483 | + return "courseid = '{$courseid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE . |
|
1484 | 1484 | "' AND meta like '%has_recordings%' AND meta like '%true%'"; |
1485 | 1485 | } |
1486 | 1486 | if ($subset) { |
1487 | - return "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE. |
|
1487 | + return "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE . |
|
1488 | 1488 | "' AND meta like '%has_recordings%' AND meta like '%true%'"; |
1489 | 1489 | } |
1490 | - return "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '". |
|
1491 | - BIGBLUEBUTTONBN_LOG_EVENT_DELETE."' AND meta like '%has_recordings%' AND meta like '%true%'"; |
|
1490 | + return "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '" . |
|
1491 | + BIGBLUEBUTTONBN_LOG_EVENT_DELETE . "' AND meta like '%has_recordings%' AND meta like '%true%'"; |
|
1492 | 1492 | } |
1493 | 1493 | |
1494 | 1494 | function bigbluebuttonbn_get_allrecordings($courseid, $bigbluebuttonbnid = null, $subset = true, |
@@ -1533,7 +1533,7 @@ discard block |
||
1533 | 1533 | } |
1534 | 1534 | // Prepare select for loading records based on existent bigbluebuttonbns. |
1535 | 1535 | $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE '; |
1536 | - $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')'; |
|
1536 | + $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')'; |
|
1537 | 1537 | // Include only Create events and exclude those with record not true. |
1538 | 1538 | $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?'; |
1539 | 1539 | // Execute select for loading records based on existent bigbluebuttonbns. |
@@ -1608,8 +1608,8 @@ discard block |
||
1608 | 1608 | function bigbluebuttonbn_format_activity_time($time) { |
1609 | 1609 | $activitytime = ''; |
1610 | 1610 | if ($time) { |
1611 | - $activitytime = calendar_day_representation($time).' '. |
|
1612 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
1611 | + $activitytime = calendar_day_representation($time) . ' ' . |
|
1612 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' . |
|
1613 | 1613 | calendar_time_representation($time); |
1614 | 1614 | } |
1615 | 1615 | return $activitytime; |
@@ -1716,7 +1716,7 @@ discard block |
||
1716 | 1716 | // This feature only works if curl is installed. |
1717 | 1717 | $preuploaddescripion = get_string('config_preuploadpresentation_description', 'bigbluebuttonbn'); |
1718 | 1718 | if (!extension_loaded('curl')) { |
1719 | - $preuploaddescripion .= '<div class="form-defaultinfo">'.get_string('config_warning_curl_not_installed', 'bigbluebuttonbn').'</div><br>'; |
|
1719 | + $preuploaddescripion .= '<div class="form-defaultinfo">' . get_string('config_warning_curl_not_installed', 'bigbluebuttonbn') . '</div><br>'; |
|
1720 | 1720 | } |
1721 | 1721 | $renderer->render_group_header('preuploadpresentation', null, $preuploaddescripion); |
1722 | 1722 | if (extension_loaded('curl')) { |
@@ -27,32 +27,32 @@ discard block |
||
27 | 27 | |
28 | 28 | global $CFG; |
29 | 29 | |
30 | -require_once($CFG->dirroot.'/calendar/lib.php'); |
|
31 | -require_once($CFG->dirroot.'/message/lib.php'); |
|
32 | -require_once($CFG->dirroot.'/mod/lti/OAuth.php'); |
|
33 | -require_once($CFG->libdir.'/accesslib.php'); |
|
34 | -require_once($CFG->libdir.'/completionlib.php'); |
|
35 | -require_once($CFG->libdir.'/datalib.php'); |
|
36 | -require_once($CFG->libdir.'/coursecatlib.php'); |
|
37 | -require_once($CFG->libdir.'/enrollib.php'); |
|
38 | -require_once($CFG->libdir.'/filelib.php'); |
|
39 | -require_once($CFG->libdir.'/formslib.php'); |
|
40 | - |
|
41 | -if (file_exists(dirname(__FILE__).'/vendor/firebase/php-jwt/src/JWT.php')) { |
|
42 | - require_once(dirname(__FILE__).'/vendor/firebase/php-jwt/src/JWT.php'); |
|
30 | +require_once($CFG->dirroot . '/calendar/lib.php'); |
|
31 | +require_once($CFG->dirroot . '/message/lib.php'); |
|
32 | +require_once($CFG->dirroot . '/mod/lti/OAuth.php'); |
|
33 | +require_once($CFG->libdir . '/accesslib.php'); |
|
34 | +require_once($CFG->libdir . '/completionlib.php'); |
|
35 | +require_once($CFG->libdir . '/datalib.php'); |
|
36 | +require_once($CFG->libdir . '/coursecatlib.php'); |
|
37 | +require_once($CFG->libdir . '/enrollib.php'); |
|
38 | +require_once($CFG->libdir . '/filelib.php'); |
|
39 | +require_once($CFG->libdir . '/formslib.php'); |
|
40 | + |
|
41 | +if (file_exists(dirname(__FILE__) . '/vendor/firebase/php-jwt/src/JWT.php')) { |
|
42 | + require_once(dirname(__FILE__) . '/vendor/firebase/php-jwt/src/JWT.php'); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | if (!isset($CFG->bigbluebuttonbn)) { |
46 | 46 | $CFG->bigbluebuttonbn = array(); |
47 | 47 | } |
48 | 48 | |
49 | -if (file_exists(dirname(__FILE__).'/config.php')) { |
|
50 | - require_once(dirname(__FILE__).'/config.php'); |
|
49 | +if (file_exists(dirname(__FILE__) . '/config.php')) { |
|
50 | + require_once(dirname(__FILE__) . '/config.php'); |
|
51 | 51 | // Old BigBlueButtonBN cfg schema. For backward compatibility. |
52 | 52 | global $BIGBLUEBUTTONBN_CFG; |
53 | 53 | |
54 | 54 | if (isset($BIGBLUEBUTTONBN_CFG)) { |
55 | - foreach ((array) $BIGBLUEBUTTONBN_CFG as $key => $value) { |
|
55 | + foreach ((array)$BIGBLUEBUTTONBN_CFG as $key => $value) { |
|
56 | 56 | $cfgkey = str_replace("bigbluebuttonbn_", "", $key); |
57 | 57 | $CFG->bigbluebuttonbn[$cfgkey] = $value; |
58 | 58 | } |
@@ -83,19 +83,19 @@ discard block |
||
83 | 83 | } |
84 | 84 | |
85 | 85 | $features = array( |
86 | - (string) FEATURE_IDNUMBER => true, |
|
87 | - (string) FEATURE_GROUPS => true, |
|
88 | - (string) FEATURE_GROUPINGS => true, |
|
89 | - (string) FEATURE_GROUPMEMBERSONLY => true, |
|
90 | - (string) FEATURE_MOD_INTRO => true, |
|
91 | - (string) FEATURE_BACKUP_MOODLE2 => true, |
|
92 | - (string) FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
93 | - (string) FEATURE_GRADE_HAS_GRADE => false, |
|
94 | - (string) FEATURE_GRADE_OUTCOMES => false, |
|
95 | - (string) FEATURE_SHOW_DESCRIPTION => true, |
|
86 | + (string)FEATURE_IDNUMBER => true, |
|
87 | + (string)FEATURE_GROUPS => true, |
|
88 | + (string)FEATURE_GROUPINGS => true, |
|
89 | + (string)FEATURE_GROUPMEMBERSONLY => true, |
|
90 | + (string)FEATURE_MOD_INTRO => true, |
|
91 | + (string)FEATURE_BACKUP_MOODLE2 => true, |
|
92 | + (string)FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
93 | + (string)FEATURE_GRADE_HAS_GRADE => false, |
|
94 | + (string)FEATURE_GRADE_OUTCOMES => false, |
|
95 | + (string)FEATURE_SHOW_DESCRIPTION => true, |
|
96 | 96 | ); |
97 | 97 | |
98 | - if (isset($features[(string) $feature])) { |
|
98 | + if (isset($features[(string)$feature])) { |
|
99 | 99 | return $features[$feature]; |
100 | 100 | } |
101 | 101 | |
@@ -207,10 +207,10 @@ discard block |
||
207 | 207 | $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id, |
208 | 208 | 'bigbluebuttonbnid' => $bigbluebuttonbn->id, |
209 | 209 | 'userid' => $user->id, |
210 | - 'log' => 'Join', ), '*'); |
|
210 | + 'log' => 'Join',), '*'); |
|
211 | 211 | if ($completed > 0) { |
212 | - return fullname($user).' '.get_string('view_message_has_joined', 'bigbluebuttonbn').' '. |
|
213 | - get_string('view_message_session_for', 'bigbluebuttonbn').' '.(string) $completed.' '. |
|
212 | + return fullname($user) . ' ' . get_string('view_message_has_joined', 'bigbluebuttonbn') . ' ' . |
|
213 | + get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string)$completed . ' ' . |
|
214 | 214 | get_string('view_message_times', 'bigbluebuttonbn'); |
215 | 215 | } |
216 | 216 | return ''; |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | $completed = $DB->count_recorda('bigbluebuttonbn_logs', array('courseid' => $course->id, |
228 | 228 | 'bigbluebuttonbnid' => $bigbluebuttonbn->id, |
229 | 229 | 'userid' => $user->id, |
230 | - 'log' => 'Join', ), '*', IGNORE_MULTIPLE); |
|
230 | + 'log' => 'Join',), '*', IGNORE_MULTIPLE); |
|
231 | 231 | return $completed > 0; |
232 | 232 | } |
233 | 233 | |
@@ -296,16 +296,16 @@ discard block |
||
296 | 296 | if ($bigbluebuttonbn->visible) { |
297 | 297 | $classes = 'class="dimmed" '; |
298 | 298 | } |
299 | - $str = '<div class="bigbluebuttonbn overview">'."\n"; |
|
300 | - $str .= ' <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; |
|
301 | - $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule. |
|
302 | - '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
303 | - $str .= ' </div>'."\n"; |
|
304 | - $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime). |
|
305 | - '</div>'."\n"; |
|
306 | - $str .= ' <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) |
|
307 | - .'</div>'."\n"; |
|
308 | - $str .= '</div>'."\n"; |
|
299 | + $str = '<div class="bigbluebuttonbn overview">' . "\n"; |
|
300 | + $str .= ' <div class="name">' . get_string('modulename', 'bigbluebuttonbn') . ': ' . "\n"; |
|
301 | + $str .= ' <a ' . $classes . 'href="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bigbluebuttonbn->coursemodule . |
|
302 | + '">' . $bigbluebuttonbn->name . '</a>' . "\n"; |
|
303 | + $str .= ' </div>' . "\n"; |
|
304 | + $str .= ' <div class="info">' . get_string($start, 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->openingtime) . |
|
305 | + '</div>' . "\n"; |
|
306 | + $str .= ' <div class="info">' . get_string('ends_at', 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->closingtime) |
|
307 | + .'</div>' . "\n"; |
|
308 | + $str .= '</div>' . "\n"; |
|
309 | 309 | |
310 | 310 | return $str; |
311 | 311 | } |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | /* Now that an id was assigned, generate and set the meetingid property based on |
397 | 397 | * [Moodle Instance + Activity ID + BBB Secret] (but only for new activities) */ |
398 | 398 | if (isset($bigbluebuttonbn->add) && !empty($bigbluebuttonbn->add)) { |
399 | - $meetingid = sha1($CFG->wwwroot.$bigbluebuttonbn->id.\mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
399 | + $meetingid = sha1($CFG->wwwroot . $bigbluebuttonbn->id . \mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
400 | 400 | $DB->set_field('bigbluebuttonbn', 'meetingid', $meetingid, array('id' => $bigbluebuttonbn->id)); |
401 | 401 | |
402 | 402 | $action = get_string('mod_form_field_notification_msg_created', 'bigbluebuttonbn'); |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | if (count($files) == 1) { |
479 | 479 | // Get the first (and only) file. |
480 | 480 | $file = reset($files); |
481 | - $filesrc = '/'.$file->get_filename(); |
|
481 | + $filesrc = '/' . $file->get_filename(); |
|
482 | 482 | } |
483 | 483 | // Set the presentation column in the bigbluebuttonbn table. |
484 | 484 | $DB->set_field('bigbluebuttonbn', 'presentation', $filesrc, array('id' => $bigbluebuttonbnid)); |
@@ -535,7 +535,7 @@ discard block |
||
535 | 535 | return false; |
536 | 536 | } |
537 | 537 | |
538 | - $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename; |
|
538 | + $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename; |
|
539 | 539 | $fs = get_file_storage(); |
540 | 540 | $file = $fs->get_file_by_hash(sha1($fullpath)); |
541 | 541 | if (!$file || $file->is_directory()) { |