@@ -276,6 +276,9 @@ discard block |
||
276 | 276 | $PAGE->requires->js_init_call('M.mod_bigbluebuttonbn.view_init', array(), false, $jsmodule); |
277 | 277 | } |
278 | 278 | |
279 | +/** |
|
280 | + * @param boolean $showrecordings |
|
281 | + */ |
|
279 | 282 | function bigbluebuttonbn_view_show_rooms($bbbsession, $activity, $showrecordings, &$jsvars) |
280 | 283 | { |
281 | 284 | global $OUTPUT; |
@@ -321,6 +324,10 @@ discard block |
||
321 | 324 | return $output; |
322 | 325 | } |
323 | 326 | |
327 | +/** |
|
328 | + * @param boolean $showroom |
|
329 | + * @param string[] $jsdependences |
|
330 | + */ |
|
324 | 331 | function bigbluebuttonbn_view_show_recordings($bbbsession, $showroom, &$jsvars, &$jsdependences) |
325 | 332 | { |
326 | 333 |
@@ -326,9 +326,9 @@ discard block |
||
326 | 326 | |
327 | 327 | // Get recordings |
328 | 328 | $recordings = bigbluebuttonbn_get_recordings($bbbsession['course']->id, |
329 | - $showroom ? $bbbsession['bigbluebuttonbn']->id : null, |
|
330 | - $showroom, |
|
331 | - $bbbsession['bigbluebuttonbn']->recordings_deleted_activities); |
|
329 | + $showroom ? $bbbsession['bigbluebuttonbn']->id : null, |
|
330 | + $showroom, |
|
331 | + $bbbsession['bigbluebuttonbn']->recordings_deleted_activities); |
|
332 | 332 | |
333 | 333 | if (!isset($recordings) || empty($recordings) || array_key_exists('messageKey', $recordings)) { |
334 | 334 | // There are no recordings to be shown. |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | // JavaScript variables for recordings |
340 | 340 | $jsvars += array( |
341 | 341 | 'recordings_html' => $bbbsession['bigbluebuttonbn']->recordings_html == '1', |
342 | - ); |
|
342 | + ); |
|
343 | 343 | |
344 | 344 | // If there are meetings with recordings load the data to the table |
345 | 345 | if ($bbbsession['bigbluebuttonbn']->recordings_html) { |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | $jsvars += array( |
352 | 352 | 'columns' => bigbluebuttonbn_get_recording_columns($bbbsession), |
353 | 353 | 'data' => bigbluebuttonbn_get_recording_data($bbbsession, $recordings), |
354 | - ); |
|
354 | + ); |
|
355 | 355 | |
356 | 356 | // JavaScript dependences for recordings with YUI |
357 | 357 | $jsdependences += array('datatable', 'datatable-sort', 'datatable-paginator', 'datatype-number'); |
@@ -22,8 +22,8 @@ discard block |
||
22 | 22 | * @copyright 2010-2015 Blindside Networks Inc |
23 | 23 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v2 or later |
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 | $id = required_param('id', PARAM_INT); // Course Module ID, or |
29 | 29 | $b = optional_param('n', 0, PARAM_INT); // bigbluebuttonbn instance ID |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $bbbsession['wait'] = $bigbluebuttonbn->wait; |
89 | 89 | $bbbsession['record'] = $bigbluebuttonbn->record; |
90 | 90 | if ($bigbluebuttonbn->record) { |
91 | - $bbbsession['welcome'] .= '<br><br>'.get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
|
91 | + $bbbsession['welcome'] .= '<br><br>' . get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
|
92 | 92 | } |
93 | 93 | $bbbsession['tagging'] = $bigbluebuttonbn->tagging; |
94 | 94 | |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | $bbbsession['originServerName'] = $parsedUrl['host']; |
109 | 109 | $bbbsession['originServerUrl'] = $CFG->wwwroot; |
110 | 110 | $bbbsession['originServerCommonName'] = ''; |
111 | -$bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn ('.get_config('mod_bigbluebuttonbn', 'version').')'; |
|
111 | +$bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn (' . get_config('mod_bigbluebuttonbn', 'version') . ')'; |
|
112 | 112 | //////////////////////////////////////////////// |
113 | 113 | ///// BigBlueButton Session Setup Ends ///// |
114 | 114 | //////////////////////////////////////////////// |
@@ -117,11 +117,11 @@ discard block |
||
117 | 117 | $serverVersion = bigbluebuttonbn_getServerVersion($bbbsession['endpoint']); |
118 | 118 | if (!isset($serverVersion)) { //Server is not working |
119 | 119 | if ($bbbsession['administrator']) { |
120 | - print_error('view_error_unable_join', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
120 | + print_error('view_error_unable_join', 'bigbluebuttonbn', $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
121 | 121 | } elseif ($bbbsession['moderator']) { |
122 | - print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course); |
|
122 | + print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course); |
|
123 | 123 | } else { |
124 | - print_error('view_error_unable_join_student', 'bigbluebuttonbn', $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course); |
|
124 | + print_error('view_error_unable_join_student', 'bigbluebuttonbn', $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course); |
|
125 | 125 | } |
126 | 126 | } |
127 | 127 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | |
132 | 132 | // Print the page header |
133 | 133 | $PAGE->set_context($context); |
134 | -$PAGE->set_url($CFG->wwwroot.'/mod/bigbluebuttonbn/view.php', array('id' => $cm->id)); |
|
134 | +$PAGE->set_url($CFG->wwwroot . '/mod/bigbluebuttonbn/view.php', array('id' => $cm->id)); |
|
135 | 135 | $PAGE->set_title(format_string($bigbluebuttonbn->name)); |
136 | 136 | $PAGE->set_cacheable(false); |
137 | 137 | $PAGE->set_heading($course->fullname); |
@@ -141,11 +141,11 @@ discard block |
||
141 | 141 | if (!has_capability('moodle/category:manage', $context) && !has_capability('mod/bigbluebuttonbn:join', $context)) { |
142 | 142 | echo $OUTPUT->header(); |
143 | 143 | if (isguestuser()) { |
144 | - echo $OUTPUT->confirm('<p>'.get_string('view_noguests', 'bigbluebuttonbn').'</p>'.get_string('liketologin'), |
|
145 | - get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id); |
|
144 | + echo $OUTPUT->confirm('<p>' . get_string('view_noguests', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'), |
|
145 | + get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id); |
|
146 | 146 | } else { |
147 | - echo $OUTPUT->confirm('<p>'.get_string('view_nojoin', 'bigbluebuttonbn').'</p>'.get_string('liketologin'), |
|
148 | - get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id); |
|
147 | + echo $OUTPUT->confirm('<p>' . get_string('view_nojoin', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'), |
|
148 | + get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id); |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | echo $OUTPUT->footer(); |
@@ -153,29 +153,29 @@ discard block |
||
153 | 153 | } |
154 | 154 | |
155 | 155 | // Operation URLs |
156 | -$bbbsession['courseURL'] = $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course; |
|
157 | -$bbbsession['logoutURL'] = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=logout&id='.$id.'&bn='.$bbbsession['bigbluebuttonbn']->id; |
|
158 | -$bbbsession['recordingReadyURL'] = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_broker.php?action=recording_ready&bigbluebuttonbn='.$bbbsession['bigbluebuttonbn']->id; |
|
159 | -$bbbsession['meetingEventsURL'] = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_broker.php?action=meeting_events&bigbluebuttonbn='.$bbbsession['bigbluebuttonbn']->id; |
|
160 | -$bbbsession['joinURL'] = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=join&id='.$id.'&bigbluebuttonbn='.$bbbsession['bigbluebuttonbn']->id; |
|
156 | +$bbbsession['courseURL'] = $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course; |
|
157 | +$bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id=' . $id . '&bn=' . $bbbsession['bigbluebuttonbn']->id; |
|
158 | +$bbbsession['recordingReadyURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_broker.php?action=recording_ready&bigbluebuttonbn=' . $bbbsession['bigbluebuttonbn']->id; |
|
159 | +$bbbsession['meetingEventsURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_broker.php?action=meeting_events&bigbluebuttonbn=' . $bbbsession['bigbluebuttonbn']->id; |
|
160 | +$bbbsession['joinURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=join&id=' . $id . '&bigbluebuttonbn=' . $bbbsession['bigbluebuttonbn']->id; |
|
161 | 161 | |
162 | 162 | // Output starts here |
163 | 163 | echo $OUTPUT->header(); |
164 | 164 | /// Shows version as a comment |
165 | 165 | echo ' |
166 | -<!-- '.$bbbsession['originTag'].' -->'."\n"; |
|
166 | +<!-- '.$bbbsession['originTag'] . ' -->' . "\n"; |
|
167 | 167 | |
168 | 168 | /// find out current groups mode |
169 | 169 | $groupmode = groups_get_activity_groupmode($bbbsession['cm']); |
170 | 170 | if ($groupmode == NOGROUPS) { //No groups mode |
171 | - $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'.$bbbsession['bigbluebuttonbn']->id; |
|
171 | + $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' . $bbbsession['bigbluebuttonbn']->id; |
|
172 | 172 | $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name; |
173 | 173 | } else { // Separate or visible groups mode |
174 | 174 | echo $OUTPUT->box_start('generalbox boxaligncenter'); |
175 | - echo '<br><div class="alert alert-warning">'.get_string('view_groups_selection_warning', 'bigbluebuttonbn').'</div>'; |
|
175 | + echo '<br><div class="alert alert-warning">' . get_string('view_groups_selection_warning', 'bigbluebuttonbn') . '</div>'; |
|
176 | 176 | echo $OUTPUT->box_end(); |
177 | 177 | |
178 | - groups_print_activity_menu($cm, $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bbbsession['cm']->id); |
|
178 | + groups_print_activity_menu($cm, $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id); |
|
179 | 179 | if ($groupmode == SEPARATEGROUPS) { |
180 | 180 | $groups = groups_get_activity_allowed_groups($bbbsession['cm']); |
181 | 181 | $current_group = current($groups); |
@@ -185,13 +185,13 @@ discard block |
||
185 | 185 | $bbbsession['group'] = groups_get_activity_group($bbbsession['cm'], true); |
186 | 186 | } |
187 | 187 | |
188 | - $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'.$bbbsession['bigbluebuttonbn']->id.'['.$bbbsession['group'].']'; |
|
188 | + $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' . $bbbsession['bigbluebuttonbn']->id . '[' . $bbbsession['group'] . ']'; |
|
189 | 189 | if ($bbbsession['group'] > 0) { |
190 | 190 | $group_name = groups_get_group_name($bbbsession['group']); |
191 | 191 | } else { |
192 | 192 | $group_name = get_string('allparticipants'); |
193 | 193 | } |
194 | - $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name.' ('.$group_name.')'; |
|
194 | + $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name . ' (' . $group_name . ')'; |
|
195 | 195 | } |
196 | 196 | // Metadata (context) |
197 | 197 | $bbbsession['contextActivityName'] = $bbbsession['meetingname']; |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | } |
261 | 261 | } |
262 | 262 | |
263 | - $output .= html_writer::empty_tag('br').html_writer::empty_tag('br').html_writer::empty_tag('br'); |
|
263 | + $output .= html_writer::empty_tag('br') . html_writer::empty_tag('br') . html_writer::empty_tag('br'); |
|
264 | 264 | |
265 | 265 | echo $output; |
266 | 266 | |
@@ -285,11 +285,11 @@ discard block |
||
285 | 285 | //JavaScript variables for room |
286 | 286 | $openingtime = ''; |
287 | 287 | if ($bbbsession['openingtime']) { |
288 | - $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn').': '.userdate($bbbsession['openingtime']); |
|
288 | + $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn') . ': ' . userdate($bbbsession['openingtime']); |
|
289 | 289 | } |
290 | 290 | $closingtime = ''; |
291 | 291 | if ($bbbsession['closingtime']) { |
292 | - $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn').': '.userdate($bbbsession['closingtime']); |
|
292 | + $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn') . ': ' . userdate($bbbsession['closingtime']); |
|
293 | 293 | } |
294 | 294 | $jsvars += array( |
295 | 295 | 'meetingid' => $bbbsession['meetingid'], |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | $output .= $OUTPUT->box_end(); |
306 | 306 | |
307 | 307 | $output .= $OUTPUT->box_start('generalbox boxaligncenter', 'bigbluebuttonbn_view_action_button_box'); |
308 | - $output .= '<br><br><span id="join_button"></span> <span id="end_button"></span>'."\n"; |
|
308 | + $output .= '<br><br><span id="join_button"></span> <span id="end_button"></span>' . "\n"; |
|
309 | 309 | $output .= $OUTPUT->box_end(); |
310 | 310 | |
311 | 311 | if ($activity == 'ended') { |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | // If there are meetings with recordings load the data to the table |
345 | 345 | if ($bbbsession['bigbluebuttonbn']->recordings_html) { |
346 | 346 | // Render a plain html table |
347 | - return bigbluebutton_output_recording_table($bbbsession, $recordings)."\n"; |
|
347 | + return bigbluebutton_output_recording_table($bbbsession, $recordings) . "\n"; |
|
348 | 348 | } |
349 | 349 | |
350 | 350 | // JavaScript variables for recordings with YUI |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | |
367 | 367 | $output = ''; |
368 | 368 | |
369 | - $btn_import_links = html_writer::tag('input', '', array('type' => 'button', 'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'), 'class' => 'btn btn-secondary', 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='.$bbbsession['bigbluebuttonbn']->id.'\'')); |
|
369 | + $btn_import_links = html_writer::tag('input', '', array('type' => 'button', 'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'), 'class' => 'btn btn-secondary', 'onclick' => 'window.location=\'' . $CFG->wwwroot . '/mod/bigbluebuttonbn/import_view.php?bn=' . $bbbsession['bigbluebuttonbn']->id . '\'')); |
|
370 | 370 | $output .= html_writer::start_tag('br'); |
371 | 371 | $output .= html_writer::tag('span', $btn_import_links, array('id' => 'import_recording_links_button')); |
372 | 372 | $output .= html_writer::tag('span', '', array('id' => 'import_recording_links_table')); |
@@ -377,28 +377,28 @@ discard block |
||
377 | 377 | function bigbluebuttonbn_view_joining($bbbsession) |
378 | 378 | { |
379 | 379 | if ($bbbsession['tagging'] && ($bbbsession['administrator'] || $bbbsession['moderator'])) { |
380 | - return ''. |
|
381 | - '<div id="panelContent" class="hidden">'."\n". |
|
382 | - ' <div class="yui3-widget-bd">'."\n". |
|
383 | - ' <form>'."\n". |
|
384 | - ' <fieldset>'."\n". |
|
385 | - ' <input type="hidden" name="join" id="meeting_join_url" value="">'."\n". |
|
386 | - ' <input type="hidden" name="message" id="meeting_message" value="">'."\n". |
|
387 | - ' <div>'."\n". |
|
388 | - ' <label for="name">'.get_string('view_recording_name', 'bigbluebuttonbn').'</label><br/>'."\n". |
|
389 | - ' <input type="text" name="name" id="recording_name" placeholder="">'."\n". |
|
390 | - ' </div><br>'."\n". |
|
391 | - ' <div>'."\n". |
|
392 | - ' <label for="description">'.get_string('view_recording_description', 'bigbluebuttonbn').'</label><br/>'."\n". |
|
393 | - ' <input type="text" name="description" id="recording_description" value="" placeholder="">'."\n". |
|
394 | - ' </div><br>'."\n". |
|
395 | - ' <div>'."\n". |
|
396 | - ' <label for="tags">'.get_string('view_recording_tags', 'bigbluebuttonbn').'</label><br/>'."\n". |
|
397 | - ' <input type="text" name="tags" id="recording_tags" value="" placeholder="">'."\n". |
|
398 | - ' </div>'."\n". |
|
399 | - ' </fieldset>'."\n". |
|
400 | - ' </form>'."\n". |
|
401 | - ' </div>'."\n". |
|
380 | + return '' . |
|
381 | + '<div id="panelContent" class="hidden">' . "\n" . |
|
382 | + ' <div class="yui3-widget-bd">' . "\n" . |
|
383 | + ' <form>' . "\n" . |
|
384 | + ' <fieldset>' . "\n" . |
|
385 | + ' <input type="hidden" name="join" id="meeting_join_url" value="">' . "\n" . |
|
386 | + ' <input type="hidden" name="message" id="meeting_message" value="">' . "\n" . |
|
387 | + ' <div>' . "\n" . |
|
388 | + ' <label for="name">' . get_string('view_recording_name', 'bigbluebuttonbn') . '</label><br/>' . "\n" . |
|
389 | + ' <input type="text" name="name" id="recording_name" placeholder="">' . "\n" . |
|
390 | + ' </div><br>' . "\n" . |
|
391 | + ' <div>' . "\n" . |
|
392 | + ' <label for="description">' . get_string('view_recording_description', 'bigbluebuttonbn') . '</label><br/>' . "\n" . |
|
393 | + ' <input type="text" name="description" id="recording_description" value="" placeholder="">' . "\n" . |
|
394 | + ' </div><br>' . "\n" . |
|
395 | + ' <div>' . "\n" . |
|
396 | + ' <label for="tags">' . get_string('view_recording_tags', 'bigbluebuttonbn') . '</label><br/>' . "\n" . |
|
397 | + ' <input type="text" name="tags" id="recording_tags" value="" placeholder="">' . "\n" . |
|
398 | + ' </div>' . "\n" . |
|
399 | + ' </fieldset>' . "\n" . |
|
400 | + ' </form>' . "\n" . |
|
401 | + ' </div>' . "\n" . |
|
402 | 402 | '</div>'; |
403 | 403 | } |
404 | 404 | |
@@ -413,9 +413,9 @@ discard block |
||
413 | 413 | $attributes = array('title' => $bbbsession['presentation']['name']); |
414 | 414 | $icon = new pix_icon($bbbsession['presentation']['icon'], $bbbsession['presentation']['mimetype_description']); |
415 | 415 | |
416 | - return '<h4>'.get_string('view_section_title_presentation', 'bigbluebuttonbn').'</h4>'. |
|
417 | - ''.$OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false).''. |
|
418 | - ''.$OUTPUT->action_link($bbbsession['presentation']['url'], $bbbsession['presentation']['name'], null, $attributes).'<br><br>'; |
|
416 | + return '<h4>' . get_string('view_section_title_presentation', 'bigbluebuttonbn') . '</h4>' . |
|
417 | + '' . $OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false) . '' . |
|
418 | + '' . $OUTPUT->action_link($bbbsession['presentation']['url'], $bbbsession['presentation']['name'], null, $attributes) . '<br><br>'; |
|
419 | 419 | } |
420 | 420 | |
421 | 421 | return ''; |
@@ -21,8 +21,8 @@ discard block |
||
21 | 21 | * @copyright 2015 Blindside Networks Inc |
22 | 22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v2 or later |
23 | 23 | */ |
24 | -require_once dirname(dirname(dirname(__FILE__))).'/config.php'; |
|
25 | -require_once dirname(__FILE__).'/locallib.php'; |
|
24 | +require_once dirname(dirname(dirname(__FILE__))) . '/config.php'; |
|
25 | +require_once dirname(__FILE__) . '/locallib.php'; |
|
26 | 26 | |
27 | 27 | use \Firebase\JWT\JWT; |
28 | 28 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | if ($bbbsession['administrator'] || $bbbsession['moderator']) { |
102 | 102 | $end_button_text = get_string('view_conference_action_end', 'bigbluebuttonbn'); |
103 | 103 | $can_end = true; |
104 | - $status_can_end = '"can_end": true, "end_button_text": "'.$end_button_text.'", '; |
|
104 | + $status_can_end = '"can_end": true, "end_button_text": "' . $end_button_text . '", '; |
|
105 | 105 | } |
106 | 106 | } else { |
107 | 107 | // If user is administrator, moderator or if is viewer and no waiting is required |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | } else { |
113 | 113 | $initial_message = get_string('view_message_conference_not_started', 'bigbluebuttonbn'); |
114 | 114 | if ($bbbsession['wait']) { |
115 | - $initial_message .= ' '.get_string('view_message_conference_wait_for_moderator', 'bigbluebuttonbn'); |
|
115 | + $initial_message .= ' ' . get_string('view_message_conference_wait_for_moderator', 'bigbluebuttonbn'); |
|
116 | 116 | } |
117 | 117 | $can_join = false; |
118 | 118 | } |
@@ -122,10 +122,10 @@ discard block |
||
122 | 122 | } else { |
123 | 123 | $can_tag = false; |
124 | 124 | } |
125 | - $status_can_end = '"can_tag": '.($can_tag ? 'true' : 'false').', '; |
|
125 | + $status_can_end = '"can_tag": ' . ($can_tag ? 'true' : 'false') . ', '; |
|
126 | 126 | } |
127 | 127 | |
128 | - echo $params['callback'].'({ "running": '.($meeting_running ? 'true' : 'false').', "info": '.json_encode($meeting_info).', "status": {"can_join": '.($can_join ? 'true' : 'false').',"join_url": "'.$bbbsession['joinURL'].'","join_button_text": "'.$join_button_text.'", '.$status_can_end.$status_can_tag.'"message": "'.$initial_message.'"} });'; |
|
128 | + echo $params['callback'] . '({ "running": ' . ($meeting_running ? 'true' : 'false') . ', "info": ' . json_encode($meeting_info) . ', "status": {"can_join": ' . ($can_join ? 'true' : 'false') . ',"join_url": "' . $bbbsession['joinURL'] . '","join_button_text": "' . $join_button_text . '", ' . $status_can_end . $status_can_tag . '"message": "' . $initial_message . '"} });'; |
|
129 | 129 | break; |
130 | 130 | case 'meeting_end': |
131 | 131 | if ($bbbsession['administrator'] || $bbbsession['moderator']) { |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | // Update the cache |
139 | 139 | bigbluebuttonbn_get_meeting_info($params['id'], BIGBLUEBUTTONBN_FORCED); |
140 | 140 | |
141 | - echo $params['callback'].'({ "status": true });'; |
|
141 | + echo $params['callback'] . '({ "status": true });'; |
|
142 | 142 | } else { |
143 | 143 | error_log('ERROR: User not authorized to execute end command'); |
144 | 144 | header('HTTP/1.0 401 Unauthorized. User not authorized to execute end command'); |
@@ -148,9 +148,9 @@ discard block |
||
148 | 148 | if ($bbbsession['managerecordings']) { |
149 | 149 | if (isset($params['id']) && $params['id'] != '') { |
150 | 150 | $recordings_imported_all = bigbluebuttonbn_get_recording_imported_instances($params['id']); |
151 | - echo $params['callback'].'({ "status": "true", "links": '.count($recordings_imported_all).'});'; |
|
151 | + echo $params['callback'] . '({ "status": "true", "links": ' . count($recordings_imported_all) . '});'; |
|
152 | 152 | } else { |
153 | - echo $params['callback'].'({"status": "false"});'; |
|
153 | + echo $params['callback'] . '({"status": "false"});'; |
|
154 | 154 | } |
155 | 155 | } else { |
156 | 156 | error_log('ERROR: User not authorized to execute end command'); |
@@ -165,17 +165,17 @@ discard block |
||
165 | 165 | // Look up for an update on the imported recording |
166 | 166 | $recording = $recordings[$params['id']]; |
167 | 167 | if (isset($recording) && !empty($recording) && !array_key_exists('messageKey', $recording)) { // The recording was found |
168 | - echo $params['callback'].'({ "status": "true", "published": "'.$recording['published'].'"});'; |
|
168 | + echo $params['callback'] . '({ "status": "true", "published": "' . $recording['published'] . '"});'; |
|
169 | 169 | } else { |
170 | - echo $params['callback'].'({ "status": "false" });'; |
|
170 | + echo $params['callback'] . '({ "status": "false" });'; |
|
171 | 171 | } |
172 | 172 | // As the recordingid was not identified as imported recording link, look up for a real recording |
173 | 173 | } else { |
174 | 174 | $recording = bigbluebuttonbn_getRecordingsArray($params['idx'], $params['id']); |
175 | 175 | if (isset($recording) && !empty($recording) && array_key_exists($params['id'], $recording)) { // The recording was found |
176 | - echo $params['callback'].'({ "status": "true", "published": "'.$recording[$params['id']]['published'].'"});'; |
|
176 | + echo $params['callback'] . '({ "status": "true", "published": "' . $recording[$params['id']]['published'] . '"});'; |
|
177 | 177 | } else { |
178 | - echo $params['callback'].'({"status": "false"});'; |
|
178 | + echo $params['callback'] . '({"status": "false"});'; |
|
179 | 179 | } |
180 | 180 | } |
181 | 181 | } else { |
@@ -287,9 +287,9 @@ discard block |
||
287 | 287 | try { |
288 | 288 | $decodedParameters = JWT::decode($params['signed_parameters'], $shared_secret, array('HS256')); |
289 | 289 | } catch (Exception $e) { |
290 | - $error = 'Caught exception: '.$e->getMessage(); |
|
290 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
291 | 291 | error_log($error); |
292 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
292 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
293 | 293 | |
294 | 294 | return; |
295 | 295 | } |
@@ -305,16 +305,16 @@ discard block |
||
305 | 305 | |
306 | 306 | return; |
307 | 307 | } catch (Exception $e) { |
308 | - $error = 'Caught exception: '.$e->getMessage(); |
|
308 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
309 | 309 | error_log($error); |
310 | - header('HTTP/1.0 503 Service Unavailable. '.$error); |
|
310 | + header('HTTP/1.0 503 Service Unavailable. ' . $error); |
|
311 | 311 | |
312 | 312 | return; |
313 | 313 | } |
314 | 314 | } else { |
315 | - $error = 'Caught exception: '.$e->getMessage(); |
|
315 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
316 | 316 | error_log($error); |
317 | - header('HTTP/1.0 410 Gone. '.$error); |
|
317 | + header('HTTP/1.0 410 Gone. ' . $error); |
|
318 | 318 | |
319 | 319 | return; |
320 | 320 | } |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | if (isset($importrecordings[$params['id']])) { |
327 | 327 | $importrecordings[$params['id']]['imported'] = true; |
328 | 328 | $overrides['meetingid'] = $importrecordings[$params['id']]['meetingID']; |
329 | - $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}'; |
|
329 | + $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}'; |
|
330 | 330 | bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta); |
331 | 331 | // Moodle event logger: Create an event for recording imported |
332 | 332 | if (isset($bigbluebuttonbn)) { |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | } else { |
340 | 340 | $error = "Recording {$params['id']} could not be found. It can not be imported"; |
341 | 341 | error_log($error); |
342 | - header('HTTP/1.0 404 Not found. '.$error); |
|
342 | + header('HTTP/1.0 404 Not found. ' . $error); |
|
343 | 343 | |
344 | 344 | return; |
345 | 345 | } |
@@ -350,9 +350,9 @@ discard block |
||
350 | 350 | try { |
351 | 351 | $decodedParameters = JWT::decode($params['signed_parameters'], $shared_secret, array('HS256')); |
352 | 352 | } catch (Exception $e) { |
353 | - $error = 'Caught exception: '.$e->getMessage(); |
|
353 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
354 | 354 | error_log($error); |
355 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
355 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
356 | 356 | |
357 | 357 | return; |
358 | 358 | } |
@@ -390,15 +390,15 @@ discard block |
||
390 | 390 | break; |
391 | 391 | } |
392 | 392 | } catch (Exception $e) { |
393 | - error_log('BBB_BROKER ERROR: '.$e->getCode().', '.$e->getMessage()); |
|
394 | - header('HTTP/1.0 500 Internal Server Error. '.$e->getMessage()); |
|
393 | + error_log('BBB_BROKER ERROR: ' . $e->getCode() . ', ' . $e->getMessage()); |
|
394 | + header('HTTP/1.0 500 Internal Server Error. ' . $e->getMessage()); |
|
395 | 395 | |
396 | 396 | return; |
397 | 397 | } |
398 | 398 | } |
399 | 399 | } else { |
400 | 400 | error_log(json_encode($error)); |
401 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
401 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
402 | 402 | |
403 | 403 | return; |
404 | 404 | } |
@@ -225,9 +225,9 @@ discard block |
||
225 | 225 | global $DB; |
226 | 226 | |
227 | 227 | $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id, |
228 | - 'bigbluebuttonbnid' => $bigbluebuttonbn->id, |
|
229 | - 'userid' => $user->id, |
|
230 | - 'log' => 'Join', ), '*'); |
|
228 | + 'bigbluebuttonbnid' => $bigbluebuttonbn->id, |
|
229 | + 'userid' => $user->id, |
|
230 | + 'log' => 'Join', ), '*'); |
|
231 | 231 | |
232 | 232 | if ($completed > 0) { |
233 | 233 | return fullname($user).' '.get_string('view_message_has_joined', 'bigbluebuttonbn').' '.get_string('view_message_session_for', 'bigbluebuttonbn').' '.(string) $completed.' '.get_string('view_message_times', 'bigbluebuttonbn'); |
@@ -246,9 +246,9 @@ discard block |
||
246 | 246 | { |
247 | 247 | global $DB; |
248 | 248 | $completed = $DB->count_recorda('bigbluebuttonbn_logs', array('courseid' => $course->id, |
249 | - 'bigbluebuttonbnid' => $bigbluebuttonbn->id, |
|
250 | - 'userid' => $user->id, |
|
251 | - 'log' => 'Join', ), '*', IGNORE_MULTIPLE); |
|
249 | + 'bigbluebuttonbnid' => $bigbluebuttonbn->id, |
|
250 | + 'userid' => $user->id, |
|
251 | + 'log' => 'Join', ), '*', IGNORE_MULTIPLE); |
|
252 | 252 | |
253 | 253 | return $completed > 0; |
254 | 254 | } |
@@ -315,11 +315,11 @@ discard block |
||
315 | 315 | $str = '<div class="bigbluebuttonbn overview">'."\n"; |
316 | 316 | $str .= ' <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; |
317 | 317 | $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule. |
318 | - '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
318 | + '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
319 | 319 | $str .= ' </div>'."\n"; |
320 | 320 | $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime).'</div>'."\n"; |
321 | 321 | $str .= ' <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) |
322 | - .'</div>'."\n"; |
|
322 | + .'</div>'."\n"; |
|
323 | 323 | $str .= '</div>'."\n"; |
324 | 324 | |
325 | 325 | if (empty($htmlarray[$bigbluebuttonbn->course]['bigbluebuttonbn'])) { |
@@ -26,23 +26,23 @@ discard block |
||
26 | 26 | |
27 | 27 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
28 | 28 | |
29 | -require_once $CFG->dirroot.'/calendar/lib.php'; |
|
30 | -require_once $CFG->dirroot.'/message/lib.php'; |
|
31 | -require_once $CFG->dirroot.'/mod/lti/OAuth.php'; |
|
32 | -require_once $CFG->libdir.'/accesslib.php'; |
|
33 | -require_once $CFG->libdir.'/completionlib.php'; |
|
34 | -require_once $CFG->libdir.'/datalib.php'; |
|
35 | -require_once $CFG->libdir.'/coursecatlib.php'; |
|
36 | -require_once $CFG->libdir.'/enrollib.php'; |
|
37 | -require_once $CFG->libdir.'/filelib.php'; |
|
38 | -require_once $CFG->libdir.'/formslib.php'; |
|
39 | - |
|
40 | -require_once dirname(__FILE__).'/vendor/firebase/php-jwt/src/JWT.php'; |
|
41 | - |
|
42 | -if (file_exists(dirname(__FILE__).'/config.php')) { |
|
43 | - require_once dirname(__FILE__).'/config.php'; |
|
29 | +require_once $CFG->dirroot . '/calendar/lib.php'; |
|
30 | +require_once $CFG->dirroot . '/message/lib.php'; |
|
31 | +require_once $CFG->dirroot . '/mod/lti/OAuth.php'; |
|
32 | +require_once $CFG->libdir . '/accesslib.php'; |
|
33 | +require_once $CFG->libdir . '/completionlib.php'; |
|
34 | +require_once $CFG->libdir . '/datalib.php'; |
|
35 | +require_once $CFG->libdir . '/coursecatlib.php'; |
|
36 | +require_once $CFG->libdir . '/enrollib.php'; |
|
37 | +require_once $CFG->libdir . '/filelib.php'; |
|
38 | +require_once $CFG->libdir . '/formslib.php'; |
|
39 | + |
|
40 | +require_once dirname(__FILE__) . '/vendor/firebase/php-jwt/src/JWT.php'; |
|
41 | + |
|
42 | +if (file_exists(dirname(__FILE__) . '/config.php')) { |
|
43 | + require_once dirname(__FILE__) . '/config.php'; |
|
44 | 44 | if (isset($BIGBLUEBUTTONBN_CFG)) { |
45 | - $CFG = (object) array_merge((array) $CFG, (array) $BIGBLUEBUTTONBN_CFG); |
|
45 | + $CFG = (object)array_merge((array)$CFG, (array)$BIGBLUEBUTTONBN_CFG); |
|
46 | 46 | } |
47 | 47 | } else { |
48 | 48 | $BIGBLUEBUTTONBN_CFG = new stdClass(); |
@@ -72,19 +72,19 @@ discard block |
||
72 | 72 | } |
73 | 73 | |
74 | 74 | $features = array( |
75 | - (string) FEATURE_IDNUMBER => true, |
|
76 | - (string) FEATURE_GROUPS => true, |
|
77 | - (string) FEATURE_GROUPINGS => true, |
|
78 | - (string) FEATURE_GROUPMEMBERSONLY => true, |
|
79 | - (string) FEATURE_MOD_INTRO => true, |
|
80 | - (string) FEATURE_BACKUP_MOODLE2 => true, |
|
81 | - (string) FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
82 | - (string) FEATURE_GRADE_HAS_GRADE => false, |
|
83 | - (string) FEATURE_GRADE_OUTCOMES => false, |
|
84 | - (string) FEATURE_SHOW_DESCRIPTION => true, |
|
75 | + (string)FEATURE_IDNUMBER => true, |
|
76 | + (string)FEATURE_GROUPS => true, |
|
77 | + (string)FEATURE_GROUPINGS => true, |
|
78 | + (string)FEATURE_GROUPMEMBERSONLY => true, |
|
79 | + (string)FEATURE_MOD_INTRO => true, |
|
80 | + (string)FEATURE_BACKUP_MOODLE2 => true, |
|
81 | + (string)FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
82 | + (string)FEATURE_GRADE_HAS_GRADE => false, |
|
83 | + (string)FEATURE_GRADE_OUTCOMES => false, |
|
84 | + (string)FEATURE_SHOW_DESCRIPTION => true, |
|
85 | 85 | ); |
86 | 86 | |
87 | - if (isset($features[(string) $feature])) { |
|
87 | + if (isset($features[(string)$feature])) { |
|
88 | 88 | return $features[$feature]; |
89 | 89 | } |
90 | 90 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | } |
168 | 168 | |
169 | 169 | // End the session associated with this instance (if it's running) |
170 | - $meetingID = $bigbluebuttonbn->meetingid.'-'.$bigbluebuttonbn->course.'-'.$bigbluebuttonbn->id; |
|
170 | + $meetingID = $bigbluebuttonbn->meetingid . '-' . $bigbluebuttonbn->course . '-' . $bigbluebuttonbn->id; |
|
171 | 171 | $modPW = $bigbluebuttonbn->moderatorpass; |
172 | 172 | |
173 | 173 | if (bigbluebuttonbn_isMeetingRunning($meetingID)) { |
@@ -227,10 +227,10 @@ discard block |
||
227 | 227 | $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id, |
228 | 228 | 'bigbluebuttonbnid' => $bigbluebuttonbn->id, |
229 | 229 | 'userid' => $user->id, |
230 | - 'log' => 'Join', ), '*'); |
|
230 | + 'log' => 'Join',), '*'); |
|
231 | 231 | |
232 | 232 | if ($completed > 0) { |
233 | - return fullname($user).' '.get_string('view_message_has_joined', 'bigbluebuttonbn').' '.get_string('view_message_session_for', 'bigbluebuttonbn').' '.(string) $completed.' '.get_string('view_message_times', 'bigbluebuttonbn'); |
|
233 | + return fullname($user) . ' ' . get_string('view_message_has_joined', 'bigbluebuttonbn') . ' ' . get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string)$completed . ' ' . get_string('view_message_times', 'bigbluebuttonbn'); |
|
234 | 234 | } |
235 | 235 | |
236 | 236 | return ''; |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | $completed = $DB->count_recorda('bigbluebuttonbn_logs', array('courseid' => $course->id, |
249 | 249 | 'bigbluebuttonbnid' => $bigbluebuttonbn->id, |
250 | 250 | 'userid' => $user->id, |
251 | - 'log' => 'Join', ), '*', IGNORE_MULTIPLE); |
|
251 | + 'log' => 'Join',), '*', IGNORE_MULTIPLE); |
|
252 | 252 | |
253 | 253 | return $completed > 0; |
254 | 254 | } |
@@ -312,15 +312,15 @@ discard block |
||
312 | 312 | if ($bigbluebuttonbn->visible) { |
313 | 313 | $classes = 'class="dimmed" '; |
314 | 314 | } |
315 | - $str = '<div class="bigbluebuttonbn overview">'."\n"; |
|
316 | - $str .= ' <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; |
|
317 | - $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule. |
|
318 | - '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
319 | - $str .= ' </div>'."\n"; |
|
320 | - $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime).'</div>'."\n"; |
|
321 | - $str .= ' <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) |
|
322 | - .'</div>'."\n"; |
|
323 | - $str .= '</div>'."\n"; |
|
315 | + $str = '<div class="bigbluebuttonbn overview">' . "\n"; |
|
316 | + $str .= ' <div class="name">' . get_string('modulename', 'bigbluebuttonbn') . ': ' . "\n"; |
|
317 | + $str .= ' <a ' . $classes . 'href="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bigbluebuttonbn->coursemodule . |
|
318 | + '">' . $bigbluebuttonbn->name . '</a>' . "\n"; |
|
319 | + $str .= ' </div>' . "\n"; |
|
320 | + $str .= ' <div class="info">' . get_string($start, 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->openingtime) . '</div>' . "\n"; |
|
321 | + $str .= ' <div class="info">' . get_string('ends_at', 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->closingtime) |
|
322 | + .'</div>' . "\n"; |
|
323 | + $str .= '</div>' . "\n"; |
|
324 | 324 | |
325 | 325 | if (empty($htmlarray[$bigbluebuttonbn->course]['bigbluebuttonbn'])) { |
326 | 326 | $htmlarray[$bigbluebuttonbn->course]['bigbluebuttonbn'] = ''; |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | // Now that an id was assigned, generate and set the meetingid property based on |
418 | 418 | // [Moodle Instance + Activity ID + BBB Secret] (but only for new activities) |
419 | 419 | if (isset($bigbluebuttonbn->add) && !empty($bigbluebuttonbn->add)) { |
420 | - $meetingid = sha1($CFG->wwwroot.$bigbluebuttonbn->id.bigbluebuttonbn_get_cfg_shared_secret()); |
|
420 | + $meetingid = sha1($CFG->wwwroot . $bigbluebuttonbn->id . bigbluebuttonbn_get_cfg_shared_secret()); |
|
421 | 421 | $DB->set_field('bigbluebuttonbn', 'meetingid', $meetingid, array('id' => $bigbluebuttonbn->id)); |
422 | 422 | |
423 | 423 | $action = get_string('mod_form_field_notification_msg_created', 'bigbluebuttonbn'); |
@@ -491,7 +491,7 @@ discard block |
||
491 | 491 | // Get the first (and only) file. |
492 | 492 | $file = reset($files); |
493 | 493 | // Set the presentation column in the bigbluebuttonbn table. |
494 | - $DB->set_field('bigbluebuttonbn', 'presentation', '/'.$file->get_filename(), array('id' => $bigbluebuttonbn_id)); |
|
494 | + $DB->set_field('bigbluebuttonbn', 'presentation', '/' . $file->get_filename(), array('id' => $bigbluebuttonbn_id)); |
|
495 | 495 | } else { |
496 | 496 | // Set the presentation column in the bigbluebuttonbn table. |
497 | 497 | $DB->set_field('bigbluebuttonbn', 'presentation', '', array('id' => $bigbluebuttonbn_id)); |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | return false; |
533 | 533 | } |
534 | 534 | |
535 | - $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename; |
|
535 | + $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename; |
|
536 | 536 | $fs = get_file_storage(); |
537 | 537 | if (!$file = $fs->get_file_by_hash(sha1($fullpath)) or $file->is_directory()) { |
538 | 538 | return false; |
@@ -642,19 +642,19 @@ discard block |
||
642 | 642 | |
643 | 643 | function bigbluebuttonbn_notification_msg_html($msg) |
644 | 644 | { |
645 | - $message_text = '<p>'.$msg->activity_type.' "'.$msg->activity_title.'" '.get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn').' '.$msg->action.'.</p>'."\n"; |
|
646 | - $message_text .= '<p><b>'.$msg->activity_title.'</b> '.get_string('email_body_notification_meeting_details', 'bigbluebuttonbn').':'."\n"; |
|
647 | - $message_text .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>'."\n"; |
|
648 | - $message_text .= '<tr><td style="font-weight:bold;color:#555;">'.get_string('email_body_notification_meeting_title', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
649 | - $message_text .= $msg->activity_title.'</td></tr>'."\n"; |
|
650 | - $message_text .= '<tr><td style="font-weight:bold;color:#555;">'.get_string('email_body_notification_meeting_description', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
651 | - $message_text .= $msg->activity_description.'</td></tr>'."\n"; |
|
652 | - $message_text .= '<tr><td style="font-weight:bold;color:#555;">'.get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
653 | - $message_text .= $msg->activity_openingtime.'</td></tr>'."\n"; |
|
654 | - $message_text .= '<tr><td style="font-weight:bold;color:#555;">'.get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
655 | - $message_text .= $msg->activity_closingtime.'</td></tr>'."\n"; |
|
656 | - $message_text .= '<tr><td style="font-weight:bold;color:#555;">'.$msg->action.' '.get_string('email_body_notification_meeting_by', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
657 | - $message_text .= $msg->activity_owner.'</td></tr></tbody></table></p>'."\n"; |
|
645 | + $message_text = '<p>' . $msg->activity_type . ' "' . $msg->activity_title . '" ' . get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn') . ' ' . $msg->action . '.</p>' . "\n"; |
|
646 | + $message_text .= '<p><b>' . $msg->activity_title . '</b> ' . get_string('email_body_notification_meeting_details', 'bigbluebuttonbn') . ':' . "\n"; |
|
647 | + $message_text .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>' . "\n"; |
|
648 | + $message_text .= '<tr><td style="font-weight:bold;color:#555;">' . get_string('email_body_notification_meeting_title', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
649 | + $message_text .= $msg->activity_title . '</td></tr>' . "\n"; |
|
650 | + $message_text .= '<tr><td style="font-weight:bold;color:#555;">' . get_string('email_body_notification_meeting_description', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
651 | + $message_text .= $msg->activity_description . '</td></tr>' . "\n"; |
|
652 | + $message_text .= '<tr><td style="font-weight:bold;color:#555;">' . get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
653 | + $message_text .= $msg->activity_openingtime . '</td></tr>' . "\n"; |
|
654 | + $message_text .= '<tr><td style="font-weight:bold;color:#555;">' . get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
655 | + $message_text .= $msg->activity_closingtime . '</td></tr>' . "\n"; |
|
656 | + $message_text .= '<tr><td style="font-weight:bold;color:#555;">' . $msg->action . ' ' . get_string('email_body_notification_meeting_by', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
657 | + $message_text .= $msg->activity_owner . '</td></tr></tbody></table></p>' . "\n"; |
|
658 | 658 | } |
659 | 659 | |
660 | 660 | function bigbluebuttonbn_notification_send($sender, $bigbluebuttonbn, $message = '') |
@@ -669,17 +669,17 @@ discard block |
||
669 | 669 | $msg->user_name = fullname($sender); |
670 | 670 | $msg->user_email = $sender->email; |
671 | 671 | $msg->course_name = "$course->fullname"; |
672 | - $message .= '<p><hr/><br/>'.get_string('email_footer_sent_by', 'bigbluebuttonbn').' '.$msg->user_name.'('.$msg->user_email.') '; |
|
673 | - $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn').' '.$msg->course_name.'.</p>'; |
|
672 | + $message .= '<p><hr/><br/>' . get_string('email_footer_sent_by', 'bigbluebuttonbn') . ' ' . $msg->user_name . '(' . $msg->user_email . ') '; |
|
673 | + $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn') . ' ' . $msg->course_name . '.</p>'; |
|
674 | 674 | |
675 | 675 | $users = get_enrolled_users($context); |
676 | 676 | foreach ($users as $user) { |
677 | 677 | if ($user->id != $sender->id) { |
678 | 678 | $messageid = message_post_message($sender, $user, $message, FORMAT_HTML); |
679 | 679 | if (!empty($messageid)) { |
680 | - error_log('Msg to '.$msg->user_name.' was sent.'); |
|
680 | + error_log('Msg to ' . $msg->user_name . ' was sent.'); |
|
681 | 681 | } else { |
682 | - error_log('Msg to '.$msg->user_name.' was NOT sent.'); |
|
682 | + error_log('Msg to ' . $msg->user_name . ' was NOT sent.'); |
|
683 | 683 | } |
684 | 684 | } |
685 | 685 | } |
@@ -704,7 +704,7 @@ discard block |
||
704 | 704 | { |
705 | 705 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
706 | 706 | |
707 | - return isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_server_url) ? trim(trim($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_server_url), '/').'/' : (isset($CFG->bigbluebuttonbn_server_url) ? trim(trim($CFG->bigbluebuttonbn_server_url), '/').'/' : 'http://test-install.blindsidenetworks.com/bigbluebutton/'); |
|
707 | + return isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_server_url) ? trim(trim($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_server_url), '/') . '/' : (isset($CFG->bigbluebuttonbn_server_url) ? trim(trim($CFG->bigbluebuttonbn_server_url), '/') . '/' : 'http://test-install.blindsidenetworks.com/bigbluebutton/'); |
|
708 | 708 | } |
709 | 709 | |
710 | 710 | function bigbluebuttonbn_get_cfg_shared_secret() |
@@ -93,14 +93,14 @@ discard block |
||
93 | 93 | |
94 | 94 | /// Prepare the metadata |
95 | 95 | $metadata = array('bbb-origin' => $bbbsession['origin'], |
96 | - 'bbb-origin-version' => $bbbsession['originVersion'], |
|
97 | - 'bbb-origin-server-name' => $bbbsession['originServerName'], |
|
98 | - 'bbb-origin-server-common-name' => $bbbsession['originServerCommonName'], |
|
99 | - 'bbb-origin-tag' => $bbbsession['originTag'], |
|
100 | - 'bbb-context' => $bbbsession['course']->fullname, |
|
101 | - 'bbb-recording-name' => (isset($name) && $name != '') ? $name : $bbbsession['contextActivityName'], |
|
102 | - 'bbb-recording-description' => (isset($description) && $description != '') ? $description : $bbbsession['contextActivityDescription'], |
|
103 | - 'bbb-recording-tags' => (isset($tags) && $tags != '') ? $tags : $bbbsession['contextActivityTags'], |
|
96 | + 'bbb-origin-version' => $bbbsession['originVersion'], |
|
97 | + 'bbb-origin-server-name' => $bbbsession['originServerName'], |
|
98 | + 'bbb-origin-server-common-name' => $bbbsession['originServerCommonName'], |
|
99 | + 'bbb-origin-tag' => $bbbsession['originTag'], |
|
100 | + 'bbb-context' => $bbbsession['course']->fullname, |
|
101 | + 'bbb-recording-name' => (isset($name) && $name != '') ? $name : $bbbsession['contextActivityName'], |
|
102 | + 'bbb-recording-description' => (isset($description) && $description != '') ? $description : $bbbsession['contextActivityDescription'], |
|
103 | + 'bbb-recording-tags' => (isset($tags) && $tags != '') ? $tags : $bbbsession['contextActivityTags'], |
|
104 | 104 | ); |
105 | 105 | |
106 | 106 | if (bigbluebuttonbn_server_offers_bn_capabilities()) { |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $metadata, |
139 | 139 | $bbbsession['presentation']['name'], |
140 | 140 | $bbbsession['presentation']['url'] |
141 | - ); |
|
141 | + ); |
|
142 | 142 | |
143 | 143 | if (!$response) { |
144 | 144 | // If the server is unreachable, then prompts the user of the necessary action |
@@ -21,8 +21,8 @@ discard block |
||
21 | 21 | * @copyright 2015 Blindside Networks Inc |
22 | 22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v2 or later |
23 | 23 | */ |
24 | -require_once dirname(dirname(dirname(__FILE__))).'/config.php'; |
|
25 | -require_once dirname(__FILE__).'/locallib.php'; |
|
24 | +require_once dirname(dirname(dirname(__FILE__))) . '/config.php'; |
|
25 | +require_once dirname(__FILE__) . '/locallib.php'; |
|
26 | 26 | |
27 | 27 | $id = optional_param('id', 0, PARAM_INT); // course_module ID, or |
28 | 28 | $bn = optional_param('bn', 0, PARAM_INT); // bigbluebuttonbn instance ID |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | |
88 | 88 | // If user is not administrator nor moderator (user is steudent) and waiting is required |
89 | 89 | if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) { |
90 | - header('Location: '.$bbbsession['logoutURL']); |
|
90 | + header('Location: ' . $bbbsession['logoutURL']); |
|
91 | 91 | break; |
92 | 92 | } |
93 | 93 | |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | if (bigbluebuttonbn_get_cfg_scheduled_duration_enabled()) { |
119 | 119 | $durationtime = bigbluebuttonbn_get_duration($bigbluebuttonbn->closingtime); |
120 | 120 | if ($durationtime > 0) { |
121 | - $bbbsession['welcome'] .= '<br><br>'.str_replace('%duration%', ''.$durationtime, get_string('bbbdurationwarning', 'bigbluebuttonbn')); |
|
121 | + $bbbsession['welcome'] .= '<br><br>' . str_replace('%duration%', '' . $durationtime, get_string('bbbdurationwarning', 'bigbluebuttonbn')); |
|
122 | 122 | } |
123 | 123 | } |
124 | 124 | /// Execute the create command |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | if ($bbbsession['moderator']) { |
150 | 150 | $print_error_key = 'view_error_unable_join_teacher'; |
151 | 151 | } |
152 | - print_error($print_error_key, 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
152 | + print_error($print_error_key, 'bigbluebuttonbn', $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
153 | 153 | break; |
154 | 154 | } elseif ($response['returncode'] == 'FAILED') { |
155 | 155 | // The meeting was not created |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | |
202 | 202 | if ($bbbsession['userlimit'] > 0 && intval($meeting_info['participantCount']) >= $bbbsession['userlimit']) { |
203 | 203 | // No more users allowed to join |
204 | - header('Location: '.$bbbsession['logoutURL']); |
|
204 | + header('Location: ' . $bbbsession['logoutURL']); |
|
205 | 205 | |
206 | 206 | return; |
207 | 207 | } |
@@ -219,20 +219,20 @@ discard block |
||
219 | 219 | //// Before executing the redirect, increment the number of participants |
220 | 220 | bigbluebuttonbn_participant_joined($bbbsession['meetingid'], ($bbbsession['administrator'] || $bbbsession['moderator'])); |
221 | 221 | //// Execute the redirect |
222 | - header('Location: '.$join_url); |
|
222 | + header('Location: ' . $join_url); |
|
223 | 223 | } |
224 | 224 | |
225 | 225 | function bigbluebutton_bbb_view_errors($sErrors, $id) |
226 | 226 | { |
227 | 227 | global $CFG, $OUTPUT; |
228 | 228 | |
229 | - $errors = (array) json_decode(urldecode($sErrors)); |
|
229 | + $errors = (array)json_decode(urldecode($sErrors)); |
|
230 | 230 | $msgErrors = ''; |
231 | 231 | foreach ($errors as $error) { |
232 | - $msgErrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger'))."\n"; |
|
232 | + $msgErrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger')) . "\n"; |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | echo $OUTPUT->header(); |
236 | - print_error('view_error_bigbluebutton', 'bigbluebuttonbn', $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$id, $msgErrors, $sErrors); |
|
236 | + print_error('view_error_bigbluebutton', 'bigbluebuttonbn', $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $id, $msgErrors, $sErrors); |
|
237 | 237 | echo $OUTPUT->footer(); |
238 | 238 | } |
@@ -22,8 +22,8 @@ discard block |
||
22 | 22 | * @copyright 2010-2017 Blindside Networks Inc |
23 | 23 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v2 or later |
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 | $id = required_param('id', PARAM_INT); // Course Module ID, or |
29 | 29 | $a = optional_param('a', 0, PARAM_INT); // bigbluebuttonbn instance ID |
@@ -98,12 +98,12 @@ discard block |
||
98 | 98 | |
99 | 99 | echo get_string('index_ending', 'bigbluebuttonbn'); |
100 | 100 | |
101 | - $meetingID = $bigbluebuttonbn->meetingid.'-'.$course->id.'-'.$bigbluebuttonbn->id; |
|
101 | + $meetingID = $bigbluebuttonbn->meetingid . '-' . $course->id . '-' . $bigbluebuttonbn->id; |
|
102 | 102 | if ($g != '0') { |
103 | - $meetingID .= '['.$g.']'; |
|
103 | + $meetingID .= '[' . $g . ']'; |
|
104 | 104 | } |
105 | 105 | $getArray = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getEndMeetingURL($meetingID, $bigbluebuttonbn->moderatorpass)); |
106 | - redirect('index.php?id='.$id); |
|
106 | + redirect('index.php?id=' . $id); |
|
107 | 107 | } |
108 | 108 | } |
109 | 109 | |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | $can_moderate = ($administrator || $moderator); |
124 | 124 | |
125 | 125 | //Add a the data for the bigbluebuttonbn instance |
126 | - $groupObj = (groups_get_activity_groupmode($cm) > 0) ? (object) array('id' => 0, 'name' => get_string('allparticipants')) : null; |
|
126 | + $groupObj = (groups_get_activity_groupmode($cm) > 0) ? (object)array('id' => 0, 'name' => get_string('allparticipants')) : null; |
|
127 | 127 | $table->data[] = bigbluebuttonbn_index_display_room($can_moderate, $course, $bigbluebuttonbn, $groupObj); |
128 | 128 | |
129 | 129 | //Add a the data for the groups belonging to the bigbluebuttonbn instance, if any |
@@ -144,13 +144,13 @@ discard block |
||
144 | 144 | /// Functions |
145 | 145 | function bigbluebuttonbn_index_display_room($moderator, $course, $bigbluebuttonbn, $groupObj = null) |
146 | 146 | { |
147 | - $meetingID = $bigbluebuttonbn->meetingid.'-'.$course->id.'-'.$bigbluebuttonbn->id; |
|
147 | + $meetingID = $bigbluebuttonbn->meetingid . '-' . $course->id . '-' . $bigbluebuttonbn->id; |
|
148 | 148 | $paramGroup = ''; |
149 | 149 | $groupName = ''; |
150 | 150 | |
151 | 151 | if ($groupObj) { |
152 | - $meetingID .= '['.$groupObj->id.']'; |
|
153 | - $paramGroup = '&group='.$groupObj->id; |
|
152 | + $meetingID .= '[' . $groupObj->id . ']'; |
|
153 | + $paramGroup = '&group=' . $groupObj->id; |
|
154 | 154 | $groupName = $groupObj->name; |
155 | 155 | } |
156 | 156 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | } |
172 | 172 | |
173 | 173 | // Output Users in the meeting |
174 | - $joinURL = '<a href="view.php?id='.$bigbluebuttonbn->coursemodule.$paramGroup.'">'.format_string($bigbluebuttonbn->name).'</a>'; |
|
174 | + $joinURL = '<a href="view.php?id=' . $bigbluebuttonbn->coursemodule . $paramGroup . '">' . format_string($bigbluebuttonbn->name) . '</a>'; |
|
175 | 175 | $group = $groupName; |
176 | 176 | $users = ''; |
177 | 177 | $viewerList = ''; |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | $attendee_count = 0; |
211 | 211 | foreach ($meetingInfo['attendees']->attendee as $attendee) { |
212 | 212 | if ($attendee->role == $role) { |
213 | - $attendeeList .= ($attendee_count++ > 0 ? ', ' : '').$attendee->fullName; |
|
213 | + $attendeeList .= ($attendee_count++ > 0 ? ', ' : '') . $attendee->fullName; |
|
214 | 214 | } |
215 | 215 | } |
216 | 216 | } |
@@ -234,14 +234,14 @@ discard block |
||
234 | 234 | $actions = ''; |
235 | 235 | |
236 | 236 | if ($moderator) { |
237 | - $actions .= '<form name="form1" method="post" action="">'.'/n'; |
|
238 | - $actions .= ' <INPUT type="hidden" name="id" value="'.$course->id.'">'.'/n'; |
|
239 | - $actions .= ' <INPUT type="hidden" name="a" value="'.$bigbluebuttonbn->id.'">'.'/n'; |
|
237 | + $actions .= '<form name="form1" method="post" action="">' . '/n'; |
|
238 | + $actions .= ' <INPUT type="hidden" name="id" value="' . $course->id . '">' . '/n'; |
|
239 | + $actions .= ' <INPUT type="hidden" name="a" value="' . $bigbluebuttonbn->id . '">' . '/n'; |
|
240 | 240 | if ($groupObj != null) { |
241 | - $actions .= ' <INPUT type="hidden" name="g" value="'.$groupObj->id.'">'.'/n'; |
|
241 | + $actions .= ' <INPUT type="hidden" name="g" value="' . $groupObj->id . '">' . '/n'; |
|
242 | 242 | } |
243 | - $actions .= ' <INPUT type="submit" name="submit" value="end" onclick="return confirm(\''.get_string('index_confirm_end', 'bigbluebuttonbn').'\')">'.'/n'; |
|
244 | - $actions .= '</form>'.'/n'; |
|
243 | + $actions .= ' <INPUT type="submit" name="submit" value="end" onclick="return confirm(\'' . get_string('index_confirm_end', 'bigbluebuttonbn') . '\')">' . '/n'; |
|
244 | + $actions .= '</form>' . '/n'; |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | return $actions; |
@@ -75,9 +75,9 @@ discard block |
||
75 | 75 | function bigbluebuttonbn_getJoinURL($meetingID, $userName, $PW, $logoutURL, $configToken = null, $userId = null) |
76 | 76 | { |
77 | 77 | $data = ['meetingID' => $meetingID, |
78 | - 'fullName' => $userName, |
|
79 | - 'password' => $PW, |
|
80 | - 'logoutURL' => $logoutURL, |
|
78 | + 'fullName' => $userName, |
|
79 | + 'password' => $PW, |
|
80 | + 'logoutURL' => $logoutURL, |
|
81 | 81 | ]; |
82 | 82 | |
83 | 83 | if (!is_null($configToken)) { |
@@ -93,11 +93,11 @@ discard block |
||
93 | 93 | function bigbluebuttonbn_getCreateMeetingURL($name, $meetingID, $attendeePW, $moderatorPW, $welcome, $logoutURL, $record = 'false', $duration = 0, $voiceBridge = 0, $maxParticipants = 0, $metadata = array()) |
94 | 94 | { |
95 | 95 | $data = ['meetingID' => $meetingID, |
96 | - 'name' => $name, |
|
97 | - 'attendeePW' => $attendeePW, |
|
98 | - 'moderatorPW' => $moderatorPW, |
|
99 | - 'logoutURL' => $logoutURL, |
|
100 | - 'record' => $record, |
|
96 | + 'name' => $name, |
|
97 | + 'attendeePW' => $attendeePW, |
|
98 | + 'moderatorPW' => $moderatorPW, |
|
99 | + 'logoutURL' => $logoutURL, |
|
100 | + 'record' => $record, |
|
101 | 101 | ]; |
102 | 102 | |
103 | 103 | $voiceBridge = intval($voiceBridge); |
@@ -291,19 +291,19 @@ discard block |
||
291 | 291 | if ($xml && $xml->returncode == 'SUCCESS' && empty($xml->messageKey)) { |
292 | 292 | // Meeting info was returned |
293 | 293 | return array('returncode' => $xml->returncode, |
294 | - 'meetingID' => $xml->meetingID, |
|
295 | - 'moderatorPW' => $xml->moderatorPW, |
|
296 | - 'attendeePW' => $xml->attendeePW, |
|
297 | - 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded, |
|
298 | - 'running' => $xml->running, |
|
299 | - 'recording' => $xml->recording, |
|
300 | - 'startTime' => $xml->startTime, |
|
301 | - 'endTime' => $xml->endTime, |
|
302 | - 'participantCount' => $xml->participantCount, |
|
303 | - 'moderatorCount' => $xml->moderatorCount, |
|
304 | - 'attendees' => $xml->attendees, |
|
305 | - 'metadata' => $xml->metadata, |
|
306 | - ); |
|
294 | + 'meetingID' => $xml->meetingID, |
|
295 | + 'moderatorPW' => $xml->moderatorPW, |
|
296 | + 'attendeePW' => $xml->attendeePW, |
|
297 | + 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded, |
|
298 | + 'running' => $xml->running, |
|
299 | + 'recording' => $xml->recording, |
|
300 | + 'startTime' => $xml->startTime, |
|
301 | + 'endTime' => $xml->endTime, |
|
302 | + 'participantCount' => $xml->participantCount, |
|
303 | + 'moderatorCount' => $xml->moderatorCount, |
|
304 | + 'attendees' => $xml->attendees, |
|
305 | + 'metadata' => $xml->metadata, |
|
306 | + ); |
|
307 | 307 | } |
308 | 308 | |
309 | 309 | if ($xml) { |
@@ -612,10 +612,10 @@ discard block |
||
612 | 612 | |
613 | 613 | $options = array(); |
614 | 614 | $options['CURLOPT_HTTPHEADER'] = array( |
615 | - 'Content-Type: '.$content_type, |
|
616 | - 'Content-Length: '.strlen($data), |
|
617 | - 'Content-Language: en-US', |
|
618 | - ); |
|
615 | + 'Content-Type: '.$content_type, |
|
616 | + 'Content-Length: '.strlen($data), |
|
617 | + 'Content-Language: en-US', |
|
618 | + ); |
|
619 | 619 | |
620 | 620 | return $c->post($url, $data, $options); |
621 | 621 | } |
@@ -687,8 +687,8 @@ discard block |
||
687 | 687 | $participant_list = json_decode($bigbluebuttonbn->participants); |
688 | 688 | foreach ($participant_list as $participant) { |
689 | 689 | $participant_list_array[] = array('selectiontype' => $participant->selectiontype, |
690 | - 'selectionid' => $participant->selectionid, |
|
691 | - 'role' => $participant->role, ); |
|
690 | + 'selectionid' => $participant->selectionid, |
|
691 | + 'role' => $participant->role, ); |
|
692 | 692 | } |
693 | 693 | |
694 | 694 | return $participant_list_array; |
@@ -700,8 +700,8 @@ discard block |
||
700 | 700 | |
701 | 701 | $participant_list_array = array(); |
702 | 702 | $participant_list_array[] = array('selectiontype' => 'all', |
703 | - 'selectionid' => 'all', |
|
704 | - 'role' => BIGBLUEBUTTONBN_ROLE_VIEWER, ); |
|
703 | + 'selectionid' => 'all', |
|
704 | + 'role' => BIGBLUEBUTTONBN_ROLE_VIEWER, ); |
|
705 | 705 | |
706 | 706 | $moderator_defaults = explode(',', bigbluebuttonbn_get_cfg_moderator_default()); |
707 | 707 | foreach ($moderator_defaults as $moderator_default) { |
@@ -710,8 +710,8 @@ discard block |
||
710 | 710 | foreach ($users as $user) { |
711 | 711 | if ($user->id == $USER->id) { |
712 | 712 | $participant_list_array[] = array('selectiontype' => 'user', |
713 | - 'selectionid' => $USER->id, |
|
714 | - 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR, ); |
|
713 | + 'selectionid' => $USER->id, |
|
714 | + 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR, ); |
|
715 | 715 | break; |
716 | 716 | } |
717 | 717 | } |
@@ -719,8 +719,8 @@ discard block |
||
719 | 719 | } |
720 | 720 | |
721 | 721 | $participant_list_array[] = array('selectiontype' => 'role', |
722 | - 'selectionid' => $moderator_default, |
|
723 | - 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR, ); |
|
722 | + 'selectionid' => $moderator_default, |
|
723 | + 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR, ); |
|
724 | 724 | } |
725 | 725 | |
726 | 726 | return $participant_list_array; |
@@ -1642,24 +1642,24 @@ discard block |
||
1642 | 1642 | function bigbluebuttonbn_get_cfg_options() |
1643 | 1643 | { |
1644 | 1644 | return [ |
1645 | - 'voicebridge_editable' => bigbluebuttonbn_get_cfg_voicebridge_editable(), |
|
1646 | - 'recording_default' => bigbluebuttonbn_get_cfg_recording_default(), |
|
1647 | - 'recording_editable' => bigbluebuttonbn_get_cfg_recording_editable(), |
|
1648 | - 'recording_tagging_default' => bigbluebuttonbn_get_cfg_recording_tagging_default(), |
|
1649 | - 'recording_tagging_editable' => bigbluebuttonbn_get_cfg_recording_tagging_editable(), |
|
1650 | - 'waitformoderator_default' => bigbluebuttonbn_get_cfg_waitformoderator_default(), |
|
1651 | - 'waitformoderator_editable' => bigbluebuttonbn_get_cfg_waitformoderator_editable(), |
|
1652 | - 'userlimit_default' => bigbluebuttonbn_get_cfg_userlimit_default(), |
|
1653 | - 'userlimit_editable' => bigbluebuttonbn_get_cfg_userlimit_editable(), |
|
1654 | - 'preuploadpresentation_enabled' => bigbluebuttonbn_get_cfg_preuploadpresentation_enabled(), |
|
1655 | - 'sendnotifications_enabled' => bigbluebuttonbn_get_cfg_sendnotifications_enabled(), |
|
1656 | - 'recordings_html_default' => bigbluebuttonbn_get_cfg_recordings_html_default(), |
|
1657 | - 'recordings_html_editable' => bigbluebuttonbn_get_cfg_recordings_html_editable(), |
|
1658 | - 'recordings_deleted_activities_default' => bigbluebuttonbn_get_cfg_recordings_deleted_activities_default(), |
|
1659 | - 'recordings_deleted_activities_editable' => bigbluebuttonbn_get_cfg_recordings_deleted_activities_editable(), |
|
1660 | - 'recording_icons_enabled' => bigbluebuttonbn_get_cfg_recording_icons_enabled(), |
|
1661 | - 'instance_type_enabled' => bigbluebuttonbn_recordings_enabled(), |
|
1662 | - 'instance_type_default' => BIGBLUEBUTTONBN_TYPE_ALL, |
|
1645 | + 'voicebridge_editable' => bigbluebuttonbn_get_cfg_voicebridge_editable(), |
|
1646 | + 'recording_default' => bigbluebuttonbn_get_cfg_recording_default(), |
|
1647 | + 'recording_editable' => bigbluebuttonbn_get_cfg_recording_editable(), |
|
1648 | + 'recording_tagging_default' => bigbluebuttonbn_get_cfg_recording_tagging_default(), |
|
1649 | + 'recording_tagging_editable' => bigbluebuttonbn_get_cfg_recording_tagging_editable(), |
|
1650 | + 'waitformoderator_default' => bigbluebuttonbn_get_cfg_waitformoderator_default(), |
|
1651 | + 'waitformoderator_editable' => bigbluebuttonbn_get_cfg_waitformoderator_editable(), |
|
1652 | + 'userlimit_default' => bigbluebuttonbn_get_cfg_userlimit_default(), |
|
1653 | + 'userlimit_editable' => bigbluebuttonbn_get_cfg_userlimit_editable(), |
|
1654 | + 'preuploadpresentation_enabled' => bigbluebuttonbn_get_cfg_preuploadpresentation_enabled(), |
|
1655 | + 'sendnotifications_enabled' => bigbluebuttonbn_get_cfg_sendnotifications_enabled(), |
|
1656 | + 'recordings_html_default' => bigbluebuttonbn_get_cfg_recordings_html_default(), |
|
1657 | + 'recordings_html_editable' => bigbluebuttonbn_get_cfg_recordings_html_editable(), |
|
1658 | + 'recordings_deleted_activities_default' => bigbluebuttonbn_get_cfg_recordings_deleted_activities_default(), |
|
1659 | + 'recordings_deleted_activities_editable' => bigbluebuttonbn_get_cfg_recordings_deleted_activities_editable(), |
|
1660 | + 'recording_icons_enabled' => bigbluebuttonbn_get_cfg_recording_icons_enabled(), |
|
1661 | + 'instance_type_enabled' => bigbluebuttonbn_recordings_enabled(), |
|
1662 | + 'instance_type_default' => BIGBLUEBUTTONBN_TYPE_ALL, |
|
1663 | 1663 | ]; |
1664 | 1664 | } |
1665 | 1665 | |
@@ -1935,8 +1935,8 @@ discard block |
||
1935 | 1935 | $activity_time = ''; |
1936 | 1936 | if ($time) { |
1937 | 1937 | $activity_time = calendar_day_representation($time).' '. |
1938 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
1939 | - calendar_time_representation($time); |
|
1938 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
1939 | + calendar_time_representation($time); |
|
1940 | 1940 | } |
1941 | 1941 | |
1942 | 1942 | return $activity_time; |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
28 | 28 | |
29 | -require_once dirname(__FILE__).'/lib.php'; |
|
29 | +require_once dirname(__FILE__) . '/lib.php'; |
|
30 | 30 | |
31 | 31 | const BIGBLUEBUTTONBN_FORCED = true; |
32 | 32 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | if (isset($meta)) { |
66 | 66 | $log->meta = $meta; |
67 | 67 | } elseif ($event == BIGBLUEBUTTONBN_LOG_EVENT_CREATE) { |
68 | - $log->meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}'; |
|
68 | + $log->meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}'; |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | $DB->insert_record('bigbluebuttonbn_logs', $log); |
@@ -187,19 +187,19 @@ discard block |
||
187 | 187 | |
188 | 188 | function bigbluebuttonbn_bigbluebutton_action_url($action, $data = array(), $metadata = array()) |
189 | 189 | { |
190 | - $base_url = bigbluebuttonbn_get_cfg_server_url().'api/'.$action.'?'; |
|
190 | + $base_url = bigbluebuttonbn_get_cfg_server_url() . 'api/' . $action . '?'; |
|
191 | 191 | |
192 | 192 | $params = ''; |
193 | 193 | |
194 | 194 | foreach ($data as $key => $value) { |
195 | - $params .= '&'.$key.'='.urlencode($value); |
|
195 | + $params .= '&' . $key . '=' . urlencode($value); |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | foreach ($metadata as $key => $value) { |
199 | - $params .= '&'.'meta_'.$key.'='.urlencode($value); |
|
199 | + $params .= '&' . 'meta_' . $key . '=' . urlencode($value); |
|
200 | 200 | } |
201 | 201 | |
202 | - return $base_url.$params.'&checksum='.sha1($action.$params.bigbluebuttonbn_get_cfg_shared_secret()); |
|
202 | + return $base_url . $params . '&checksum=' . sha1($action . $params . bigbluebuttonbn_get_cfg_shared_secret()); |
|
203 | 203 | } |
204 | 204 | |
205 | 205 | function bigbluebuttonbn_getCreateMeetingArray($meetingName, $meetingID, $welcomeString, $mPW, $aPW, $logoutURL, $record = 'false', $duration = 0, $voiceBridge = 0, $maxParticipants = 0, $metadata = array(), $presentation_name = null, $presentation_url = null) |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | |
211 | 211 | if (!is_null($presentation_name) && !is_null($presentation_url)) { |
212 | 212 | $method = BIGBLUEBUTTONBN_METHOD_POST; |
213 | - $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='".$presentation_url."' /></module></modules>"; |
|
213 | + $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='" . $presentation_url . "' /></module></modules>"; |
|
214 | 214 | } |
215 | 215 | |
216 | 216 | $xml = bigbluebuttonbn_wrap_xml_load_file($create_meeting_url, $method, $data); |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | 'moderatorPW' => $meeting->moderatorPW, |
257 | 257 | 'attendeePW' => $meeting->attendeePW, |
258 | 258 | 'hasBeenForciblyEnded' => $meeting->hasBeenForciblyEnded, |
259 | - 'running' => $meeting->running, ); |
|
259 | + 'running' => $meeting->running,); |
|
260 | 260 | } |
261 | 261 | |
262 | 262 | return $meetings; |
@@ -379,11 +379,11 @@ discard block |
||
379 | 379 | { |
380 | 380 | global $DB; |
381 | 381 | |
382 | - $select = "courseid = '{$courseID}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnID}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_IMPORT."'"; |
|
382 | + $select = "courseid = '{$courseID}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnID}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'"; |
|
383 | 383 | if ($bigbluebuttonbnID === null) { |
384 | - $select = "courseid = '{$courseID}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_IMPORT."'"; |
|
384 | + $select = "courseid = '{$courseID}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'"; |
|
385 | 385 | } elseif ($subset) { |
386 | - $select = "bigbluebuttonbnid = '{$bigbluebuttonbnID}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_IMPORT."'"; |
|
386 | + $select = "bigbluebuttonbnid = '{$bigbluebuttonbnID}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'"; |
|
387 | 387 | } |
388 | 388 | $records_imported = $DB->get_records_select('bigbluebuttonbn_logs', $select); |
389 | 389 | |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | function bigbluebuttonbn_getDefaultConfigXMLArray() |
414 | 414 | { |
415 | 415 | $default_config_xml = bigbluebuttonbn_getDefaultConfigXML(); |
416 | - $default_config_xml_array = (array) $default_config_xml; |
|
416 | + $default_config_xml_array = (array)$default_config_xml; |
|
417 | 417 | |
418 | 418 | return $default_config_xml_array; |
419 | 419 | } |
@@ -423,18 +423,18 @@ discard block |
||
423 | 423 | //Add formats |
424 | 424 | $playbackArray = array(); |
425 | 425 | foreach ($recording->playback->format as $format) { |
426 | - $playbackArray[(string) $format->type] = array('type' => (string) $format->type, 'url' => (string) $format->url, 'length' => (string) $format->length); |
|
426 | + $playbackArray[(string)$format->type] = array('type' => (string)$format->type, 'url' => (string)$format->url, 'length' => (string)$format->length); |
|
427 | 427 | //Add preview per format when existing |
428 | 428 | if ($format->preview) { |
429 | 429 | $imagesArray = array(); |
430 | 430 | foreach ($format->preview->images->image as $image) { |
431 | - $imageArray = array('url' => (string) $image); |
|
431 | + $imageArray = array('url' => (string)$image); |
|
432 | 432 | foreach ($image->attributes() as $attKey => $attValue) { |
433 | - $imageArray[$attKey] = (string) $attValue; |
|
433 | + $imageArray[$attKey] = (string)$attValue; |
|
434 | 434 | } |
435 | 435 | array_push($imagesArray, $imageArray); |
436 | 436 | } |
437 | - $playbackArray[(string) $format->type]['preview'] = $imagesArray; |
|
437 | + $playbackArray[(string)$format->type]['preview'] = $imagesArray; |
|
438 | 438 | } |
439 | 439 | } |
440 | 440 | |
@@ -445,10 +445,10 @@ discard block |
||
445 | 445 | if (is_object($value)) { |
446 | 446 | $value = ''; |
447 | 447 | } |
448 | - $metadataArray['meta_'.$key] = $value; |
|
448 | + $metadataArray['meta_' . $key] = $value; |
|
449 | 449 | } |
450 | 450 | |
451 | - $recordingArrayValue = array('recordID' => (string) $recording->recordID, 'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name, 'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime, 'endTime' => (string) $recording->endTime, 'playbacks' => $playbackArray) + $metadataArray; |
|
451 | + $recordingArrayValue = array('recordID' => (string)$recording->recordID, 'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name, 'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime, 'endTime' => (string)$recording->endTime, 'playbacks' => $playbackArray) + $metadataArray; |
|
452 | 452 | |
453 | 453 | return $recordingArrayValue; |
454 | 454 | } |
@@ -528,7 +528,7 @@ discard block |
||
528 | 528 | |
529 | 529 | function bigbluebuttonbn_getServerVersion() |
530 | 530 | { |
531 | - $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_get_cfg_server_url().'api'); |
|
531 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_get_cfg_server_url() . 'api'); |
|
532 | 532 | if ($xml && $xml->returncode == 'SUCCESS') { |
533 | 533 | return $xml->version; |
534 | 534 | } |
@@ -553,7 +553,7 @@ discard block |
||
553 | 553 | function bigbluebuttonbn_wrap_xml_load_file($url, $method = BIGBLUEBUTTONBN_METHOD_GET, $data = null, $content_type = 'text/xml') |
554 | 554 | { |
555 | 555 | if (bigbluebuttonbn_debugdisplay()) { |
556 | - error_log('Request to: '.$url); |
|
556 | + error_log('Request to: ' . $url); |
|
557 | 557 | } |
558 | 558 | |
559 | 559 | if (extension_loaded('curl')) { |
@@ -566,7 +566,7 @@ discard block |
||
566 | 566 | } |
567 | 567 | |
568 | 568 | if (bigbluebuttonbn_debugdisplay()) { |
569 | - error_log('Response: '.$response); |
|
569 | + error_log('Response: ' . $response); |
|
570 | 570 | } |
571 | 571 | |
572 | 572 | $previous = libxml_use_internal_errors(true); |
@@ -576,7 +576,7 @@ discard block |
||
576 | 576 | return $xml; |
577 | 577 | } catch (Exception $e) { |
578 | 578 | libxml_use_internal_errors($previous); |
579 | - $error = 'Caught exception: '.$e->getMessage(); |
|
579 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
580 | 580 | error_log($error); |
581 | 581 | |
582 | 582 | return null; |
@@ -588,12 +588,12 @@ discard block |
||
588 | 588 | try { |
589 | 589 | $response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS); |
590 | 590 | if (bigbluebuttonbn_debugdisplay()) { |
591 | - error_log('Response processed: '.$response->asXML()); |
|
591 | + error_log('Response processed: ' . $response->asXML()); |
|
592 | 592 | } |
593 | 593 | |
594 | 594 | return $response; |
595 | 595 | } catch (Exception $e) { |
596 | - $error = 'Caught exception: '.$e->getMessage(); |
|
596 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
597 | 597 | error_log($error); |
598 | 598 | libxml_use_internal_errors($previous); |
599 | 599 | |
@@ -612,8 +612,8 @@ discard block |
||
612 | 612 | |
613 | 613 | $options = array(); |
614 | 614 | $options['CURLOPT_HTTPHEADER'] = array( |
615 | - 'Content-Type: '.$content_type, |
|
616 | - 'Content-Length: '.strlen($data), |
|
615 | + 'Content-Type: ' . $content_type, |
|
616 | + 'Content-Length: ' . strlen($data), |
|
617 | 617 | 'Content-Language: en-US', |
618 | 618 | ); |
619 | 619 | |
@@ -631,9 +631,9 @@ discard block |
||
631 | 631 | if ($user_roles) { |
632 | 632 | $where = ''; |
633 | 633 | foreach ($user_roles as $key => $value) { |
634 | - $where .= (empty($where) ? ' WHERE' : ' AND').' id='.$value->roleid; |
|
634 | + $where .= (empty($where) ? ' WHERE' : ' AND') . ' id=' . $value->roleid; |
|
635 | 635 | } |
636 | - $user_roles = $DB->get_records_sql('SELECT * FROM {role}'.$where); |
|
636 | + $user_roles = $DB->get_records_sql('SELECT * FROM {role}' . $where); |
|
637 | 637 | } |
638 | 638 | |
639 | 639 | return $user_roles; |
@@ -688,7 +688,7 @@ discard block |
||
688 | 688 | foreach ($participant_list as $participant) { |
689 | 689 | $participant_list_array[] = array('selectiontype' => $participant->selectiontype, |
690 | 690 | 'selectionid' => $participant->selectionid, |
691 | - 'role' => $participant->role, ); |
|
691 | + 'role' => $participant->role,); |
|
692 | 692 | } |
693 | 693 | |
694 | 694 | return $participant_list_array; |
@@ -701,7 +701,7 @@ discard block |
||
701 | 701 | $participant_list_array = array(); |
702 | 702 | $participant_list_array[] = array('selectiontype' => 'all', |
703 | 703 | 'selectionid' => 'all', |
704 | - 'role' => BIGBLUEBUTTONBN_ROLE_VIEWER, ); |
|
704 | + 'role' => BIGBLUEBUTTONBN_ROLE_VIEWER,); |
|
705 | 705 | |
706 | 706 | $moderator_defaults = explode(',', bigbluebuttonbn_get_cfg_moderator_default()); |
707 | 707 | foreach ($moderator_defaults as $moderator_default) { |
@@ -711,7 +711,7 @@ discard block |
||
711 | 711 | if ($user->id == $USER->id) { |
712 | 712 | $participant_list_array[] = array('selectiontype' => 'user', |
713 | 713 | 'selectionid' => $USER->id, |
714 | - 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR, ); |
|
714 | + 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR,); |
|
715 | 715 | break; |
716 | 716 | } |
717 | 717 | } |
@@ -720,7 +720,7 @@ discard block |
||
720 | 720 | |
721 | 721 | $participant_list_array[] = array('selectiontype' => 'role', |
722 | 722 | 'selectionid' => $moderator_default, |
723 | - 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR, ); |
|
723 | + 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR,); |
|
724 | 724 | } |
725 | 725 | |
726 | 726 | return $participant_list_array; |
@@ -778,9 +778,9 @@ discard block |
||
778 | 778 | $is_unique = true; |
779 | 779 | if ($voicebridge != 0) { |
780 | 780 | $table = 'bigbluebuttonbn'; |
781 | - $select = 'voicebridge = '.$voicebridge; |
|
781 | + $select = 'voicebridge = ' . $voicebridge; |
|
782 | 782 | if ($id) { |
783 | - $select .= ' AND id <> '.$id; |
|
783 | + $select .= ' AND id <> ' . $id; |
|
784 | 784 | } |
785 | 785 | if ($DB->get_records_select($table, $select)) { |
786 | 786 | $is_unique = false; |
@@ -845,7 +845,7 @@ discard block |
||
845 | 845 | $mt = microtime(); |
846 | 846 | $rand = mt_rand(); |
847 | 847 | |
848 | - return md5($mt.$rand); |
|
848 | + return md5($mt . $rand); |
|
849 | 849 | } |
850 | 850 | |
851 | 851 | function bigbluebuttonbn_random_password($length = 8) |
@@ -955,7 +955,7 @@ discard block |
||
955 | 955 | } |
956 | 956 | |
957 | 957 | //Ping again and refresh the cache |
958 | - $meeting_info = (array) bigbluebuttonbn_getMeetingInfo($meetingid); |
|
958 | + $meeting_info = (array)bigbluebuttonbn_getMeetingInfo($meetingid); |
|
959 | 959 | $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meeting_info))); |
960 | 960 | |
961 | 961 | return $meeting_info; |
@@ -1051,7 +1051,7 @@ discard block |
||
1051 | 1051 | case 'moodle_event': |
1052 | 1052 | break; |
1053 | 1053 | default: |
1054 | - return bigbluebuttonbn_add_error($error, 'Action '.$params['action'].' can not be performed.'); |
|
1054 | + return bigbluebuttonbn_add_error($error, 'Action ' . $params['action'] . ' can not be performed.'); |
|
1055 | 1055 | } |
1056 | 1056 | |
1057 | 1057 | return ''; |
@@ -1077,8 +1077,8 @@ discard block |
||
1077 | 1077 | */ |
1078 | 1078 | function bigbluebuttonbn_setConfigXMLParams($meetingID, $configXML) |
1079 | 1079 | { |
1080 | - $params = 'configXML='.urlencode($configXML).'&meetingID='.urlencode($meetingID); |
|
1081 | - $config_xml_params = $params.'&checksum='.sha1('setConfigXML'.$params.bigbluebuttonbn_get_cfg_shared_secret()); |
|
1080 | + $params = 'configXML=' . urlencode($configXML) . '&meetingID=' . urlencode($meetingID); |
|
1081 | + $config_xml_params = $params . '&checksum=' . sha1('setConfigXML' . $params . bigbluebuttonbn_get_cfg_shared_secret()); |
|
1082 | 1082 | |
1083 | 1083 | return $config_xml_params; |
1084 | 1084 | } |
@@ -1089,7 +1089,7 @@ discard block |
||
1089 | 1089 | */ |
1090 | 1090 | function bigbluebuttonbn_setConfigXML($meetingID, $configXML) |
1091 | 1091 | { |
1092 | - $url_default_config = bigbluebuttonbn_get_cfg_server_url().'api/setConfigXML?'; |
|
1092 | + $url_default_config = bigbluebuttonbn_get_cfg_server_url() . 'api/setConfigXML?'; |
|
1093 | 1093 | $config_xml_params = bigbluebuttonbn_setConfigXMLParams($meetingID, $configXML); |
1094 | 1094 | $xml = bigbluebuttonbn_wrap_xml_load_file($url_default_config, BIGBLUEBUTTONBN_METHOD_POST, $config_xml_params, 'application/x-www-form-urlencoded'); |
1095 | 1095 | |
@@ -1103,7 +1103,7 @@ discard block |
||
1103 | 1103 | function bigbluebuttonbn_setConfigXMLArray($meetingID, $configXML) |
1104 | 1104 | { |
1105 | 1105 | $config_xml = bigbluebuttonbn_setConfigXML($meetingID, $configXML); |
1106 | - $config_xml_array = (array) $config_xml; |
|
1106 | + $config_xml_array = (array)$config_xml; |
|
1107 | 1107 | |
1108 | 1108 | return $config_xml_array; |
1109 | 1109 | } |
@@ -1145,7 +1145,7 @@ discard block |
||
1145 | 1145 | $row->date = floatval($recording['startTime']); |
1146 | 1146 | |
1147 | 1147 | // Set formatted date |
1148 | - $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z'; |
|
1148 | + $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z'; |
|
1149 | 1149 | $row->date_formatted = userdate($startTime / 1000, $dateformat, usertimezone($USER->timezone)); |
1150 | 1150 | |
1151 | 1151 | // Set formatted duration |
@@ -1213,7 +1213,7 @@ discard block |
||
1213 | 1213 | |
1214 | 1214 | $attributes = 'data-imported="false"'; |
1215 | 1215 | if (isset($recording['imported'])) { |
1216 | - $attributes = 'data-imported="true" title="'.get_string('view_recording_link_warning', 'bigbluebuttonbn').'"'; |
|
1216 | + $attributes = 'data-imported="true" title="' . get_string('view_recording_link_warning', 'bigbluebuttonbn') . '"'; |
|
1217 | 1217 | } |
1218 | 1218 | |
1219 | 1219 | $visibility = ''; |
@@ -1221,9 +1221,9 @@ discard block |
||
1221 | 1221 | $visibility = 'hidden '; |
1222 | 1222 | } |
1223 | 1223 | |
1224 | - $recording_types = '<div id="playbacks-'.$recording['recordID'].'" '.$attributes.' '.$visibility.'>'; |
|
1224 | + $recording_types = '<div id="playbacks-' . $recording['recordID'] . '" ' . $attributes . ' ' . $visibility . '>'; |
|
1225 | 1225 | foreach ($recording['playbacks'] as $playback) { |
1226 | - $recording_types .= $OUTPUT->action_link($playback['url'], get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'), null, array('title' => get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'), 'target' => '_new')).' '; |
|
1226 | + $recording_types .= $OUTPUT->action_link($playback['url'], get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn'), null, array('title' => get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn'), 'target' => '_new')) . ' '; |
|
1227 | 1227 | } |
1228 | 1228 | $recording_types .= '</div>'; |
1229 | 1229 | |
@@ -1258,12 +1258,12 @@ discard block |
||
1258 | 1258 | { |
1259 | 1259 | global $OUTPUT; |
1260 | 1260 | |
1261 | - $onclick = 'M.mod_bigbluebuttonbn.broker_manageRecording("'.$manage_action.'", "'.$recording['recordID'].'", "'.$recording['meetingID'].'");'; |
|
1261 | + $onclick = 'M.mod_bigbluebuttonbn.broker_manageRecording("' . $manage_action . '", "' . $recording['recordID'] . '", "' . $recording['meetingID'] . '");'; |
|
1262 | 1262 | if (bigbluebuttonbn_get_cfg_recording_icons_enabled()) { |
1263 | 1263 | //With icon for $manage_action |
1264 | - $icon_attributes = array('id' => 'recording-btn-'.$manage_action.'-'.$recording['recordID']); |
|
1265 | - $icon = new pix_icon('i/'.$manage_tag, get_string($manage_tag), 'moodle', $icon_attributes); |
|
1266 | - $link_attributes = array('id' => 'recording-link-'.$manage_action.'-'.$recording['recordID'], 'onclick' => $onclick); |
|
1264 | + $icon_attributes = array('id' => 'recording-btn-' . $manage_action . '-' . $recording['recordID']); |
|
1265 | + $icon = new pix_icon('i/' . $manage_tag, get_string($manage_tag), 'moodle', $icon_attributes); |
|
1266 | + $link_attributes = array('id' => 'recording-link-' . $manage_action . '-' . $recording['recordID'], 'onclick' => $onclick); |
|
1267 | 1267 | |
1268 | 1268 | return $OUTPUT->action_icon('#', $icon, null, $link_attributes, false); |
1269 | 1269 | } |
@@ -1335,7 +1335,7 @@ discard block |
||
1335 | 1335 | $table->data = array(); |
1336 | 1336 | |
1337 | 1337 | ///Initialize table headers |
1338 | - $table->head = array($playback.$recording, $description, $preview, $date, $duration); |
|
1338 | + $table->head = array($playback . $recording, $description, $preview, $date, $duration); |
|
1339 | 1339 | $table->align = array('left', 'left', 'left', 'left', 'left', 'center'); |
1340 | 1340 | if ($bbbsession['managerecordings']) { |
1341 | 1341 | $table->head[] = $actionbar; |
@@ -1346,7 +1346,7 @@ discard block |
||
1346 | 1346 | if (isset($recordings) && !array_key_exists('messageKey', $recordings)) { // There are recordings for this meeting |
1347 | 1347 | foreach ($recordings as $recording) { |
1348 | 1348 | $row = new html_table_row(); |
1349 | - $row->id = 'recording-td-'.$recording['recordID']; |
|
1349 | + $row->id = 'recording-td-' . $recording['recordID']; |
|
1350 | 1350 | $row->attributes['data-imported'] = 'false'; |
1351 | 1351 | if (isset($recording['imported'])) { |
1352 | 1352 | $row->attributes['data-imported'] = 'true'; |
@@ -1378,7 +1378,7 @@ discard block |
||
1378 | 1378 | /// Build the message_body |
1379 | 1379 | $msg->activity_type = ''; |
1380 | 1380 | $msg->activity_title = $bigbluebuttonbn->name; |
1381 | - $message_text = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn').' '.$msg->activity_type.' "'.$msg->activity_title.'" '.get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>'; |
|
1381 | + $message_text = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . ' ' . $msg->activity_type . ' "' . $msg->activity_title . '" ' . get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>'; |
|
1382 | 1382 | |
1383 | 1383 | bigbluebuttonbn_send_notification($sender, $bigbluebuttonbn, $message_text); |
1384 | 1384 | } |
@@ -1741,9 +1741,9 @@ discard block |
||
1741 | 1741 | $select = ''; |
1742 | 1742 | foreach ($bigbluebuttonbns as $key => $bigbluebuttonbn) { |
1743 | 1743 | $select .= strlen($select) == 0 ? '(' : ' OR '; |
1744 | - $select .= 'bigbluebuttonbnid='.$bigbluebuttonbn->id; |
|
1744 | + $select .= 'bigbluebuttonbnid=' . $bigbluebuttonbn->id; |
|
1745 | 1745 | } |
1746 | - $select .= ") AND log='".BIGBLUEBUTTONBN_LOG_EVENT_CREATE."'"; |
|
1746 | + $select .= ") AND log='" . BIGBLUEBUTTONBN_LOG_EVENT_CREATE . "'"; |
|
1747 | 1747 | |
1748 | 1748 | //Execute select for loading records based on existent bigbluebuttonbns |
1749 | 1749 | $records = $DB->get_records_select($table, $select); |
@@ -1751,7 +1751,7 @@ discard block |
||
1751 | 1751 | //Remove duplicates |
1752 | 1752 | $unique_records = array(); |
1753 | 1753 | foreach ($records as $key => $record) { |
1754 | - $record_key = $record->meetingid.','.$record->bigbluebuttonbnid.','.$record->meta; |
|
1754 | + $record_key = $record->meetingid . ',' . $record->bigbluebuttonbnid . ',' . $record->meta; |
|
1755 | 1755 | if (array_search($record_key, $unique_records) === true) { |
1756 | 1756 | unset($records[$key]); |
1757 | 1757 | continue; |
@@ -1790,7 +1790,7 @@ discard block |
||
1790 | 1790 | { |
1791 | 1791 | global $CFG; |
1792 | 1792 | |
1793 | - return (bool) $CFG->debugdisplay; |
|
1793 | + return (bool)$CFG->debugdisplay; |
|
1794 | 1794 | } |
1795 | 1795 | |
1796 | 1796 | function bigbluebuttonbn_html2text($html, $len) |
@@ -1810,7 +1810,7 @@ discard block |
||
1810 | 1810 | $tags = ''; |
1811 | 1811 | $tags_array = core_tag_tag::get_item_tags_array('core', 'course_modules', $id); |
1812 | 1812 | foreach ($tags_array as $tag) { |
1813 | - $tags .= ($tags == '') ? $tag : ','.$tag; |
|
1813 | + $tags .= ($tags == '') ? $tag : ',' . $tag; |
|
1814 | 1814 | } |
1815 | 1815 | |
1816 | 1816 | return $tags; |
@@ -1832,13 +1832,13 @@ discard block |
||
1832 | 1832 | |
1833 | 1833 | // Gather the bigbluebuttonbnids whose meetingids should be included in the getRecordings request |
1834 | 1834 | $select = "id <> '{$bigbluebuttonbnID}' AND course = '{$courseID}'"; |
1835 | - $select_deleted = "courseid = '{$courseID}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnID}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE."' AND meta like '%has_recordings%' AND meta like '%true%'"; |
|
1835 | + $select_deleted = "courseid = '{$courseID}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnID}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE . "' AND meta like '%has_recordings%' AND meta like '%true%'"; |
|
1836 | 1836 | if ($bigbluebuttonbnID === null) { |
1837 | 1837 | $select = "course = '{$courseID}'"; |
1838 | - $select_deleted = "courseid = '{$courseID}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE."' AND meta like '%has_recordings%' AND meta like '%true%'"; |
|
1838 | + $select_deleted = "courseid = '{$courseID}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE . "' AND meta like '%has_recordings%' AND meta like '%true%'"; |
|
1839 | 1839 | } elseif ($subset) { |
1840 | 1840 | $select = "id = '{$bigbluebuttonbnID}'"; |
1841 | - $select_deleted = "bigbluebuttonbnid = '{$bigbluebuttonbnID}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE."' AND meta like '%has_recordings%' AND meta like '%true%'"; |
|
1841 | + $select_deleted = "bigbluebuttonbnid = '{$bigbluebuttonbnID}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE . "' AND meta like '%has_recordings%' AND meta like '%true%'"; |
|
1842 | 1842 | } |
1843 | 1843 | $bigbluebuttonbns = $DB->get_records_select_menu('bigbluebuttonbn', $select, null, 'id', 'id, meetingid'); |
1844 | 1844 | |
@@ -1856,7 +1856,7 @@ discard block |
||
1856 | 1856 | if (!empty($bigbluebuttonbns)) { |
1857 | 1857 | //Prepare select for loading records based on existent bigbluebuttonbns |
1858 | 1858 | $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE '; |
1859 | - $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')'; |
|
1859 | + $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')'; |
|
1860 | 1860 | //Include only Create events and exclude those with record not true |
1861 | 1861 | $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?'; |
1862 | 1862 | //Execute select for loading records based on existent bigbluebuttonbns |
@@ -1934,8 +1934,8 @@ discard block |
||
1934 | 1934 | { |
1935 | 1935 | $activity_time = ''; |
1936 | 1936 | if ($time) { |
1937 | - $activity_time = calendar_day_representation($time).' '. |
|
1938 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
1937 | + $activity_time = calendar_day_representation($time) . ' ' . |
|
1938 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' . |
|
1939 | 1939 | calendar_time_representation($time); |
1940 | 1940 | } |
1941 | 1941 |