@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * @uses FEATURE_GRADE_OUTCOMES |
98 | 98 | * @uses FEATURE_SHOW_DESCRIPTION |
99 | 99 | * @param string $feature |
100 | - * @return mixed True if yes (some features may use other values) |
|
100 | + * @return null|boolean True if yes (some features may use other values) |
|
101 | 101 | */ |
102 | 102 | function bigbluebuttonbn_supports($feature) { |
103 | 103 | if (!$feature) { |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | * @param object $mod |
240 | 240 | * @param object $bigbluebuttonbn |
241 | 241 | * |
242 | - * @return bool |
|
242 | + * @return string |
|
243 | 243 | */ |
244 | 244 | function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) { |
245 | 245 | global $DB; |
@@ -542,7 +542,7 @@ discard block |
||
542 | 542 | * @param stdClass $context context object |
543 | 543 | * @param string $filearea file area |
544 | 544 | * |
545 | - * @return false|null false if file not valid |
|
545 | + * @return boolean false if file not valid |
|
546 | 546 | */ |
547 | 547 | function bigbluebuttonbn_pluginfile_valid($context, $filearea) { |
548 | 548 | if ($context->contextlevel != CONTEXT_MODULE) { |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * Remove this block when restored |
69 | 69 | */ |
70 | 70 | |
71 | - /** @var BIGBLUEBUTTONBN_DEFAULT_SERVER_URL string of default bigbluebutton server url */ |
|
71 | + /** @var BIGBLUEBUTTONBN_DEFAULT_SERVER_URL string of default bigbluebutton server url */ |
|
72 | 72 | const BIGBLUEBUTTONBN_DEFAULT_SERVER_URL = 'http://test-install.blindsidenetworks.com/bigbluebutton/'; |
73 | 73 | /** @var BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET string of default bigbluebutton server shared secret */ |
74 | 74 | const BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET = '8cd8ef52e8e101574e400365b55e11a6'; |
@@ -345,12 +345,12 @@ discard block |
||
345 | 345 | $str = '<div class="bigbluebuttonbn overview">'."\n"; |
346 | 346 | $str .= ' <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; |
347 | 347 | $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule. |
348 | - '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
348 | + '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
349 | 349 | $str .= ' </div>'."\n"; |
350 | 350 | $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime). |
351 | 351 | '</div>'."\n"; |
352 | 352 | $str .= ' <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) |
353 | - .'</div>'."\n"; |
|
353 | + .'</div>'."\n"; |
|
354 | 354 | $str .= '</div>'."\n"; |
355 | 355 | return $str; |
356 | 356 | } |
@@ -28,32 +28,32 @@ discard block |
||
28 | 28 | |
29 | 29 | global $CFG; |
30 | 30 | |
31 | -require_once($CFG->dirroot.'/calendar/lib.php'); |
|
32 | -require_once($CFG->dirroot.'/message/lib.php'); |
|
33 | -require_once($CFG->dirroot.'/mod/lti/OAuth.php'); |
|
34 | -require_once($CFG->libdir.'/accesslib.php'); |
|
35 | -require_once($CFG->libdir.'/completionlib.php'); |
|
36 | -require_once($CFG->libdir.'/datalib.php'); |
|
37 | -require_once($CFG->libdir.'/coursecatlib.php'); |
|
38 | -require_once($CFG->libdir.'/enrollib.php'); |
|
39 | -require_once($CFG->libdir.'/filelib.php'); |
|
40 | -require_once($CFG->libdir.'/formslib.php'); |
|
41 | - |
|
42 | -if (file_exists(dirname(__FILE__).'/vendor/firebase/php-jwt/src/JWT.php')) { |
|
43 | - require_once(dirname(__FILE__).'/vendor/firebase/php-jwt/src/JWT.php'); |
|
31 | +require_once($CFG->dirroot . '/calendar/lib.php'); |
|
32 | +require_once($CFG->dirroot . '/message/lib.php'); |
|
33 | +require_once($CFG->dirroot . '/mod/lti/OAuth.php'); |
|
34 | +require_once($CFG->libdir . '/accesslib.php'); |
|
35 | +require_once($CFG->libdir . '/completionlib.php'); |
|
36 | +require_once($CFG->libdir . '/datalib.php'); |
|
37 | +require_once($CFG->libdir . '/coursecatlib.php'); |
|
38 | +require_once($CFG->libdir . '/enrollib.php'); |
|
39 | +require_once($CFG->libdir . '/filelib.php'); |
|
40 | +require_once($CFG->libdir . '/formslib.php'); |
|
41 | + |
|
42 | +if (file_exists(dirname(__FILE__) . '/vendor/firebase/php-jwt/src/JWT.php')) { |
|
43 | + require_once(dirname(__FILE__) . '/vendor/firebase/php-jwt/src/JWT.php'); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | if (!isset($CFG->bigbluebuttonbn)) { |
47 | 47 | $CFG->bigbluebuttonbn = array(); |
48 | 48 | } |
49 | 49 | |
50 | -if (file_exists(dirname(__FILE__).'/config.php')) { |
|
51 | - require_once(dirname(__FILE__).'/config.php'); |
|
50 | +if (file_exists(dirname(__FILE__) . '/config.php')) { |
|
51 | + require_once(dirname(__FILE__) . '/config.php'); |
|
52 | 52 | // Old BigBlueButtonBN cfg schema. For backward compatibility. |
53 | 53 | global $BIGBLUEBUTTONBN_CFG; |
54 | 54 | |
55 | 55 | if (isset($BIGBLUEBUTTONBN_CFG)) { |
56 | - foreach ((array) $BIGBLUEBUTTONBN_CFG as $key => $value) { |
|
56 | + foreach ((array)$BIGBLUEBUTTONBN_CFG as $key => $value) { |
|
57 | 57 | $cfgkey = str_replace("bigbluebuttonbn_", "", $key); |
58 | 58 | $CFG->bigbluebuttonbn[$cfgkey] = $value; |
59 | 59 | } |
@@ -104,18 +104,18 @@ discard block |
||
104 | 104 | return null; |
105 | 105 | } |
106 | 106 | $features = array( |
107 | - (string) FEATURE_IDNUMBER => true, |
|
108 | - (string) FEATURE_GROUPS => true, |
|
109 | - (string) FEATURE_GROUPINGS => true, |
|
110 | - (string) FEATURE_GROUPMEMBERSONLY => true, |
|
111 | - (string) FEATURE_MOD_INTRO => true, |
|
112 | - (string) FEATURE_BACKUP_MOODLE2 => true, |
|
113 | - (string) FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
114 | - (string) FEATURE_GRADE_HAS_GRADE => false, |
|
115 | - (string) FEATURE_GRADE_OUTCOMES => false, |
|
116 | - (string) FEATURE_SHOW_DESCRIPTION => true, |
|
107 | + (string)FEATURE_IDNUMBER => true, |
|
108 | + (string)FEATURE_GROUPS => true, |
|
109 | + (string)FEATURE_GROUPINGS => true, |
|
110 | + (string)FEATURE_GROUPMEMBERSONLY => true, |
|
111 | + (string)FEATURE_MOD_INTRO => true, |
|
112 | + (string)FEATURE_BACKUP_MOODLE2 => true, |
|
113 | + (string)FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
114 | + (string)FEATURE_GRADE_HAS_GRADE => false, |
|
115 | + (string)FEATURE_GRADE_OUTCOMES => false, |
|
116 | + (string)FEATURE_SHOW_DESCRIPTION => true, |
|
117 | 117 | ); |
118 | - if (isset($features[(string) $feature])) { |
|
118 | + if (isset($features[(string)$feature])) { |
|
119 | 119 | return $features[$feature]; |
120 | 120 | } |
121 | 121 | return null; |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | $log->timecreated = time(); |
216 | 216 | $log->log = BIGBLUEBUTTONBN_LOG_EVENT_DELETE; |
217 | 217 | $sql = "SELECT * FROM {bigbluebuttonbn_logs} "; |
218 | - $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND ". $DB->sql_compare_text('meta') . " = ?"; |
|
218 | + $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND " . $DB->sql_compare_text('meta') . " = ?"; |
|
219 | 219 | $logs = $DB->get_records_sql($sql, array($bigbluebuttonbn->id, BIGBLUEBUTTONBN_LOG_EVENT_CREATE, "{\"record\":true}")); |
220 | 220 | $log->meta = "{\"has_recordings\":false}"; |
221 | 221 | if (!empty($logs)) { |
@@ -244,10 +244,10 @@ discard block |
||
244 | 244 | function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) { |
245 | 245 | global $DB; |
246 | 246 | $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id, |
247 | - 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join', ), '*'); |
|
247 | + 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join',), '*'); |
|
248 | 248 | if ($completed > 0) { |
249 | - return fullname($user).' '.get_string('view_message_has_joined', 'bigbluebuttonbn').' '. |
|
250 | - get_string('view_message_session_for', 'bigbluebuttonbn').' '.(string) $completed.' '. |
|
249 | + return fullname($user) . ' ' . get_string('view_message_has_joined', 'bigbluebuttonbn') . ' ' . |
|
250 | + get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string)$completed . ' ' . |
|
251 | 251 | get_string('view_message_times', 'bigbluebuttonbn'); |
252 | 252 | } |
253 | 253 | return ''; |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | function bigbluebuttonbn_user_complete($course, $user, $mod, $bigbluebuttonbn) { |
268 | 268 | global $DB; |
269 | 269 | $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id, |
270 | - 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join', ), |
|
270 | + 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join',), |
|
271 | 271 | '*', IGNORE_MULTIPLE); |
272 | 272 | return $completed > 0; |
273 | 273 | } |
@@ -342,16 +342,16 @@ discard block |
||
342 | 342 | if ($bigbluebuttonbn->visible) { |
343 | 343 | $classes = 'class="dimmed" '; |
344 | 344 | } |
345 | - $str = '<div class="bigbluebuttonbn overview">'."\n"; |
|
346 | - $str .= ' <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; |
|
347 | - $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule. |
|
348 | - '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
349 | - $str .= ' </div>'."\n"; |
|
350 | - $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime). |
|
351 | - '</div>'."\n"; |
|
352 | - $str .= ' <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) |
|
353 | - .'</div>'."\n"; |
|
354 | - $str .= '</div>'."\n"; |
|
345 | + $str = '<div class="bigbluebuttonbn overview">' . "\n"; |
|
346 | + $str .= ' <div class="name">' . get_string('modulename', 'bigbluebuttonbn') . ': ' . "\n"; |
|
347 | + $str .= ' <a ' . $classes . 'href="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bigbluebuttonbn->coursemodule . |
|
348 | + '">' . $bigbluebuttonbn->name . '</a>' . "\n"; |
|
349 | + $str .= ' </div>' . "\n"; |
|
350 | + $str .= ' <div class="info">' . get_string($start, 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->openingtime) . |
|
351 | + '</div>' . "\n"; |
|
352 | + $str .= ' <div class="info">' . get_string('ends_at', 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->closingtime) |
|
353 | + .'</div>' . "\n"; |
|
354 | + $str .= '</div>' . "\n"; |
|
355 | 355 | return $str; |
356 | 356 | } |
357 | 357 | |
@@ -505,7 +505,7 @@ discard block |
||
505 | 505 | if (count($files) == 1) { |
506 | 506 | // Get the first (and only) file. |
507 | 507 | $file = reset($files); |
508 | - $filesrc = '/'.$file->get_filename(); |
|
508 | + $filesrc = '/' . $file->get_filename(); |
|
509 | 509 | } |
510 | 510 | return $filesrc; |
511 | 511 | } |
@@ -573,7 +573,7 @@ discard block |
||
573 | 573 | if (!$filename) { |
574 | 574 | return false; |
575 | 575 | } |
576 | - $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename; |
|
576 | + $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename; |
|
577 | 577 | $fs = get_file_storage(); |
578 | 578 | $file = $fs->get_file_by_hash(sha1($fullpath)); |
579 | 579 | if (!$file || $file->is_directory()) { |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | /** |
327 | 327 | * Helper function to retrive the default config.xml file. |
328 | 328 | * |
329 | - * @return string |
|
329 | + * @return null|SimpleXMLElement |
|
330 | 330 | */ |
331 | 331 | function bigbluebuttonbn_get_default_config_xml() { |
332 | 332 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | * @param object $a |
398 | 398 | * @param object $b |
399 | 399 | * |
400 | - * @return array |
|
400 | + * @return integer |
|
401 | 401 | */ |
402 | 402 | function bigbluebuttonbn_recording_build_sorter($a, $b) { |
403 | 403 | if ($a['startTime'] < $b['startTime']) { |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | * @param string $data |
524 | 524 | * @param string $contenttype |
525 | 525 | * |
526 | - * @return object |
|
526 | + * @return null|SimpleXMLElement |
|
527 | 527 | */ |
528 | 528 | function bigbluebuttonbn_wrap_xml_load_file($url, $method = 'GET', $data = null, $contenttype = 'text/xml') { |
529 | 529 | if (extension_loaded('curl')) { |
@@ -564,7 +564,7 @@ discard block |
||
564 | 564 | * @param string $data |
565 | 565 | * @param string $contenttype |
566 | 566 | * |
567 | - * @return object |
|
567 | + * @return string |
|
568 | 568 | */ |
569 | 569 | function bigbluebuttonbn_wrap_xml_load_file_curl_request($url, $method = 'GET', $data = null, $contenttype = 'text/xml') { |
570 | 570 | $c = new curl(); |
@@ -604,7 +604,7 @@ discard block |
||
604 | 604 | * Returns user roles in a context. |
605 | 605 | * |
606 | 606 | * @param context $context |
607 | - * @param context $userid |
|
607 | + * @param integer $userid |
|
608 | 608 | * |
609 | 609 | * @return array $userroles |
610 | 610 | */ |
@@ -928,7 +928,7 @@ discard block |
||
928 | 928 | * |
929 | 929 | * @param integer $voicebridge |
930 | 930 | * |
931 | - * @return string |
|
931 | + * @return boolean |
|
932 | 932 | */ |
933 | 933 | function bigbluebuttonbn_voicebridge_unique($voicebridge) { |
934 | 934 | global $DB; |
@@ -1028,7 +1028,7 @@ discard block |
||
1028 | 1028 | /** |
1029 | 1029 | * Helper returns an array with all possible bigbluebuttonbn events. |
1030 | 1030 | * |
1031 | - * @return array |
|
1031 | + * @return string[] |
|
1032 | 1032 | */ |
1033 | 1033 | function bigbluebuttonbn_events() { |
1034 | 1034 | return array( |
@@ -1237,7 +1237,7 @@ discard block |
||
1237 | 1237 | * @param string $meetingid |
1238 | 1238 | * @param string $configxml |
1239 | 1239 | * |
1240 | - * @return object |
|
1240 | + * @return null|SimpleXMLElement |
|
1241 | 1241 | */ |
1242 | 1242 | function bigbluebuttonbn_set_config_xml($meetingid, $configxml) { |
1243 | 1243 | $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?'; |
@@ -1442,6 +1442,9 @@ discard block |
||
1442 | 1442 | return $OUTPUT->action_link('#', $title, null, $linkattributes); |
1443 | 1443 | } |
1444 | 1444 | |
1445 | +/** |
|
1446 | + * @param boolean $editable |
|
1447 | + */ |
|
1445 | 1448 | function bigbluebuttonbn_get_recording_data_row_meta_activity($recording, $editable) { |
1446 | 1449 | $payload = array(); |
1447 | 1450 | if ($editable) { |
@@ -1463,6 +1466,9 @@ discard block |
||
1463 | 1466 | return bigbluebuttonbn_get_recording_data_row_text($recording, $metaname, $newsource, $payload); |
1464 | 1467 | } |
1465 | 1468 | |
1469 | +/** |
|
1470 | + * @param boolean $editable |
|
1471 | + */ |
|
1466 | 1472 | function bigbluebuttonbn_get_recording_data_row_meta_description($recording, $editable) { |
1467 | 1473 | $payload = array(); |
1468 | 1474 | if ($editable) { |
@@ -1483,6 +1489,10 @@ discard block |
||
1483 | 1489 | return bigbluebuttonbn_get_recording_data_row_text($recording, '', $newsource, $payload); |
1484 | 1490 | } |
1485 | 1491 | |
1492 | +/** |
|
1493 | + * @param string $text |
|
1494 | + * @param string $source |
|
1495 | + */ |
|
1486 | 1496 | function bigbluebuttonbn_get_recording_data_row_text($recording, $text, $source, $data) { |
1487 | 1497 | $htmltext = '<span>' . htmlentities($text) . '</span>'; |
1488 | 1498 | if (empty($data)) { |
@@ -1757,7 +1767,7 @@ discard block |
||
1757 | 1767 | * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included |
1758 | 1768 | * in the getRecordings request considering only those that belong to deleted activities. |
1759 | 1769 | * |
1760 | - * @param string $courseid |
|
1770 | + * @param integer $courseid |
|
1761 | 1771 | * @param string $bigbluebuttonbnid |
1762 | 1772 | * @param bool $subset |
1763 | 1773 | * |
@@ -119,9 +119,9 @@ discard block |
||
119 | 119 | */ |
120 | 120 | function bigbluebuttonbn_get_join_url($meetingid, $username, $pw, $logouturl, $configtoken = null, $userid = null) { |
121 | 121 | $data = ['meetingID' => $meetingid, |
122 | - 'fullName' => $username, |
|
123 | - 'password' => $pw, |
|
124 | - 'logoutURL' => $logouturl, |
|
122 | + 'fullName' => $username, |
|
123 | + 'password' => $pw, |
|
124 | + 'logoutURL' => $logouturl, |
|
125 | 125 | ]; |
126 | 126 | if (!is_null($configtoken)) { |
127 | 127 | $data['configToken'] = $configtoken; |
@@ -173,23 +173,23 @@ discard block |
||
173 | 173 | function bigbluebuttonbn_get_meeting_info_array($meetingid) { |
174 | 174 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
175 | 175 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
176 | - ); |
|
176 | + ); |
|
177 | 177 | if ($xml && $xml->returncode == 'SUCCESS' && empty($xml->messageKey)) { |
178 | 178 | // Meeting info was returned. |
179 | 179 | return array('returncode' => $xml->returncode, |
180 | - 'meetingID' => $xml->meetingID, |
|
181 | - 'moderatorPW' => $xml->moderatorPW, |
|
182 | - 'attendeePW' => $xml->attendeePW, |
|
183 | - 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded, |
|
184 | - 'running' => $xml->running, |
|
185 | - 'recording' => $xml->recording, |
|
186 | - 'startTime' => $xml->startTime, |
|
187 | - 'endTime' => $xml->endTime, |
|
188 | - 'participantCount' => $xml->participantCount, |
|
189 | - 'moderatorCount' => $xml->moderatorCount, |
|
190 | - 'attendees' => $xml->attendees, |
|
191 | - 'metadata' => $xml->metadata, |
|
192 | - ); |
|
180 | + 'meetingID' => $xml->meetingID, |
|
181 | + 'moderatorPW' => $xml->moderatorPW, |
|
182 | + 'attendeePW' => $xml->attendeePW, |
|
183 | + 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded, |
|
184 | + 'running' => $xml->running, |
|
185 | + 'recording' => $xml->recording, |
|
186 | + 'startTime' => $xml->startTime, |
|
187 | + 'endTime' => $xml->endTime, |
|
188 | + 'participantCount' => $xml->participantCount, |
|
189 | + 'moderatorCount' => $xml->moderatorCount, |
|
190 | + 'attendees' => $xml->attendees, |
|
191 | + 'metadata' => $xml->metadata, |
|
192 | + ); |
|
193 | 193 | } |
194 | 194 | if ($xml) { |
195 | 195 | // Either failure or success without meeting info. |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | function bigbluebuttonbn_get_default_config_xml() { |
332 | 332 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
333 | 333 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getDefaultConfigXML') |
334 | - ); |
|
334 | + ); |
|
335 | 335 | return $xml; |
336 | 336 | } |
337 | 337 | |
@@ -421,7 +421,7 @@ discard block |
||
421 | 421 | foreach ($ids as $id) { |
422 | 422 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
423 | 423 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('deleteRecordings', ['recordID' => $id]) |
424 | - ); |
|
424 | + ); |
|
425 | 425 | if ($xml && $xml->returncode != 'SUCCESS') { |
426 | 426 | return false; |
427 | 427 | } |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | foreach ($ids as $id) { |
441 | 441 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
442 | 442 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('publishRecordings', ['recordID' => $id, 'publish' => $publish]) |
443 | - ); |
|
443 | + ); |
|
444 | 444 | if ($xml && $xml->returncode != 'SUCCESS') { |
445 | 445 | return false; |
446 | 446 | } |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | foreach ($ids as $id) { |
460 | 460 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
461 | 461 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params) |
462 | - ); |
|
462 | + ); |
|
463 | 463 | if ($xml && $xml->returncode != 'SUCCESS') { |
464 | 464 | return false; |
465 | 465 | } |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | function bigbluebuttonbn_end_meeting($meetingid, $modpw) { |
477 | 477 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
478 | 478 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('end', ['meetingID' => $meetingid, 'password' => $modpw]) |
479 | - ); |
|
479 | + ); |
|
480 | 480 | if ($xml) { |
481 | 481 | // If the xml packet returned failure it displays the message to the user. |
482 | 482 | return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); |
@@ -496,7 +496,7 @@ discard block |
||
496 | 496 | */ |
497 | 497 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
498 | 498 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
499 | - ); |
|
499 | + ); |
|
500 | 500 | return ($xml && $xml->returncode == 'SUCCESS'); |
501 | 501 | } |
502 | 502 | |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | function bigbluebuttonbn_get_server_version() { |
509 | 509 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
510 | 510 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url() |
511 | - ); |
|
511 | + ); |
|
512 | 512 | if ($xml && $xml->returncode == 'SUCCESS') { |
513 | 513 | return $xml->version; |
514 | 514 | } |
@@ -576,10 +576,10 @@ discard block |
||
576 | 576 | |
577 | 577 | $options = array(); |
578 | 578 | $options['CURLOPT_HTTPHEADER'] = array( |
579 | - 'Content-Type: '.$contenttype, |
|
580 | - 'Content-Length: '.strlen($data), |
|
581 | - 'Content-Language: en-US', |
|
582 | - ); |
|
579 | + 'Content-Type: '.$contenttype, |
|
580 | + 'Content-Length: '.strlen($data), |
|
581 | + 'Content-Language: en-US', |
|
582 | + ); |
|
583 | 583 | |
584 | 584 | return $c->post($url, $data, $options); |
585 | 585 | } |
@@ -722,16 +722,16 @@ discard block |
||
722 | 722 | 'all' => array( |
723 | 723 | 'name' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'), |
724 | 724 | 'children' => [] |
725 | - ) |
|
726 | - ); |
|
725 | + ) |
|
726 | + ); |
|
727 | 727 | $data['role'] = array( |
728 | 728 | 'name' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'), |
729 | 729 | 'children' => bigbluebuttonbn_get_roles_select($context) |
730 | - ); |
|
730 | + ); |
|
731 | 731 | $data['user'] = array( |
732 | 732 | 'name' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'), |
733 | 733 | 'children' => bigbluebuttonbn_get_users_select($context) |
734 | - ); |
|
734 | + ); |
|
735 | 735 | return $data; |
736 | 736 | } |
737 | 737 | |
@@ -776,9 +776,9 @@ discard block |
||
776 | 776 | continue; |
777 | 777 | } |
778 | 778 | $participantlistarray[] = array( |
779 | - 'selectiontype' => 'role', |
|
780 | - 'selectionid' => $moderatordefault, |
|
781 | - 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR); |
|
779 | + 'selectiontype' => 'role', |
|
780 | + 'selectionid' => $moderatordefault, |
|
781 | + 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR); |
|
782 | 782 | } |
783 | 783 | return $participantlistarray; |
784 | 784 | } |
@@ -821,11 +821,11 @@ discard block |
||
821 | 821 | 'all' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'), |
822 | 822 | 'role' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'), |
823 | 823 | 'user' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'), |
824 | - ], |
|
824 | + ], |
|
825 | 825 | 'type_selected' => 'all', |
826 | 826 | 'options' => ['all' => '---------------'], |
827 | 827 | 'selected' => 'all', |
828 | - ]; |
|
828 | + ]; |
|
829 | 829 | } |
830 | 830 | |
831 | 831 | /** |
@@ -1103,7 +1103,7 @@ discard block |
||
1103 | 1103 | $eventproperties['other'] = $options['other']; |
1104 | 1104 | } |
1105 | 1105 | $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create', |
1106 | - array($eventproperties)); |
|
1106 | + array($eventproperties)); |
|
1107 | 1107 | $event->trigger(); |
1108 | 1108 | } |
1109 | 1109 | |
@@ -1147,7 +1147,7 @@ discard block |
||
1147 | 1147 | // Ping again and refresh the cache. |
1148 | 1148 | $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file( |
1149 | 1149 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
1150 | - ); |
|
1150 | + ); |
|
1151 | 1151 | $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); |
1152 | 1152 | return $meetinginfo; |
1153 | 1153 | } |
@@ -1411,8 +1411,8 @@ discard block |
||
1411 | 1411 | } |
1412 | 1412 | $id = 'playbacks-'.$recording['recordID']; |
1413 | 1413 | $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported, |
1414 | - 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
|
1415 | - 'title' => $title, $visibility => $visibility)); |
|
1414 | + 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
|
1415 | + 'title' => $title, $visibility => $visibility)); |
|
1416 | 1416 | foreach ($recording['playbacks'] as $playback) { |
1417 | 1417 | $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bigbluebuttonbnid, |
1418 | 1418 | $playback).' '; |
@@ -1426,7 +1426,7 @@ discard block |
||
1426 | 1426 | $title = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'); |
1427 | 1427 | $onclick = 'M.mod_bigbluebuttonbn.recordings.recordingPlay(this);'; |
1428 | 1428 | $href = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=play&bn='.$bigbluebuttonbnid. |
1429 | - '&mid='.$recording['meetingID'].'&rid='.$recording['recordID'].'&rtype='.$playback['type']; |
|
1429 | + '&mid='.$recording['meetingID'].'&rid='.$recording['recordID'].'&rtype='.$playback['type']; |
|
1430 | 1430 | if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') { |
1431 | 1431 | $href .= '&href='.urlencode(trim($playback['url'])); |
1432 | 1432 | } |
@@ -1438,7 +1438,7 @@ discard block |
||
1438 | 1438 | 'data-target' => $playback['type'], |
1439 | 1439 | 'data-href' => $href, |
1440 | 1440 | 'class' => 'btn btn-sm btn-default' |
1441 | - ); |
|
1441 | + ); |
|
1442 | 1442 | return $OUTPUT->action_link('#', $title, null, $linkattributes); |
1443 | 1443 | } |
1444 | 1444 | |
@@ -1522,7 +1522,7 @@ discard block |
||
1522 | 1522 | 'onclick' => $onclick, |
1523 | 1523 | 'data-action' => $data['action'], |
1524 | 1524 | 'data-links' => bigbluebuttonbn_get_count_recording_imported_instances($recording['recordID']) |
1525 | - ); |
|
1525 | + ); |
|
1526 | 1526 | return $OUTPUT->action_icon('#', $icon, null, $linkattributes, false); |
1527 | 1527 | } |
1528 | 1528 | // With text for $manageaction. |
@@ -1627,7 +1627,7 @@ discard block |
||
1627 | 1627 | $texthead . $rowdata->activity . $texttail, $texthead . $rowdata->description . $texttail, |
1628 | 1628 | $rowdata->preview, $texthead . $rowdata->date_formatted . $texttail, |
1629 | 1629 | $rowdata->duration_formatted |
1630 | - ); |
|
1630 | + ); |
|
1631 | 1631 | if ($bbbsession['managerecordings']) { |
1632 | 1632 | $row->cells[] = $rowdata->actionbar; |
1633 | 1633 | } |
@@ -1947,8 +1947,8 @@ discard block |
||
1947 | 1947 | $activitytime = ''; |
1948 | 1948 | if ($time) { |
1949 | 1949 | $activitytime = calendar_day_representation($time).' '. |
1950 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
1951 | - calendar_time_representation($time); |
|
1950 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
1951 | + calendar_time_representation($time); |
|
1952 | 1952 | } |
1953 | 1953 | return $activitytime; |
1954 | 1954 | } |
@@ -2233,7 +2233,7 @@ discard block |
||
2233 | 2233 | $renderer->render_group_element('participant_moderator_default', |
2234 | 2234 | $renderer->render_group_element_configmultiselect('participant_moderator_default', |
2235 | 2235 | array_keys($owner), array_merge($owner, $roles)) |
2236 | - ); |
|
2236 | + ); |
|
2237 | 2237 | } |
2238 | 2238 | } |
2239 | 2239 |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | global $CFG; |
30 | 30 | |
31 | -require_once(dirname(__FILE__).'/lib.php'); |
|
31 | +require_once(dirname(__FILE__) . '/lib.php'); |
|
32 | 32 | |
33 | 33 | /** @var BIGBLUEBUTTONBN_UPDATE_CACHE boolean set to true indicates that cache has to be updated */ |
34 | 34 | const BIGBLUEBUTTONBN_UPDATE_CACHE = true; |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | if (isset($meta)) { |
101 | 101 | $log->meta = $meta; |
102 | 102 | } else if ($event == BIGBLUEBUTTONBN_LOG_EVENT_CREATE) { |
103 | - $log->meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}'; |
|
103 | + $log->meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}'; |
|
104 | 104 | } |
105 | 105 | $DB->insert_record('bigbluebuttonbn_logs', $log); |
106 | 106 | } |
@@ -148,8 +148,8 @@ discard block |
||
148 | 148 | $data = null; |
149 | 149 | if (!is_null($pname) && !is_null($purl)) { |
150 | 150 | $method = 'POST'; |
151 | - $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='". |
|
152 | - $purl."' /></module></modules>"; |
|
151 | + $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='" . |
|
152 | + $purl . "' /></module></modules>"; |
|
153 | 153 | } |
154 | 154 | $xml = bigbluebuttonbn_wrap_xml_load_file($createmeetingurl, $method, $data); |
155 | 155 | if ($xml) { |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | // Override imported flag with actual ID. |
317 | 317 | $recording['imported'] = $recordimported->id; |
318 | 318 | if (isset($recordimported->protected)) { |
319 | - $recording['protected'] = (string) $recordimported->protected; |
|
319 | + $recording['protected'] = (string)$recordimported->protected; |
|
320 | 320 | } |
321 | 321 | $recordsimportedarray[$recording['recordID']] = $recording; |
322 | 322 | } |
@@ -346,29 +346,29 @@ discard block |
||
346 | 346 | // Add formats. |
347 | 347 | $playbackarray = array(); |
348 | 348 | foreach ($recording->playback->format as $format) { |
349 | - $playbackarray[(string) $format->type] = array('type' => (string) $format->type, |
|
350 | - 'url' => trim((string) $format->url), 'length' => (string) $format->length); |
|
349 | + $playbackarray[(string)$format->type] = array('type' => (string)$format->type, |
|
350 | + 'url' => trim((string)$format->url), 'length' => (string)$format->length); |
|
351 | 351 | // Add preview per format when existing. |
352 | 352 | if ($format->preview) { |
353 | 353 | $imagesarray = array(); |
354 | 354 | foreach ($format->preview->images->image as $image) { |
355 | - $imagearray = array('url' => trim((string) $image)); |
|
355 | + $imagearray = array('url' => trim((string)$image)); |
|
356 | 356 | foreach ($image->attributes() as $attkey => $attvalue) { |
357 | - $imagearray[$attkey] = (string) $attvalue; |
|
357 | + $imagearray[$attkey] = (string)$attvalue; |
|
358 | 358 | } |
359 | 359 | array_push($imagesarray, $imagearray); |
360 | 360 | } |
361 | - $playbackarray[(string) $format->type]['preview'] = $imagesarray; |
|
361 | + $playbackarray[(string)$format->type]['preview'] = $imagesarray; |
|
362 | 362 | } |
363 | 363 | } |
364 | 364 | // Add the metadata to the recordings array. |
365 | 365 | $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata)); |
366 | - $recordingarray = array('recordID' => (string) $recording->recordID, |
|
367 | - 'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name, |
|
368 | - 'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime, |
|
369 | - 'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray); |
|
366 | + $recordingarray = array('recordID' => (string)$recording->recordID, |
|
367 | + 'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name, |
|
368 | + 'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime, |
|
369 | + 'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray); |
|
370 | 370 | if (isset($recording->protected)) { |
371 | - $recordingarray['protected'] = (string) $recording->protected; |
|
371 | + $recordingarray['protected'] = (string)$recording->protected; |
|
372 | 372 | } |
373 | 373 | return $recordingarray + $metadataarray; |
374 | 374 | } |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | if (is_object($value)) { |
387 | 387 | $value = ''; |
388 | 388 | } |
389 | - $metadataarray['meta_'.$key] = $value; |
|
389 | + $metadataarray['meta_' . $key] = $value; |
|
390 | 390 | } |
391 | 391 | return $metadataarray; |
392 | 392 | } |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | $ids = explode(',', $recordids); |
459 | 459 | foreach ($ids as $id) { |
460 | 460 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
461 | - \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params) |
|
461 | + \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params) |
|
462 | 462 | ); |
463 | 463 | if ($xml && $xml->returncode != 'SUCCESS') { |
464 | 464 | return false; |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | return $xml; |
539 | 539 | } catch (Exception $e) { |
540 | 540 | libxml_use_internal_errors($previous); |
541 | - $error = 'Caught exception: '.$e->getMessage(); |
|
541 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
542 | 542 | debugging($error, DEBUG_DEVELOPER); |
543 | 543 | return null; |
544 | 544 | } |
@@ -549,7 +549,7 @@ discard block |
||
549 | 549 | $response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS); |
550 | 550 | return $response; |
551 | 551 | } catch (Exception $e) { |
552 | - $error = 'Caught exception: '.$e->getMessage(); |
|
552 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
553 | 553 | debugging($error, DEBUG_DEVELOPER); |
554 | 554 | libxml_use_internal_errors($previous); |
555 | 555 | return null; |
@@ -576,8 +576,8 @@ discard block |
||
576 | 576 | |
577 | 577 | $options = array(); |
578 | 578 | $options['CURLOPT_HTTPHEADER'] = array( |
579 | - 'Content-Type: '.$contenttype, |
|
580 | - 'Content-Length: '.strlen($data), |
|
579 | + 'Content-Type: ' . $contenttype, |
|
580 | + 'Content-Length: ' . strlen($data), |
|
581 | 581 | 'Content-Language: en-US', |
582 | 582 | ); |
583 | 583 | |
@@ -594,7 +594,7 @@ discard block |
||
594 | 594 | * @return void |
595 | 595 | */ |
596 | 596 | function bigbluebuttonbn_end_meeting_if_running($bigbluebuttonbn) { |
597 | - $meetingid = $bigbluebuttonbn->meetingid.'-'.$bigbluebuttonbn->course.'-'.$bigbluebuttonbn->id; |
|
597 | + $meetingid = $bigbluebuttonbn->meetingid . '-' . $bigbluebuttonbn->course . '-' . $bigbluebuttonbn->id; |
|
598 | 598 | if (bigbluebuttonbn_is_meeting_running($meetingid)) { |
599 | 599 | bigbluebuttonbn_end_meeting($meetingid, $bigbluebuttonbn->moderatorpass); |
600 | 600 | } |
@@ -614,9 +614,9 @@ discard block |
||
614 | 614 | if ($userroles) { |
615 | 615 | $where = ''; |
616 | 616 | foreach ($userroles as $userrole) { |
617 | - $where .= (empty($where) ? ' WHERE' : ' OR').' id='.$userrole->roleid; |
|
617 | + $where .= (empty($where) ? ' WHERE' : ' OR') . ' id=' . $userrole->roleid; |
|
618 | 618 | } |
619 | - $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where); |
|
619 | + $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where); |
|
620 | 620 | } |
621 | 621 | return $userroles; |
622 | 622 | } |
@@ -639,7 +639,7 @@ discard block |
||
639 | 639 | * @return array $users |
640 | 640 | */ |
641 | 641 | function bigbluebuttonbn_get_users(context $context = null) { |
642 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
642 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
643 | 643 | foreach ($users as $key => $value) { |
644 | 644 | $users[$key] = fullname($value); |
645 | 645 | } |
@@ -654,7 +654,7 @@ discard block |
||
654 | 654 | * @return array $users |
655 | 655 | */ |
656 | 656 | function bigbluebuttonbn_get_users_select(context $context = null) { |
657 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
657 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
658 | 658 | foreach ($users as $key => $value) { |
659 | 659 | $users[$key] = array('id' => $value->id, 'name' => fullname($value)); |
660 | 660 | } |
@@ -669,7 +669,7 @@ discard block |
||
669 | 669 | * @return array $roles |
670 | 670 | */ |
671 | 671 | function bigbluebuttonbn_get_roles(context $context = null) { |
672 | - $roles = (array) role_get_names($context); |
|
672 | + $roles = (array)role_get_names($context); |
|
673 | 673 | foreach ($roles as $key => $value) { |
674 | 674 | $roles[$key] = $value->localname; |
675 | 675 | } |
@@ -684,7 +684,7 @@ discard block |
||
684 | 684 | * @return array $users |
685 | 685 | */ |
686 | 686 | function bigbluebuttonbn_get_roles_select(context $context = null) { |
687 | - $roles = (array) role_get_names($context); |
|
687 | + $roles = (array)role_get_names($context); |
|
688 | 688 | foreach ($roles as $key => $value) { |
689 | 689 | $roles[$key] = array('id' => $value->id, 'name' => $value->localname); |
690 | 690 | } |
@@ -699,7 +699,7 @@ discard block |
||
699 | 699 | * @return object $role |
700 | 700 | */ |
701 | 701 | function bigbluebuttonbn_get_role($id) { |
702 | - $roles = (array) role_get_names(); |
|
702 | + $roles = (array)role_get_names(); |
|
703 | 703 | if (is_numeric($id)) { |
704 | 704 | return (object)$roles[$id]; |
705 | 705 | } |
@@ -796,11 +796,11 @@ discard block |
||
796 | 796 | return array(); |
797 | 797 | } |
798 | 798 | foreach ($rules as $key => $rule) { |
799 | - if ( $rule['selectiontype'] !== 'role' || is_numeric($rule['selectionid']) ) { |
|
799 | + if ($rule['selectiontype'] !== 'role' || is_numeric($rule['selectionid'])) { |
|
800 | 800 | continue; |
801 | 801 | } |
802 | 802 | $role = bigbluebuttonbn_get_role($rule['selectionid']); |
803 | - if ( $role == null ) { |
|
803 | + if ($role == null) { |
|
804 | 804 | unset($rules[$key]); |
805 | 805 | continue; |
806 | 806 | } |
@@ -854,7 +854,7 @@ discard block |
||
854 | 854 | if (empty($userroles)) { |
855 | 855 | $userroles = get_user_roles($context, $userid, true); |
856 | 856 | } |
857 | - return bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles); |
|
857 | + return bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles); |
|
858 | 858 | } |
859 | 859 | |
860 | 860 | /** |
@@ -934,7 +934,7 @@ discard block |
||
934 | 934 | global $DB; |
935 | 935 | if ($voicebridge != 0) { |
936 | 936 | $table = 'bigbluebuttonbn'; |
937 | - $select = 'voicebridge = '.$voicebridge; |
|
937 | + $select = 'voicebridge = ' . $voicebridge; |
|
938 | 938 | if ($DB->get_records_select($table, $select)) { |
939 | 939 | return false; |
940 | 940 | } |
@@ -1006,7 +1006,7 @@ discard block |
||
1006 | 1006 | function bigbluebuttonbn_generate_nonce() { |
1007 | 1007 | $mt = microtime(); |
1008 | 1008 | $rand = mt_rand(); |
1009 | - return md5($mt.$rand); |
|
1009 | + return md5($mt . $rand); |
|
1010 | 1010 | } |
1011 | 1011 | |
1012 | 1012 | /** |
@@ -1032,21 +1032,21 @@ discard block |
||
1032 | 1032 | */ |
1033 | 1033 | function bigbluebuttonbn_events() { |
1034 | 1034 | return array( |
1035 | - (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
1036 | - (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
1037 | - (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
1038 | - (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
1039 | - (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
1040 | - (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
1041 | - (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
1042 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
1043 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
1044 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
1045 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
1046 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
1047 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
1048 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
1049 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
1035 | + (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
1036 | + (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
1037 | + (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
1038 | + (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
1039 | + (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
1040 | + (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
1041 | + (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
1042 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
1043 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
1044 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
1045 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
1046 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
1047 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
1048 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
1049 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
1050 | 1050 | ); |
1051 | 1051 | } |
1052 | 1052 | |
@@ -1057,21 +1057,21 @@ discard block |
||
1057 | 1057 | */ |
1058 | 1058 | function bigbluebuttonbn_events_action() { |
1059 | 1059 | return array( |
1060 | - 'view' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
1061 | - 'view_management' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
1062 | - 'live_action' => (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
1063 | - 'meeting_create' => (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
1064 | - 'meeting_end' => (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
1065 | - 'meeting_join' => (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
1066 | - 'meeting_left' => (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
1067 | - 'recording_delete' => (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
1068 | - 'recording_import' => (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
1069 | - 'recording_protect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
1070 | - 'recording_publish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
1071 | - 'recording_unprotect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
1072 | - 'recording_unpublish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
1073 | - 'recording_edit' => (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
1074 | - 'recording_play' => (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
1060 | + 'view' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
1061 | + 'view_management' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
1062 | + 'live_action' => (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
1063 | + 'meeting_create' => (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
1064 | + 'meeting_end' => (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
1065 | + 'meeting_join' => (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
1066 | + 'meeting_left' => (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
1067 | + 'recording_delete' => (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
1068 | + 'recording_import' => (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
1069 | + 'recording_protect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
1070 | + 'recording_publish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
1071 | + 'recording_unprotect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
1072 | + 'recording_unpublish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
1073 | + 'recording_edit' => (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
1074 | + 'recording_play' => (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
1075 | 1075 | ); |
1076 | 1076 | } |
1077 | 1077 | |
@@ -1102,7 +1102,7 @@ discard block |
||
1102 | 1102 | if (array_key_exists('other', $options)) { |
1103 | 1103 | $eventproperties['other'] = $options['other']; |
1104 | 1104 | } |
1105 | - $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create', |
|
1105 | + $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_' . $eventtype . '::create', |
|
1106 | 1106 | array($eventproperties)); |
1107 | 1107 | $event->trigger(); |
1108 | 1108 | } |
@@ -1142,10 +1142,10 @@ discard block |
||
1142 | 1142 | $now = time(); |
1143 | 1143 | if (!$updatecache && isset($result) && $now < ($result['creation_time'] + $cachettl)) { |
1144 | 1144 | // Use the value in the cache. |
1145 | - return (array) json_decode($result['meeting_info']); |
|
1145 | + return (array)json_decode($result['meeting_info']); |
|
1146 | 1146 | } |
1147 | 1147 | // Ping again and refresh the cache. |
1148 | - $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file( |
|
1148 | + $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file( |
|
1149 | 1149 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
1150 | 1150 | ); |
1151 | 1151 | $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); |
@@ -1240,7 +1240,7 @@ discard block |
||
1240 | 1240 | * @return object |
1241 | 1241 | */ |
1242 | 1242 | function bigbluebuttonbn_set_config_xml($meetingid, $configxml) { |
1243 | - $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?'; |
|
1243 | + $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?'; |
|
1244 | 1244 | $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml); |
1245 | 1245 | $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, 'POST', |
1246 | 1246 | $configxmlparams, 'application/x-www-form-urlencoded'); |
@@ -1256,8 +1256,8 @@ discard block |
||
1256 | 1256 | * @return string |
1257 | 1257 | */ |
1258 | 1258 | function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) { |
1259 | - $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid); |
|
1260 | - $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.\mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
1259 | + $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid); |
|
1260 | + $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . \mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
1261 | 1261 | return $configxmlparams; |
1262 | 1262 | } |
1263 | 1263 | |
@@ -1271,7 +1271,7 @@ discard block |
||
1271 | 1271 | */ |
1272 | 1272 | function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) { |
1273 | 1273 | $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml); |
1274 | - $configxmlarray = (array) $configxml; |
|
1274 | + $configxmlarray = (array)$configxml; |
|
1275 | 1275 | if ($configxmlarray['returncode'] != 'SUCCESS') { |
1276 | 1276 | debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER); |
1277 | 1277 | return ''; |
@@ -1321,7 +1321,7 @@ discard block |
||
1321 | 1321 | global $USER; |
1322 | 1322 | $starttime = $starttime - ($starttime % 1000); |
1323 | 1323 | // Set formatted date. |
1324 | - $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z'; |
|
1324 | + $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z'; |
|
1325 | 1325 | return userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone)); |
1326 | 1326 | } |
1327 | 1327 | |
@@ -1337,7 +1337,7 @@ discard block |
||
1337 | 1337 | function bigbluebuttonbn_get_recording_data_row_actionbar($recording, $tools) { |
1338 | 1338 | $actionbar = ''; |
1339 | 1339 | foreach ($tools as $tool) { |
1340 | - if ( $tool == 'protect' && !isset($recording['protected']) ) { |
|
1340 | + if ($tool == 'protect' && !isset($recording['protected'])) { |
|
1341 | 1341 | continue; |
1342 | 1342 | } |
1343 | 1343 | $buttonpayload = bigbluebuttonbn_get_recording_data_row_actionbar_payload($recording, $tool); |
@@ -1381,7 +1381,7 @@ discard block |
||
1381 | 1381 | $visibility = 'hidden '; |
1382 | 1382 | } |
1383 | 1383 | $recordingpreview = html_writer::start_tag('div', |
1384 | - array('id' => 'preview-'.$recording['recordID'], $visibility => $visibility)); |
|
1384 | + array('id' => 'preview-' . $recording['recordID'], $visibility => $visibility)); |
|
1385 | 1385 | foreach ($recording['playbacks'] as $playback) { |
1386 | 1386 | if (isset($playback['preview'])) { |
1387 | 1387 | foreach ($playback['preview'] as $image) { |
@@ -1409,13 +1409,13 @@ discard block |
||
1409 | 1409 | if ($recording['published'] === 'false') { |
1410 | 1410 | $visibility = 'hidden '; |
1411 | 1411 | } |
1412 | - $id = 'playbacks-'.$recording['recordID']; |
|
1412 | + $id = 'playbacks-' . $recording['recordID']; |
|
1413 | 1413 | $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported, |
1414 | 1414 | 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
1415 | 1415 | 'title' => $title, $visibility => $visibility)); |
1416 | 1416 | foreach ($recording['playbacks'] as $playback) { |
1417 | 1417 | $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bigbluebuttonbnid, |
1418 | - $playback).' '; |
|
1418 | + $playback) . ' '; |
|
1419 | 1419 | } |
1420 | 1420 | $recordingtypes .= html_writer::end_tag('div'); |
1421 | 1421 | return $recordingtypes; |
@@ -1423,12 +1423,12 @@ discard block |
||
1423 | 1423 | |
1424 | 1424 | function bigbluebuttonbn_get_recording_data_row_type($recording, $bigbluebuttonbnid, $playback) { |
1425 | 1425 | global $CFG, $OUTPUT; |
1426 | - $title = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'); |
|
1426 | + $title = get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn'); |
|
1427 | 1427 | $onclick = 'M.mod_bigbluebuttonbn.recordings.recordingPlay(this);'; |
1428 | - $href = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=play&bn='.$bigbluebuttonbnid. |
|
1429 | - '&mid='.$recording['meetingID'].'&rid='.$recording['recordID'].'&rtype='.$playback['type']; |
|
1428 | + $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bigbluebuttonbnid . |
|
1429 | + '&mid=' . $recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
1430 | 1430 | if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') { |
1431 | - $href .= '&href='.urlencode(trim($playback['url'])); |
|
1431 | + $href .= '&href=' . urlencode(trim($playback['url'])); |
|
1432 | 1432 | } |
1433 | 1433 | $id = 'recording-play-' . $playback['type'] . '-' . $recording['recordID']; |
1434 | 1434 | $linkattributes = array( |
@@ -1514,7 +1514,7 @@ discard block |
||
1514 | 1514 | if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recording_icons_enabled')) { |
1515 | 1515 | // With icon for $manageaction. |
1516 | 1516 | $iconattributes = array('id' => $id, 'class' => 'iconsmall'); |
1517 | - $icon = new pix_icon('i/'.$data['tag'], |
|
1517 | + $icon = new pix_icon('i/' . $data['tag'], |
|
1518 | 1518 | get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'), |
1519 | 1519 | 'moodle', $iconattributes); |
1520 | 1520 | $linkattributes = array( |
@@ -1596,7 +1596,7 @@ discard block |
||
1596 | 1596 | if (isset($recordings) && !array_key_exists('messageKey', $recordings)) { |
1597 | 1597 | // There are recordings for this meeting. |
1598 | 1598 | foreach ($recordings as $recording) { |
1599 | - if ( !bigbluebuttonbn_include_recording_table_row($bbbsession, $recording) ) { |
|
1599 | + if (!bigbluebuttonbn_include_recording_table_row($bbbsession, $recording)) { |
|
1600 | 1600 | continue; |
1601 | 1601 | } |
1602 | 1602 | bigbluebuttonbn_get_recording_table_row($bbbsession, $recording, $tools, $table); |
@@ -1611,7 +1611,7 @@ discard block |
||
1611 | 1611 | return; |
1612 | 1612 | } |
1613 | 1613 | $row = new html_table_row(); |
1614 | - $row->id = 'recording-td-'.$recording['recordID']; |
|
1614 | + $row->id = 'recording-td-' . $recording['recordID']; |
|
1615 | 1615 | $row->attributes['data-imported'] = 'false'; |
1616 | 1616 | $texthead = ''; |
1617 | 1617 | $texttail = ''; |
@@ -1635,7 +1635,7 @@ discard block |
||
1635 | 1635 | } |
1636 | 1636 | |
1637 | 1637 | function bigbluebuttonbn_include_recording_table_row($bbbsession, $recording) { |
1638 | - if ( isset($recording['imported']) || !isset($bbbsession['group']) || $recording['meetingID'] == $bbbsession['meetingid'] ) { |
|
1638 | + if (isset($recording['imported']) || !isset($bbbsession['group']) || $recording['meetingID'] == $bbbsession['meetingid']) { |
|
1639 | 1639 | return true; |
1640 | 1640 | } |
1641 | 1641 | return false; |
@@ -1648,9 +1648,9 @@ discard block |
||
1648 | 1648 | // Build the message_body. |
1649 | 1649 | $msg->activity_type = ''; |
1650 | 1650 | $msg->activity_title = $bigbluebuttonbn->name; |
1651 | - $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn').' '. |
|
1652 | - $msg->activity_type.' "'.$msg->activity_title.'" '. |
|
1653 | - get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>'; |
|
1651 | + $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . ' ' . |
|
1652 | + $msg->activity_type . ' "' . $msg->activity_title . '" ' . |
|
1653 | + get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>'; |
|
1654 | 1654 | \mod_bigbluebuttonbn\locallib\notifier::notification_send($sender, $bigbluebuttonbn, $messagetext); |
1655 | 1655 | } |
1656 | 1656 | |
@@ -1830,7 +1830,7 @@ discard block |
||
1830 | 1830 | } |
1831 | 1831 | // Prepare select for loading records based on existent bigbluebuttonbns. |
1832 | 1832 | $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE '; |
1833 | - $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')'; |
|
1833 | + $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')'; |
|
1834 | 1834 | // Include only Create events and exclude those with record not true. |
1835 | 1835 | $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?'; |
1836 | 1836 | // Execute select for loading records based on existent bigbluebuttonbns. |
@@ -1946,8 +1946,8 @@ discard block |
||
1946 | 1946 | function bigbluebuttonbn_format_activity_time($time) { |
1947 | 1947 | $activitytime = ''; |
1948 | 1948 | if ($time) { |
1949 | - $activitytime = calendar_day_representation($time).' '. |
|
1950 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
1949 | + $activitytime = calendar_day_representation($time) . ' ' . |
|
1950 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' . |
|
1951 | 1951 | calendar_time_representation($time); |
1952 | 1952 | } |
1953 | 1953 | return $activitytime; |
@@ -77,8 +77,8 @@ |
||
77 | 77 | $body .= html_writer::start_tag('br'); |
78 | 78 | $body .= html_writer::tag('input', '', |
79 | 79 | array('type' => 'button', 'class' => 'btn btn-secondary', |
80 | - 'value' => get_string('view_recording_button_return', 'bigbluebuttonbn'), |
|
81 | - 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$cm->id.'\'')); |
|
80 | + 'value' => get_string('view_recording_button_return', 'bigbluebuttonbn'), |
|
81 | + 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$cm->id.'\'')); |
|
82 | 82 | // JavaScript for locales. |
83 | 83 | $PAGE->requires->strings_for_js(array_keys(bigbluebuttonbn_get_strings_for_js()), 'bigbluebuttonbn'); |
84 | 84 | // Require JavaScript modules. |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | * @author Jesus Federico (jesus [at] blindsidenetworks [dt] com) |
24 | 24 | */ |
25 | 25 | |
26 | -require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); |
|
27 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
26 | +require_once(dirname(dirname(dirname(__FILE__))) . '/config.php'); |
|
27 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
28 | 28 | |
29 | 29 | $bn = required_param('bn', PARAM_INT); |
30 | 30 | $tc = optional_param('tc', 0, PARAM_INT); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $body .= html_writer::tag('input', '', |
79 | 79 | array('type' => 'button', 'class' => 'btn btn-secondary', |
80 | 80 | 'value' => get_string('view_recording_button_return', 'bigbluebuttonbn'), |
81 | - 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$cm->id.'\'')); |
|
81 | + 'onclick' => 'window.location=\'' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $cm->id . '\'')); |
|
82 | 82 | // JavaScript for locales. |
83 | 83 | $PAGE->requires->strings_for_js(array_keys(bigbluebuttonbn_get_strings_for_js()), 'bigbluebuttonbn'); |
84 | 84 | // Require JavaScript modules. |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | 'alt' => $contents, |
105 | 105 | 'title' => $contents, |
106 | 106 | 'src' => $jsvars['pix_icon_delete'] |
107 | - ); |
|
107 | + ); |
|
108 | 108 | $jsvars['pix_icon_delete'] = html_writer::tag('img', '', $options); |
109 | 109 | } |
110 | 110 | $PAGE->requires->yui_module('moodle-mod_bigbluebuttonbn-modform', |
@@ -224,8 +224,8 @@ discard block |
||
224 | 224 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
225 | 225 | $field['description_key'], 0, ['maxlength' => 4, 'size' => 6], |
226 | 226 | ['message' => get_string('mod_form_field_voicebridge_format_error', 'bigbluebuttonbn'), |
227 | - 'type' => 'numeric', 'rule' => '####', 'validator' => 'server'] |
|
228 | - ); |
|
227 | + 'type' => 'numeric', 'rule' => '####', 'validator' => 'server'] |
|
228 | + ); |
|
229 | 229 | } else { |
230 | 230 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
231 | 231 | $field['description_key'], 0, ['maxlength' => 4, 'size' => 6]); |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | */ |
264 | 264 | private function bigbluebuttonbn_mform_add_block_room_recordings(&$mform, $cfg) { |
265 | 265 | $field = ['type' => 'hidden', 'name' => 'recordings_html', 'data_type' => PARAM_INT, |
266 | - 'description_key' => null]; |
|
266 | + 'description_key' => null]; |
|
267 | 267 | if ($cfg['recordings_html_editable']) { |
268 | 268 | $field['type'] = 'checkbox'; |
269 | 269 | $field['description_key'] = 'mod_form_field_recordings_html'; |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
272 | 272 | $field['description_key'], $cfg['recordings_html_default']); |
273 | 273 | $field = ['type' => 'hidden', 'name' => 'recordings_deleted', 'data_type' => PARAM_INT, |
274 | - 'description_key' => null]; |
|
274 | + 'description_key' => null]; |
|
275 | 275 | if ($cfg['recordings_deleted_editable']) { |
276 | 276 | $field['type'] = 'checkbox'; |
277 | 277 | $field['description_key'] = 'mod_form_field_recordings_deleted'; |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
280 | 280 | $field['description_key'], $cfg['recordings_deleted_default']); |
281 | 281 | $field = ['type' => 'hidden', 'name' => 'recordings_imported', 'data_type' => PARAM_INT, |
282 | - 'description_key' => null]; |
|
282 | + 'description_key' => null]; |
|
283 | 283 | if ($cfg['recordings_imported_editable']) { |
284 | 284 | $field['type'] = 'checkbox'; |
285 | 285 | $field['description_key'] = 'mod_form_field_recordings_imported'; |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | $htmlselectiontype = html_writer::select($participantselection['type_options'], |
350 | 350 | 'bigbluebuttonbn_participant_selection_type', $participantselection['type_selected'], array(), |
351 | 351 | array('id' => 'bigbluebuttonbn_participant_selection_type', |
352 | - 'onchange' => 'M.mod_bigbluebuttonbn.modform.participantSelectionSet(); return 0;')); |
|
352 | + 'onchange' => 'M.mod_bigbluebuttonbn.modform.participantSelectionSet(); return 0;')); |
|
353 | 353 | $htmlselectionoptions = html_writer::select($participantselection['options'], 'bigbluebuttonbn_participant_selection', |
354 | 354 | $participantselection['selected'], array(), |
355 | 355 | array('id' => 'bigbluebuttonbn_participant_selection', 'disabled' => 'disabled')); |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | 'type' => 'button', 'class' => 'btn btn-secondary', |
358 | 358 | 'value' => get_string('mod_form_field_participant_list_action_add', 'bigbluebuttonbn'), |
359 | 359 | 'onclick' => 'M.mod_bigbluebuttonbn.modform.participantAdd(); return 0;' |
360 | - )); |
|
360 | + )); |
|
361 | 361 | $htmladdparticipant = html_writer::tag('div', |
362 | 362 | $htmlselectiontype . ' ' . $htmlselectionoptions . ' ' . $htmlselectioninput, null); |
363 | 363 | $mform->addElement('html', "\n\n"); |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | |
27 | 27 | defined('MOODLE_INTERNAL') || die(); |
28 | 28 | |
29 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
30 | -require_once($CFG->dirroot.'/course/moodleform_mod.php'); |
|
29 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
30 | +require_once($CFG->dirroot . '/course/moodleform_mod.php'); |
|
31 | 31 | |
32 | 32 | /** |
33 | 33 | * Moodle class for mod_form. |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $serverversion = bigbluebuttonbn_get_server_version(); |
49 | 49 | if (is_null($serverversion)) { |
50 | 50 | print_error('general_error_unable_connect', 'bigbluebuttonbn', |
51 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
51 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
52 | 52 | return; |
53 | 53 | } |
54 | 54 | // Context. |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | ); |
128 | 128 | $defaultvalues['presentation'] = $draftitemid; |
129 | 129 | } catch (Exception $e) { |
130 | - debugging('Presentation could not be loaded: '.$e->getMessage(), DEBUG_DEVELOPER); |
|
130 | + debugging('Presentation could not be loaded: ' . $e->getMessage(), DEBUG_DEVELOPER); |
|
131 | 131 | return; |
132 | 132 | } |
133 | 133 | } |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | return; |
424 | 424 | } |
425 | 425 | $mform->addElement($type, $name, get_string($descriptionkey, 'bigbluebuttonbn'), $options); |
426 | - if (get_string_manager()->string_exists($descriptionkey.'_help', 'bigbluebuttonbn')) { |
|
426 | + if (get_string_manager()->string_exists($descriptionkey . '_help', 'bigbluebuttonbn')) { |
|
427 | 427 | $mform->addHelpButton($name, $descriptionkey, 'bigbluebuttonbn'); |
428 | 428 | } |
429 | 429 | if (!empty($rule)) { |
@@ -62,91 +62,91 @@ |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | switch (strtolower($action)) { |
65 | - case 'logout': |
|
66 | - if (isset($errors) && $errors != '') { |
|
67 | - bigbluebutton_bbb_view_errors($errors, $id); |
|
68 | - break; |
|
69 | - } |
|
70 | - if (is_null($bbbsession)) { |
|
71 | - bigbluebutton_bbb_view_close_window_manually(); |
|
72 | - break; |
|
73 | - } |
|
74 | - // Moodle event logger: Create an event for meeting left. |
|
75 | - bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_LEFT, $bigbluebuttonbn, $cm); |
|
76 | - // Update the cache. |
|
77 | - $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_UPDATE_CACHE); |
|
78 | - // Close the tab or window where BBB was opened. |
|
79 | - bigbluebutton_bbb_view_close_window(); |
|
80 | - break; |
|
81 | - case 'join': |
|
82 | - if (is_null($bbbsession)) { |
|
83 | - print_error('view_error_unable_join', 'bigbluebuttonbn'); |
|
84 | - break; |
|
85 | - } |
|
86 | - // See if the session is in progress. |
|
87 | - if (bigbluebuttonbn_is_meeting_running($bbbsession['meetingid'])) { |
|
88 | - // Since the meeting is already running, we just join the session. |
|
89 | - bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn); |
|
90 | - break; |
|
91 | - } |
|
92 | - // If user is not administrator nor moderator (user is steudent) and waiting is required. |
|
93 | - if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) { |
|
94 | - header('Location: '.$bbbsession['logoutURL']); |
|
65 | + case 'logout': |
|
66 | + if (isset($errors) && $errors != '') { |
|
67 | + bigbluebutton_bbb_view_errors($errors, $id); |
|
68 | + break; |
|
69 | + } |
|
70 | + if (is_null($bbbsession)) { |
|
71 | + bigbluebutton_bbb_view_close_window_manually(); |
|
72 | + break; |
|
73 | + } |
|
74 | + // Moodle event logger: Create an event for meeting left. |
|
75 | + bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_LEFT, $bigbluebuttonbn, $cm); |
|
76 | + // Update the cache. |
|
77 | + $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_UPDATE_CACHE); |
|
78 | + // Close the tab or window where BBB was opened. |
|
79 | + bigbluebutton_bbb_view_close_window(); |
|
95 | 80 | break; |
96 | - } |
|
97 | - // As the meeting doesn't exist, try to create it. |
|
98 | - $response = bigbluebuttonbn_get_create_meeting_array( |
|
99 | - bigbluebutton_bbb_view_create_meeting_data($bbbsession), |
|
100 | - bigbluebutton_bbb_view_create_meeting_metadata($bbbsession), |
|
101 | - $bbbsession['presentation']['name'], |
|
102 | - $bbbsession['presentation']['url'] |
|
103 | - ); |
|
104 | - if (empty($response)) { |
|
105 | - // The server is unreachable. |
|
106 | - if ($bbbsession['administrator']) { |
|
107 | - print_error('view_error_unable_join', 'bigbluebuttonbn', |
|
108 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
81 | + case 'join': |
|
82 | + if (is_null($bbbsession)) { |
|
83 | + print_error('view_error_unable_join', 'bigbluebuttonbn'); |
|
84 | + break; |
|
85 | + } |
|
86 | + // See if the session is in progress. |
|
87 | + if (bigbluebuttonbn_is_meeting_running($bbbsession['meetingid'])) { |
|
88 | + // Since the meeting is already running, we just join the session. |
|
89 | + bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn); |
|
109 | 90 | break; |
110 | 91 | } |
111 | - if ($bbbsession['moderator']) { |
|
112 | - print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', |
|
92 | + // If user is not administrator nor moderator (user is steudent) and waiting is required. |
|
93 | + if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) { |
|
94 | + header('Location: '.$bbbsession['logoutURL']); |
|
95 | + break; |
|
96 | + } |
|
97 | + // As the meeting doesn't exist, try to create it. |
|
98 | + $response = bigbluebuttonbn_get_create_meeting_array( |
|
99 | + bigbluebutton_bbb_view_create_meeting_data($bbbsession), |
|
100 | + bigbluebutton_bbb_view_create_meeting_metadata($bbbsession), |
|
101 | + $bbbsession['presentation']['name'], |
|
102 | + $bbbsession['presentation']['url'] |
|
103 | + ); |
|
104 | + if (empty($response)) { |
|
105 | + // The server is unreachable. |
|
106 | + if ($bbbsession['administrator']) { |
|
107 | + print_error('view_error_unable_join', 'bigbluebuttonbn', |
|
108 | + $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
109 | + break; |
|
110 | + } |
|
111 | + if ($bbbsession['moderator']) { |
|
112 | + print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', |
|
113 | + $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
114 | + break; |
|
115 | + } |
|
116 | + print_error('view_error_unable_join_student', 'bigbluebuttonbn', |
|
113 | 117 | $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
114 | 118 | break; |
115 | 119 | } |
116 | - print_error('view_error_unable_join_student', 'bigbluebuttonbn', |
|
117 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
118 | - break; |
|
119 | - } |
|
120 | - if ($response['returncode'] == 'FAILED') { |
|
121 | - // The meeting was not created. |
|
122 | - if (!$printerrorkey) { |
|
123 | - print_error($response['message'], 'bigbluebuttonbn'); |
|
120 | + if ($response['returncode'] == 'FAILED') { |
|
121 | + // The meeting was not created. |
|
122 | + if (!$printerrorkey) { |
|
123 | + print_error($response['message'], 'bigbluebuttonbn'); |
|
124 | + break; |
|
125 | + } |
|
126 | + $printerrorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create'); |
|
127 | + print_error($printerrorkey, 'bigbluebuttonbn'); |
|
128 | + break; |
|
129 | + } |
|
130 | + if ($response['hasBeenForciblyEnded'] == 'true') { |
|
131 | + print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn')); |
|
124 | 132 | break; |
125 | 133 | } |
126 | - $printerrorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create'); |
|
127 | - print_error($printerrorkey, 'bigbluebuttonbn'); |
|
134 | + // Moodle event logger: Create an event for meeting created. |
|
135 | + bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_CREATED, $bigbluebuttonbn, $cm); |
|
136 | + // Internal logger: Insert a record with the meeting created. |
|
137 | + bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_CREATE); |
|
138 | + // Since the meeting is already running, we just join the session. |
|
139 | + bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn); |
|
128 | 140 | break; |
129 | - } |
|
130 | - if ($response['hasBeenForciblyEnded'] == 'true') { |
|
131 | - print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn')); |
|
141 | + case 'play': |
|
142 | + $href = bigbluebutton_bbb_view_playback_href($href, $mid, $rid, $rtype); |
|
143 | + // Moodle event logger: Create an event for meeting left. |
|
144 | + bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_VIEWED, $bigbluebuttonbn, $cm, ['other' => $rid]); |
|
145 | + // Execute the redirect. |
|
146 | + header('Location: '.urldecode($href)); |
|
132 | 147 | break; |
133 | - } |
|
134 | - // Moodle event logger: Create an event for meeting created. |
|
135 | - bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_CREATED, $bigbluebuttonbn, $cm); |
|
136 | - // Internal logger: Insert a record with the meeting created. |
|
137 | - bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_CREATE); |
|
138 | - // Since the meeting is already running, we just join the session. |
|
139 | - bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn); |
|
140 | - break; |
|
141 | - case 'play': |
|
142 | - $href = bigbluebutton_bbb_view_playback_href($href, $mid, $rid, $rtype); |
|
143 | - // Moodle event logger: Create an event for meeting left. |
|
144 | - bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_VIEWED, $bigbluebuttonbn, $cm, ['other' => $rid]); |
|
145 | - // Execute the redirect. |
|
146 | - header('Location: '.urldecode($href)); |
|
147 | - break; |
|
148 | - default: |
|
149 | - bigbluebutton_bbb_view_close_window(); |
|
148 | + default: |
|
149 | + bigbluebutton_bbb_view_close_window(); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | /** |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | * @author Jesus Federico (jesus [at] blindsidenetworks [dt] com) |
24 | 24 | */ |
25 | 25 | |
26 | -require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); |
|
27 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
26 | +require_once(dirname(dirname(dirname(__FILE__))) . '/config.php'); |
|
27 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
28 | 28 | |
29 | 29 | $action = required_param('action', PARAM_TEXT); |
30 | 30 | $id = optional_param('id', 0, PARAM_INT); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | } |
92 | 92 | // If user is not administrator nor moderator (user is steudent) and waiting is required. |
93 | 93 | if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) { |
94 | - header('Location: '.$bbbsession['logoutURL']); |
|
94 | + header('Location: ' . $bbbsession['logoutURL']); |
|
95 | 95 | break; |
96 | 96 | } |
97 | 97 | // As the meeting doesn't exist, try to create it. |
@@ -105,16 +105,16 @@ discard block |
||
105 | 105 | // The server is unreachable. |
106 | 106 | if ($bbbsession['administrator']) { |
107 | 107 | print_error('view_error_unable_join', 'bigbluebuttonbn', |
108 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
108 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
109 | 109 | break; |
110 | 110 | } |
111 | 111 | if ($bbbsession['moderator']) { |
112 | 112 | print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', |
113 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
113 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
114 | 114 | break; |
115 | 115 | } |
116 | 116 | print_error('view_error_unable_join_student', 'bigbluebuttonbn', |
117 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
117 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
118 | 118 | break; |
119 | 119 | } |
120 | 120 | if ($response['returncode'] == 'FAILED') { |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | // Moodle event logger: Create an event for meeting left. |
144 | 144 | bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_VIEWED, $bigbluebuttonbn, $cm, ['other' => $rid]); |
145 | 145 | // Execute the redirect. |
146 | - header('Location: '.urldecode($href)); |
|
146 | + header('Location: ' . urldecode($href)); |
|
147 | 147 | break; |
148 | 148 | default: |
149 | 149 | bigbluebutton_bbb_view_close_window(); |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | $data['welcome'] .= '<br><br>'; |
229 | 229 | $data['welcome'] .= str_replace( |
230 | 230 | '%duration%', |
231 | - (string) $durationtime, |
|
231 | + (string)$durationtime, |
|
232 | 232 | get_string('bbbdurationwarning', 'bigbluebuttonbn') |
233 | 233 | ); |
234 | 234 | } |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_UPDATE_CACHE); |
317 | 317 | if ($bbbsession['userlimit'] > 0 && intval($meetinginfo['participantCount']) >= $bbbsession['userlimit']) { |
318 | 318 | // No more users allowed to join. |
319 | - header('Location: '.$bbbsession['logoutURL']); |
|
319 | + header('Location: ' . $bbbsession['logoutURL']); |
|
320 | 320 | return; |
321 | 321 | } |
322 | 322 | // Build the URL. |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | bigbluebuttonbn_participant_joined($bbbsession['meetingid'], |
335 | 335 | ($bbbsession['administrator'] || $bbbsession['moderator'])); |
336 | 336 | // Execute the redirect. |
337 | - header('Location: '.$joinurl); |
|
337 | + header('Location: ' . $joinurl); |
|
338 | 338 | } |
339 | 339 | |
340 | 340 | /** |
@@ -346,13 +346,13 @@ discard block |
||
346 | 346 | */ |
347 | 347 | function bigbluebutton_bbb_view_errors($serrors, $id) { |
348 | 348 | global $CFG, $OUTPUT; |
349 | - $errors = (array) json_decode(urldecode($serrors)); |
|
349 | + $errors = (array)json_decode(urldecode($serrors)); |
|
350 | 350 | $msgerrors = ''; |
351 | 351 | foreach ($errors as $error) { |
352 | - $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger'))."\n"; |
|
352 | + $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger')) . "\n"; |
|
353 | 353 | } |
354 | 354 | echo $OUTPUT->header(); |
355 | 355 | print_error('view_error_bigbluebutton', 'bigbluebuttonbn', |
356 | - $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$id, $msgerrors, $serrors); |
|
356 | + $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $id, $msgerrors, $serrors); |
|
357 | 357 | echo $OUTPUT->footer(); |
358 | 358 | } |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | return $output; |
388 | 388 | } |
389 | 389 | $output .= $OUTPUT->box_start('box boxalignleft adminerror alert alert-' . $type . ' alert-block fade in', |
390 | - 'bigbluebuttonbn_view_general_warning')."\n"; |
|
390 | + 'bigbluebuttonbn_view_general_warning')."\n"; |
|
391 | 391 | $output .= ' <button type="button" class="close" data-dismiss="alert">×</button>'.$message."\n"; |
392 | 392 | $output .= ' <div class="singlebutton">'."\n"; |
393 | 393 | if (!empty($href)) { |
@@ -497,12 +497,12 @@ discard block |
||
497 | 497 | $recordings = bigbluebuttonbn_get_recordings( |
498 | 498 | $bbbsession['course']->id, $bigbluebuttonbnid, $showroom, |
499 | 499 | $bbbsession['bigbluebuttonbn']->recordings_deleted |
500 | - ); |
|
500 | + ); |
|
501 | 501 | } |
502 | 502 | // Get recording links. |
503 | 503 | $recordingsimported = bigbluebuttonbn_get_recordings_imported_array( |
504 | 504 | $bbbsession['course']->id, $bigbluebuttonbnid, $showroom |
505 | - ); |
|
505 | + ); |
|
506 | 506 | /* Perform aritmetic addition instead of merge so the imported recordings corresponding to existent |
507 | 507 | * recordings are not included. */ |
508 | 508 | $recordings += $recordingsimported; |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | // JavaScript variables for recordings. |
516 | 516 | $jsvars += array( |
517 | 517 | 'recordings_html' => $bbbsession['bigbluebuttonbn']->recordings_html == '1', |
518 | - ); |
|
518 | + ); |
|
519 | 519 | // If there are meetings with recordings load the data to the table. |
520 | 520 | if ($bbbsession['bigbluebuttonbn']->recordings_html) { |
521 | 521 | // Render a plain html table. |
@@ -525,7 +525,7 @@ discard block |
||
525 | 525 | $jsvars += array( |
526 | 526 | 'columns' => bigbluebuttonbn_get_recording_columns($bbbsession), |
527 | 527 | 'data' => bigbluebuttonbn_get_recording_data($bbbsession, $recordings), |
528 | - ); |
|
528 | + ); |
|
529 | 529 | // Render a YUI table. |
530 | 530 | return html_writer::div('', '', array('id' => 'bigbluebuttonbn_yui_table')); |
531 | 531 | } |
@@ -540,10 +540,10 @@ discard block |
||
540 | 540 | global $CFG; |
541 | 541 | $button = html_writer::tag('input', '', |
542 | 542 | array('type' => 'button', |
543 | - 'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'), |
|
544 | - 'class' => 'btn btn-secondary', |
|
545 | - 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='. |
|
546 | - $bbbsession['bigbluebuttonbn']->id.'\'')); |
|
543 | + 'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'), |
|
544 | + 'class' => 'btn btn-secondary', |
|
545 | + 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='. |
|
546 | + $bbbsession['bigbluebuttonbn']->id.'\'')); |
|
547 | 547 | $output = html_writer::start_tag('br'); |
548 | 548 | $output .= html_writer::tag('span', $button, array('id' => 'import_recording_links_button')); |
549 | 549 | $output .= html_writer::tag('span', '', array('id' => 'import_recording_links_table')); |
@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | * @author Fred Dixon (ffdixon [at] blindsidenetworks [dt] com) |
25 | 25 | */ |
26 | 26 | |
27 | -require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); |
|
28 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
27 | +require_once(dirname(dirname(dirname(__FILE__))) . '/config.php'); |
|
28 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
29 | 29 | |
30 | 30 | $id = required_param('id', PARAM_INT); |
31 | 31 | $bn = optional_param('n', 0, PARAM_INT); |
@@ -60,19 +60,19 @@ discard block |
||
60 | 60 | if (is_null($serverversion)) { |
61 | 61 | if ($bbbsession['administrator']) { |
62 | 62 | print_error('view_error_unable_join', 'bigbluebuttonbn', |
63 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
63 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
64 | 64 | exit; |
65 | 65 | } |
66 | 66 | if ($bbbsession['moderator']) { |
67 | 67 | print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', |
68 | - $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course); |
|
68 | + $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course); |
|
69 | 69 | exit; |
70 | 70 | } |
71 | 71 | print_error('view_error_unable_join_student', 'bigbluebuttonbn', |
72 | - $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course); |
|
72 | + $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course); |
|
73 | 73 | exit; |
74 | 74 | } |
75 | -$bbbsession['serverversion'] = (string) $serverversion; |
|
75 | +$bbbsession['serverversion'] = (string)$serverversion; |
|
76 | 76 | |
77 | 77 | // Mark viewed by user (if required). |
78 | 78 | $completion = new completion_info($course); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | // Print the page header. |
82 | 82 | $PAGE->set_context($context); |
83 | -$PAGE->set_url($CFG->wwwroot.'/mod/bigbluebuttonbn/view.php', array('id' => $cm->id)); |
|
83 | +$PAGE->set_url($CFG->wwwroot . '/mod/bigbluebuttonbn/view.php', array('id' => $cm->id)); |
|
84 | 84 | $PAGE->set_title(format_string($bigbluebuttonbn->name)); |
85 | 85 | $PAGE->set_cacheable(false); |
86 | 86 | $PAGE->set_heading($course->fullname); |
@@ -90,11 +90,11 @@ discard block |
||
90 | 90 | if (!has_capability('moodle/category:manage', $context) && !has_capability('mod/bigbluebuttonbn:join', $context)) { |
91 | 91 | echo $OUTPUT->header(); |
92 | 92 | if (isguestuser()) { |
93 | - echo $OUTPUT->confirm('<p>'.get_string('view_noguests', 'bigbluebuttonbn').'</p>'.get_string('liketologin'), |
|
94 | - get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id); |
|
93 | + echo $OUTPUT->confirm('<p>' . get_string('view_noguests', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'), |
|
94 | + get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id); |
|
95 | 95 | } else { |
96 | - echo $OUTPUT->confirm('<p>'.get_string('view_nojoin', 'bigbluebuttonbn').'</p>'.get_string('liketologin'), |
|
97 | - get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id); |
|
96 | + echo $OUTPUT->confirm('<p>' . get_string('view_nojoin', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'), |
|
97 | + get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id); |
|
98 | 98 | } |
99 | 99 | echo $OUTPUT->footer(); |
100 | 100 | exit; |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | |
103 | 103 | // Operation URLs. |
104 | 104 | $bbbsession['bigbluebuttonbnURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id; |
105 | -$bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id='.$id . |
|
105 | +$bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id=' . $id . |
|
106 | 106 | '&bn=' . $bbbsession['bigbluebuttonbn']->id; |
107 | 107 | $bbbsession['recordingReadyURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_broker.php?action=recording_' . |
108 | 108 | 'ready&bigbluebuttonbn=' . $bbbsession['bigbluebuttonbn']->id; |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | echo $OUTPUT->footer(); |
123 | 123 | |
124 | 124 | // Shows version as a comment. |
125 | -echo '<!-- '.$bbbsession['originTag'].' -->'."\n"; |
|
125 | +echo '<!-- ' . $bbbsession['originTag'] . ' -->' . "\n"; |
|
126 | 126 | |
127 | 127 | // Initialize session variable used across views. |
128 | 128 | $SESSION->bigbluebuttonbn_bbbsession = $bbbsession; |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | $bbbsession['modPW'] = $bbbsession['bigbluebuttonbn']->moderatorpass; |
153 | 153 | $bbbsession['viewerPW'] = $bbbsession['bigbluebuttonbn']->viewerpass; |
154 | 154 | // Database info related to the activity. |
155 | - $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'. |
|
155 | + $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' . |
|
156 | 156 | $bbbsession['bigbluebuttonbn']->id; |
157 | 157 | $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name; |
158 | 158 | $bbbsession['meetingdescription'] = $bbbsession['bigbluebuttonbn']->intro; |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | $bbbsession['welcome'] = get_string('mod_form_field_welcome_default', 'bigbluebuttonbn'); |
173 | 173 | } |
174 | 174 | if ($bbbsession['bigbluebuttonbn']->record) { |
175 | - $bbbsession['welcome'] .= '<br><br>'.get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
|
175 | + $bbbsession['welcome'] .= '<br><br>' . get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
|
176 | 176 | } |
177 | 177 | $bbbsession['openingtime'] = $bbbsession['bigbluebuttonbn']->openingtime; |
178 | 178 | $bbbsession['closingtime'] = $bbbsession['bigbluebuttonbn']->closingtime; |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | $bbbsession['originServerName'] = $parsedurl['host']; |
186 | 186 | $bbbsession['originServerUrl'] = $CFG->wwwroot; |
187 | 187 | $bbbsession['originServerCommonName'] = ''; |
188 | - $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn ('.get_config('mod_bigbluebuttonbn', 'version').')'; |
|
188 | + $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn (' . get_config('mod_bigbluebuttonbn', 'version') . ')'; |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | /** |
@@ -256,9 +256,9 @@ discard block |
||
256 | 256 | $groupname = groups_get_group_name($bbbsession['group']); |
257 | 257 | } |
258 | 258 | // Assign group default values. |
259 | - $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'. |
|
260 | - $bbbsession['bigbluebuttonbn']->id.'['.$bbbsession['group'].']'; |
|
261 | - $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name.' ('.$groupname.')'; |
|
259 | + $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' . |
|
260 | + $bbbsession['bigbluebuttonbn']->id . '[' . $bbbsession['group'] . ']'; |
|
261 | + $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name . ' (' . $groupname . ')'; |
|
262 | 262 | if (count($groups) == 0) { |
263 | 263 | // Only the All participants group exists. |
264 | 264 | bigbluebuttonbn_view_message_box($bbbsession, |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | return; |
271 | 271 | } |
272 | 272 | bigbluebuttonbn_view_message_box($bbbsession, get_string('view_groups_selection_warning', 'bigbluebuttonbn'), 'warning'); |
273 | - $urltoroot = $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bbbsession['cm']->id; |
|
273 | + $urltoroot = $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id; |
|
274 | 274 | groups_print_activity_menu($bbbsession['cm'], $urltoroot); |
275 | 275 | echo '<br><br>'; |
276 | 276 | } |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | * @param boolean $onlymoderator |
285 | 285 | * @return void |
286 | 286 | */ |
287 | -function bigbluebuttonbn_view_message_box(&$bbbsession, $message, $type='warning', $onlymoderator=false) { |
|
287 | +function bigbluebuttonbn_view_message_box(&$bbbsession, $message, $type = 'warning', $onlymoderator = false) { |
|
288 | 288 | global $OUTPUT; |
289 | 289 | if ($onlymoderator && !$bbbsession['moderator'] && !$bbbsession['administrator']) { |
290 | 290 | return; |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | 'locale' => bigbluebuttonbn_get_localcode(), 'profile_features' => $typeprofiles[0]['features']); |
318 | 318 | // Renders general warning when configured. |
319 | 319 | $cfg = \mod_bigbluebuttonbn\locallib\config::get_options(); |
320 | - $output = bigbluebuttonbn_view_render_warning( |
|
320 | + $output = bigbluebuttonbn_view_render_warning( |
|
321 | 321 | (string)$cfg['general_warning_message'], |
322 | 322 | (string)$cfg['general_warning_box_type'], |
323 | 323 | (string)$cfg['general_warning_button_href'], |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | $PAGE->requires->yui_module('moodle-mod_bigbluebuttonbn-recordings', |
336 | 336 | 'M.mod_bigbluebuttonbn.recordings.init', array($jsvars)); |
337 | 337 | } |
338 | - echo $output.html_writer::empty_tag('br').html_writer::empty_tag('br').html_writer::empty_tag('br'); |
|
338 | + echo $output . html_writer::empty_tag('br') . html_writer::empty_tag('br') . html_writer::empty_tag('br'); |
|
339 | 339 | $PAGE->requires->yui_module('moodle-mod_bigbluebuttonbn-broker', 'M.mod_bigbluebuttonbn.broker.init', array($jsvars)); |
340 | 340 | } |
341 | 341 | |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | * @param string $class |
380 | 380 | * @return string |
381 | 381 | */ |
382 | -function bigbluebuttonbn_view_render_warning($message, $type='info', $href='', $text='', $class='') { |
|
382 | +function bigbluebuttonbn_view_render_warning($message, $type = 'info', $href = '', $text = '', $class = '') { |
|
383 | 383 | global $OUTPUT; |
384 | 384 | $output = "\n"; |
385 | 385 | // Evaluates if config_warning is enabled. |
@@ -387,14 +387,14 @@ discard block |
||
387 | 387 | return $output; |
388 | 388 | } |
389 | 389 | $output .= $OUTPUT->box_start('box boxalignleft adminerror alert alert-' . $type . ' alert-block fade in', |
390 | - 'bigbluebuttonbn_view_general_warning')."\n"; |
|
391 | - $output .= ' <button type="button" class="close" data-dismiss="alert">×</button>'.$message."\n"; |
|
392 | - $output .= ' <div class="singlebutton">'."\n"; |
|
390 | + 'bigbluebuttonbn_view_general_warning') . "\n"; |
|
391 | + $output .= ' <button type="button" class="close" data-dismiss="alert">×</button>' . $message . "\n"; |
|
392 | + $output .= ' <div class="singlebutton">' . "\n"; |
|
393 | 393 | if (!empty($href)) { |
394 | 394 | $output .= bigbluebuttonbn_view_render_warning_button($href, $text, $class); |
395 | 395 | } |
396 | - $output .= ' </div>'."\n"; |
|
397 | - $output .= $OUTPUT->box_end()."\n"; |
|
396 | + $output .= ' </div>' . "\n"; |
|
397 | + $output .= $OUTPUT->box_end() . "\n"; |
|
398 | 398 | return $output; |
399 | 399 | } |
400 | 400 | |
@@ -413,11 +413,11 @@ discard block |
||
413 | 413 | if ($class == '') { |
414 | 414 | $class = 'btn btn-secondary'; |
415 | 415 | } |
416 | - $output = ' <form method="post" action="' . $href . '" class="form-inline">'."\n"; |
|
417 | - $output .= ' <button type="submit" class="' . $class . '"'."\n"; |
|
418 | - $output .= ' title=""'."\n"; |
|
419 | - $output .= ' >' . $text . '</button>'."\n"; |
|
420 | - $output .= ' </form>'."\n"; |
|
416 | + $output = ' <form method="post" action="' . $href . '" class="form-inline">' . "\n"; |
|
417 | + $output .= ' <button type="submit" class="' . $class . '"' . "\n"; |
|
418 | + $output .= ' title=""' . "\n"; |
|
419 | + $output .= ' >' . $text . '</button>' . "\n"; |
|
420 | + $output .= ' </form>' . "\n"; |
|
421 | 421 | return $output; |
422 | 422 | } |
423 | 423 | |
@@ -434,12 +434,12 @@ discard block |
||
434 | 434 | // JavaScript variables for room. |
435 | 435 | $openingtime = ''; |
436 | 436 | if ($bbbsession['openingtime']) { |
437 | - $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn').': '. |
|
437 | + $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn') . ': ' . |
|
438 | 438 | userdate($bbbsession['openingtime']); |
439 | 439 | } |
440 | 440 | $closingtime = ''; |
441 | 441 | if ($bbbsession['closingtime']) { |
442 | - $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn').': '. |
|
442 | + $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn') . ': ' . |
|
443 | 443 | userdate($bbbsession['closingtime']); |
444 | 444 | } |
445 | 445 | $jsvars += array( |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | $output .= $OUTPUT->box_end(); |
457 | 457 | // Action button box. |
458 | 458 | $output .= $OUTPUT->box_start('generalbox boxaligncenter', 'bigbluebuttonbn_view_action_button_box'); |
459 | - $output .= '<br><br><span id="join_button"></span> <span id="end_button"></span>'."\n"; |
|
459 | + $output .= '<br><br><span id="join_button"></span> <span id="end_button"></span>' . "\n"; |
|
460 | 460 | $output .= $OUTPUT->box_end(); |
461 | 461 | if ($activity == 'ended') { |
462 | 462 | $output .= bigbluebuttonbn_view_ended($bbbsession); |
@@ -493,7 +493,7 @@ discard block |
||
493 | 493 | } |
494 | 494 | // Get recordings. |
495 | 495 | $recordings = array(); |
496 | - if ( bigbluebuttonbn_view_include_recordings($bbbsession) ) { |
|
496 | + if (bigbluebuttonbn_view_include_recordings($bbbsession)) { |
|
497 | 497 | $recordings = bigbluebuttonbn_get_recordings( |
498 | 498 | $bbbsession['course']->id, $bigbluebuttonbnid, $showroom, |
499 | 499 | $bbbsession['bigbluebuttonbn']->recordings_deleted |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | // If there are meetings with recordings load the data to the table. |
520 | 520 | if ($bbbsession['bigbluebuttonbn']->recordings_html) { |
521 | 521 | // Render a plain html table. |
522 | - return bigbluebutton_output_recording_table($bbbsession, $recordings)."\n"; |
|
522 | + return bigbluebutton_output_recording_table($bbbsession, $recordings) . "\n"; |
|
523 | 523 | } |
524 | 524 | // JavaScript variables for recordings with YUI. |
525 | 525 | $jsvars += array( |
@@ -542,8 +542,8 @@ discard block |
||
542 | 542 | array('type' => 'button', |
543 | 543 | 'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'), |
544 | 544 | 'class' => 'btn btn-secondary', |
545 | - 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='. |
|
546 | - $bbbsession['bigbluebuttonbn']->id.'\'')); |
|
545 | + 'onclick' => 'window.location=\'' . $CFG->wwwroot . '/mod/bigbluebuttonbn/import_view.php?bn=' . |
|
546 | + $bbbsession['bigbluebuttonbn']->id . '\'')); |
|
547 | 547 | $output = html_writer::start_tag('br'); |
548 | 548 | $output .= html_writer::tag('span', $button, array('id' => 'import_recording_links_button')); |
549 | 549 | $output .= html_writer::tag('span', '', array('id' => 'import_recording_links_table')); |
@@ -561,10 +561,10 @@ discard block |
||
561 | 561 | if (!is_null($bbbsession['presentation']['url'])) { |
562 | 562 | $attributes = array('title' => $bbbsession['presentation']['name']); |
563 | 563 | $icon = new pix_icon($bbbsession['presentation']['icon'], $bbbsession['presentation']['mimetype_description']); |
564 | - return '<h4>'.get_string('view_section_title_presentation', 'bigbluebuttonbn').'</h4>'. |
|
565 | - $OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false). |
|
564 | + return '<h4>' . get_string('view_section_title_presentation', 'bigbluebuttonbn') . '</h4>' . |
|
565 | + $OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false) . |
|
566 | 566 | $OUTPUT->action_link($bbbsession['presentation']['url'], |
567 | - $bbbsession['presentation']['name'], null, $attributes).'<br><br>'; |
|
567 | + $bbbsession['presentation']['name'], null, $attributes) . '<br><br>'; |
|
568 | 568 | } |
569 | 569 | return ''; |
570 | 570 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | public static function notification_process($context, $bigbluebuttonbn, $action) { |
48 | 48 | global $USER; |
49 | 49 | // Prepare message. |
50 | - $msg = (object) array(); |
|
50 | + $msg = (object)array(); |
|
51 | 51 | // Build the message_body. |
52 | 52 | $msg->action = $action; |
53 | 53 | $msg->activity_type = ''; |
@@ -72,26 +72,26 @@ discard block |
||
72 | 72 | * @return string |
73 | 73 | */ |
74 | 74 | public static function notification_msg_html($msg) { |
75 | - $messagetext = '<p>'.$msg->activity_type.' "'.$msg->activity_title.'" '. |
|
76 | - get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn').' '.$msg->action.'.</p>'."\n"; |
|
77 | - $messagetext .= '<p><b>'.$msg->activity_title.'</b> '. |
|
78 | - get_string('email_body_notification_meeting_details', 'bigbluebuttonbn').':'."\n"; |
|
79 | - $messagetext .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>'."\n"; |
|
80 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'. |
|
81 | - get_string('email_body_notification_meeting_title', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
82 | - $messagetext .= $msg->activity_title.'</td></tr>'."\n"; |
|
83 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'. |
|
84 | - get_string('email_body_notification_meeting_description', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
85 | - $messagetext .= $msg->activity_description.'</td></tr>'."\n"; |
|
86 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'. |
|
87 | - get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
88 | - $messagetext .= $msg->activity_openingtime.'</td></tr>'."\n"; |
|
89 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'. |
|
90 | - get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
91 | - $messagetext .= $msg->activity_closingtime.'</td></tr>'."\n"; |
|
92 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.$msg->action.' '. |
|
93 | - get_string('email_body_notification_meeting_by', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
94 | - $messagetext .= $msg->activity_owner.'</td></tr></tbody></table></p>'."\n"; |
|
75 | + $messagetext = '<p>' . $msg->activity_type . ' "' . $msg->activity_title . '" ' . |
|
76 | + get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn') . ' ' . $msg->action . '.</p>' . "\n"; |
|
77 | + $messagetext .= '<p><b>' . $msg->activity_title . '</b> ' . |
|
78 | + get_string('email_body_notification_meeting_details', 'bigbluebuttonbn') . ':' . "\n"; |
|
79 | + $messagetext .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>' . "\n"; |
|
80 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . |
|
81 | + get_string('email_body_notification_meeting_title', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
82 | + $messagetext .= $msg->activity_title . '</td></tr>' . "\n"; |
|
83 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . |
|
84 | + get_string('email_body_notification_meeting_description', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
85 | + $messagetext .= $msg->activity_description . '</td></tr>' . "\n"; |
|
86 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . |
|
87 | + get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
88 | + $messagetext .= $msg->activity_openingtime . '</td></tr>' . "\n"; |
|
89 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . |
|
90 | + get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
91 | + $messagetext .= $msg->activity_closingtime . '</td></tr>' . "\n"; |
|
92 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . $msg->action . ' ' . |
|
93 | + get_string('email_body_notification_meeting_by', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
94 | + $messagetext .= $msg->activity_owner . '</td></tr></tbody></table></p>' . "\n"; |
|
95 | 95 | return $messagetext; |
96 | 96 | } |
97 | 97 | |
@@ -108,14 +108,14 @@ discard block |
||
108 | 108 | global $DB; |
109 | 109 | $course = $DB->get_record('course', array('id' => $bigbluebuttonbn->course), '*', MUST_EXIST); |
110 | 110 | // Complete message. |
111 | - $msg = (object) array(); |
|
111 | + $msg = (object)array(); |
|
112 | 112 | $msg->user_name = fullname($sender); |
113 | 113 | $msg->user_email = $sender->email; |
114 | 114 | $msg->course_name = "$course->fullname"; |
115 | - $message .= '<p><hr/><br/>'.get_string('email_footer_sent_by', 'bigbluebuttonbn').' '. |
|
116 | - $msg->user_name.'('.$msg->user_email.') '; |
|
117 | - $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn').' '.$msg->course_name.'.</p>'; |
|
118 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
115 | + $message .= '<p><hr/><br/>' . get_string('email_footer_sent_by', 'bigbluebuttonbn') . ' ' . |
|
116 | + $msg->user_name . '(' . $msg->user_email . ') '; |
|
117 | + $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn') . ' ' . $msg->course_name . '.</p>'; |
|
118 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
119 | 119 | foreach ($users as $user) { |
120 | 120 | if ($user->id != $sender->id) { |
121 | 121 | message_post_message($sender, $user, $message, FORMAT_HTML); |
@@ -38,9 +38,9 @@ |
||
38 | 38 | */ |
39 | 39 | class renderer { |
40 | 40 | |
41 | - /** |
|
42 | - * @var $settings stores the settings as they come from settings.php |
|
43 | - */ |
|
41 | + /** |
|
42 | + * @var $settings stores the settings as they come from settings.php |
|
43 | + */ |
|
44 | 44 | private $settings; |
45 | 45 | |
46 | 46 | /** |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | defined('MOODLE_INTERNAL') || die(); |
29 | 29 | |
30 | 30 | require_once($CFG->dirroot . '/mod/bigbluebuttonbn/locallib.php'); |
31 | -require_once($CFG->libdir.'/adminlib.php'); |
|
31 | +require_once($CFG->libdir . '/adminlib.php'); |
|
32 | 32 | |
33 | 33 | /** |
34 | 34 | * Helper class for rendering HTML for settings.php. |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $itemname = get_string('config_' . $name, 'bigbluebuttonbn'); |
67 | 67 | } |
68 | 68 | if ($itemdescription == null) { |
69 | - $itemdescription = get_string('config_' .$name . '_description', 'bigbluebuttonbn'); |
|
69 | + $itemdescription = get_string('config_' . $name . '_description', 'bigbluebuttonbn'); |
|
70 | 70 | } |
71 | 71 | $item = new \admin_setting_heading('bigbluebuttonbn_config_' . $name, $itemname, $itemdescription); |
72 | 72 | $this->settings->add($item); |
@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | * @author Fred Dixon (ffdixon [at] blindsidenetworks [dt] com) |
25 | 25 | */ |
26 | 26 | |
27 | -require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); |
|
28 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
27 | +require_once(dirname(dirname(dirname(__FILE__))) . '/config.php'); |
|
28 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
29 | 29 | |
30 | 30 | $id = required_param('id', PARAM_INT); |
31 | 31 | $a = optional_param('a', 0, PARAM_INT); |
@@ -88,12 +88,12 @@ discard block |
||
88 | 88 | if ($moderator || $administrator) { |
89 | 89 | bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_ENDED, $bigbluebuttonbn, $cm); |
90 | 90 | echo get_string('index_ending', 'bigbluebuttonbn'); |
91 | - $meetingid = $bigbluebuttonbn->meetingid.'-'.$course->id.'-'.$bigbluebuttonbn->id; |
|
91 | + $meetingid = $bigbluebuttonbn->meetingid . '-' . $course->id . '-' . $bigbluebuttonbn->id; |
|
92 | 92 | if ($g != '0') { |
93 | - $meetingid .= '['.$g.']'; |
|
93 | + $meetingid .= '[' . $g . ']'; |
|
94 | 94 | } |
95 | 95 | bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getEndMeetingURL($meetingid)); |
96 | - redirect('index.php?id='.$id); |
|
96 | + redirect('index.php?id=' . $id); |
|
97 | 97 | } |
98 | 98 | } |
99 | 99 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | // Add a the data for the bigbluebuttonbn instance. |
108 | 108 | $groupobj = null; |
109 | 109 | if (groups_get_activity_groupmode($cm) > 0) { |
110 | - $groupobj = (object) array('id' => 0, 'name' => get_string('allparticipants')); |
|
110 | + $groupobj = (object)array('id' => 0, 'name' => get_string('allparticipants')); |
|
111 | 111 | } |
112 | 112 | $table->data[] = bigbluebuttonbn_index_display_room($canmoderate, $course, $bigbluebuttonbn, $groupobj); |
113 | 113 | // Add a the data for the groups belonging to the bigbluebuttonbn instance, if any. |
@@ -133,12 +133,12 @@ discard block |
||
133 | 133 | * @return array |
134 | 134 | */ |
135 | 135 | function bigbluebuttonbn_index_display_room($moderator, $course, $bigbluebuttonbn, $groupobj = null) { |
136 | - $meetingid = $bigbluebuttonbn->meetingid.'-'.$course->id.'-'.$bigbluebuttonbn->id; |
|
136 | + $meetingid = $bigbluebuttonbn->meetingid . '-' . $course->id . '-' . $bigbluebuttonbn->id; |
|
137 | 137 | $paramgroup = ''; |
138 | 138 | $groupname = ''; |
139 | 139 | if ($groupobj) { |
140 | - $meetingid .= '['.$groupobj->id.']'; |
|
141 | - $paramgroup = '&group='.$groupobj->id; |
|
140 | + $meetingid .= '[' . $groupobj->id . ']'; |
|
141 | + $paramgroup = '&group=' . $groupobj->id; |
|
142 | 142 | $groupname = $groupobj->name; |
143 | 143 | } |
144 | 144 | $meetinginfo = bigbluebuttonbn_get_meeting_info_array($meetingid); |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | return; |
154 | 154 | } |
155 | 155 | // Output Users in the meeting. |
156 | - $joinurl = '<a href="view.php?id='.$bigbluebuttonbn->coursemodule.$paramgroup.'">'.format_string($bigbluebuttonbn->name).'</a>'; |
|
156 | + $joinurl = '<a href="view.php?id=' . $bigbluebuttonbn->coursemodule . $paramgroup . '">' . format_string($bigbluebuttonbn->name) . '</a>'; |
|
157 | 157 | $group = $groupname; |
158 | 158 | $users = ''; |
159 | 159 | $viewerlist = ''; |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | $attendeecount = 0; |
199 | 199 | foreach ($meetinginfo['attendees']->attendee as $attendee) { |
200 | 200 | if ($attendee->role == $role) { |
201 | - $attendeelist .= ($attendeecount++ > 0 ? ', ' : '').$attendee->fullName; |
|
201 | + $attendeelist .= ($attendeecount++ > 0 ? ', ' : '') . $attendee->fullName; |
|
202 | 202 | } |
203 | 203 | } |
204 | 204 | } |
@@ -232,15 +232,15 @@ discard block |
||
232 | 232 | function bigbluebuttonbn_index_display_room_actions($moderator, $course, $bigbluebuttonbn, $groupobj = null) { |
233 | 233 | $actions = ''; |
234 | 234 | if ($moderator) { |
235 | - $actions .= '<form name="form1" method="post" action="">'.'/n'; |
|
236 | - $actions .= ' <INPUT type="hidden" name="id" value="'.$course->id.'">'.'/n'; |
|
237 | - $actions .= ' <INPUT type="hidden" name="a" value="'.$bigbluebuttonbn->id.'">'.'/n'; |
|
235 | + $actions .= '<form name="form1" method="post" action="">' . '/n'; |
|
236 | + $actions .= ' <INPUT type="hidden" name="id" value="' . $course->id . '">' . '/n'; |
|
237 | + $actions .= ' <INPUT type="hidden" name="a" value="' . $bigbluebuttonbn->id . '">' . '/n'; |
|
238 | 238 | if ($groupobj != null) { |
239 | - $actions .= ' <INPUT type="hidden" name="g" value="'.$groupobj->id.'">'.'/n'; |
|
239 | + $actions .= ' <INPUT type="hidden" name="g" value="' . $groupobj->id . '">' . '/n'; |
|
240 | 240 | } |
241 | - $actions .= ' <INPUT type="submit" name="submit" value="end" onclick="return confirm(\''. |
|
242 | - get_string('index_confirm_end', 'bigbluebuttonbn').'\')">'.'/n'; |
|
243 | - $actions .= '</form>'.'/n'; |
|
241 | + $actions .= ' <INPUT type="submit" name="submit" value="end" onclick="return confirm(\'' . |
|
242 | + get_string('index_confirm_end', 'bigbluebuttonbn') . '\')">' . '/n'; |
|
243 | + $actions .= '</form>' . '/n'; |
|
244 | 244 | } |
245 | 245 | return $actions; |
246 | 246 | } |