@@ -26,8 +26,8 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | defined('MOODLE_INTERNAL') || die(); |
| 28 | 28 | |
| 29 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
| 30 | -require_once($CFG->dirroot.'/course/moodleform_mod.php'); |
|
| 29 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
| 30 | +require_once($CFG->dirroot . '/course/moodleform_mod.php'); |
|
| 31 | 31 | |
| 32 | 32 | class mod_bigbluebuttonbn_mod_form extends moodleform_mod { |
| 33 | 33 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $serverversion = bigbluebuttonbn_get_server_version(); |
| 38 | 38 | if (is_null($serverversion)) { |
| 39 | 39 | print_error('general_error_unable_connect', 'bigbluebuttonbn', |
| 40 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 40 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 41 | 41 | return; |
| 42 | 42 | } |
| 43 | 43 | // Context. |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | ); |
| 111 | 111 | $defaultvalues['presentation'] = $draftitemid; |
| 112 | 112 | } catch (Exception $e) { |
| 113 | - debugging('Presentation could not be loaded: '.$e->getMessage(), DEBUG_DEVELOPER); |
|
| 113 | + debugging('Presentation could not be loaded: ' . $e->getMessage(), DEBUG_DEVELOPER); |
|
| 114 | 114 | return null; |
| 115 | 115 | } |
| 116 | 116 | } |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | return; |
| 326 | 326 | } |
| 327 | 327 | $mform->addElement($type, $name, get_string($descriptionkey, 'bigbluebuttonbn'), $options); |
| 328 | - if (get_string_manager()->string_exists($descriptionkey.'_help', 'bigbluebuttonbn')) { |
|
| 328 | + if (get_string_manager()->string_exists($descriptionkey . '_help', 'bigbluebuttonbn')) { |
|
| 329 | 329 | $mform->addHelpButton($name, $descriptionkey, 'bigbluebuttonbn'); |
| 330 | 330 | } |
| 331 | 331 | if (!empty($rule)) { |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | 'alt' => $contents, |
| 94 | 94 | 'title' => $contents, |
| 95 | 95 | 'src' => $jsvars['pix_icon_delete'] |
| 96 | - ); |
|
| 96 | + ); |
|
| 97 | 97 | $jsvars['pix_icon_delete'] = html_writer::tag('img', '', $options); |
| 98 | 98 | } |
| 99 | 99 | $PAGE->requires->yui_module('moodle-mod_bigbluebuttonbn-modform', |
@@ -189,8 +189,8 @@ discard block |
||
| 189 | 189 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
| 190 | 190 | $field['description_key'], 0, ['maxlength' => 4, 'size' => 6], |
| 191 | 191 | ['message' => get_string('mod_form_field_voicebridge_format_error', 'bigbluebuttonbn'), |
| 192 | - 'type' => 'numeric', 'rule' => '####', 'validator' => 'server'] |
|
| 193 | - ); |
|
| 192 | + 'type' => 'numeric', 'rule' => '####', 'validator' => 'server'] |
|
| 193 | + ); |
|
| 194 | 194 | } else { |
| 195 | 195 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
| 196 | 196 | $field['description_key'], 0, ['maxlength' => 4, 'size' => 6]); |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | */ |
| 225 | 225 | private function bigbluebuttonbn_mform_add_block_room_recordings($mform, $cfg) { |
| 226 | 226 | $field = ['type' => 'hidden', 'name' => 'recordings_html', 'data_type' => PARAM_INT, |
| 227 | - 'description_key' => null]; |
|
| 227 | + 'description_key' => null]; |
|
| 228 | 228 | if ($cfg['recordings_html_editable']) { |
| 229 | 229 | $field['type'] = 'checkbox'; |
| 230 | 230 | $field['description_key'] = 'mod_form_field_recordings_html'; |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | $field['description_key'], $cfg['recordings_html_default']); |
| 234 | 234 | |
| 235 | 235 | $field = ['type' => 'hidden', 'name' => 'recordings_deleted', 'data_type' => PARAM_INT, |
| 236 | - 'description_key' => null]; |
|
| 236 | + 'description_key' => null]; |
|
| 237 | 237 | if ($cfg['recordings_deleted_editable']) { |
| 238 | 238 | $field['type'] = 'checkbox'; |
| 239 | 239 | $field['description_key'] = 'mod_form_field_recordings_deleted'; |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | $field['description_key'], $cfg['recordings_deleted_default']); |
| 243 | 243 | |
| 244 | 244 | $field = ['type' => 'hidden', 'name' => 'recordings_imported', 'data_type' => PARAM_INT, |
| 245 | - 'description_key' => null]; |
|
| 245 | + 'description_key' => null]; |
|
| 246 | 246 | if ($cfg['recordings_imported_editable']) { |
| 247 | 247 | $field['type'] = 'checkbox'; |
| 248 | 248 | $field['description_key'] = 'mod_form_field_recordings_imported'; |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | $htmlselectiontype = html_writer::select($participantselection['type_options'], |
| 300 | 300 | 'bigbluebuttonbn_participant_selection_type', $participantselection['type_selected'], array(), |
| 301 | 301 | array('id' => 'bigbluebuttonbn_participant_selection_type', |
| 302 | - 'onchange' => 'M.mod_bigbluebuttonbn.modform.participantSelectionSet(); return 0;')); |
|
| 302 | + 'onchange' => 'M.mod_bigbluebuttonbn.modform.participantSelectionSet(); return 0;')); |
|
| 303 | 303 | $htmlselectionoptions = html_writer::select($participantselection['options'], 'bigbluebuttonbn_participant_selection', |
| 304 | 304 | $participantselection['selected'], array(), |
| 305 | 305 | array('id' => 'bigbluebuttonbn_participant_selection', 'disabled' => 'disabled')); |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | 'type' => 'button', 'class' => 'btn btn-secondary', |
| 308 | 308 | 'value' => get_string('mod_form_field_participant_list_action_add', 'bigbluebuttonbn'), |
| 309 | 309 | 'onclick' => 'M.mod_bigbluebuttonbn.modform.participantAdd(); return 0;' |
| 310 | - )); |
|
| 310 | + )); |
|
| 311 | 311 | $htmladdparticipant = html_writer::tag('div', |
| 312 | 312 | $htmlselectiontype . ' ' . $htmlselectionoptions . ' ' . $htmlselectioninput, null); |
| 313 | 313 | $mform->addElement('html', "\n\n"); |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | * are 1=checked, 0=unchecked. |
| 68 | 68 | **/ |
| 69 | 69 | |
| 70 | - /* When the value is set to 0 (unchecked) the all the features for recordings |
|
| 70 | + /* When the value is set to 0 (unchecked) the all the features for recordings |
|
| 71 | 71 | * are ignored. Recording features are enabled by default. |
| 72 | 72 | * $CFG->bigbluebuttonbn['recordings_enabled'] = 1; |
| 73 | 73 | */ |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | * recordings from a different activity even from a different course. |
| 98 | 98 | **/ |
| 99 | 99 | |
| 100 | - /* |
|
| 100 | + /* |
|
| 101 | 101 | * When the value is set to 1 (checked) the bigbluebuttonbn rooms or |
| 102 | 102 | * activities will have the 'import recordings' capability enabled. |
| 103 | 103 | * $CFG->bigbluebuttonbn['importrecordings_enabled'] = 0; |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | * 'Join session' button enabled |
| 119 | 119 | **/ |
| 120 | 120 | |
| 121 | - /* |
|
| 121 | + /* |
|
| 122 | 122 | * When the value is set to 1 (checked) the bigbluebuttonbn rooms or |
| 123 | 123 | * activities will have the 'wait for moderator' capability enabled by |
| 124 | 124 | * default. |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | * 5. CONFIGURATION FOR "STATIC VOICE BRIDGE" FEATURE |
| 153 | 153 | * |
| 154 | 154 | **/ |
| 155 | - /* |
|
| 155 | + /* |
|
| 156 | 156 | * A conference voice bridge number can be permanently assigned to a room |
| 157 | 157 | * or activity. |
| 158 | 158 | * $CFG->bigbluebuttonbn['voicebridge_editable'] = 0; |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | * 6. CONFIGURATION FOR "PRE-UPLOAD PRESENTATION" FEATURE |
| 163 | 163 | * |
| 164 | 164 | **/ |
| 165 | - /* |
|
| 165 | + /* |
|
| 166 | 166 | * Since version 0.8, BigBluebutton has an implementation for allowing |
| 167 | 167 | * preuploading presentation. When this feature is enabled, users creating or |
| 168 | 168 | * editing a room or activity can upload a PDF or Office document to the |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | * applied to each room or activity, or globally. |
| 180 | 180 | **/ |
| 181 | 181 | |
| 182 | - /* |
|
| 182 | + /* |
|
| 183 | 183 | * The number of users allowed in a session by default when a new room or |
| 184 | 184 | * conference is added. If the number is set to 0, no limit is established. |
| 185 | 185 | * $CFG->bigbluebuttonbn['userlimit_default'] = 0; |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | * By default only the owner is assigned. |
| 201 | 201 | **/ |
| 202 | 202 | |
| 203 | - /* |
|
| 203 | + /* |
|
| 204 | 204 | * The values for this parameter can be '0' (which identifies the owner) and/or any of the role IDs defined in |
| 205 | 205 | * Moodle (including the custom parameters). The value used will be the key for the role. |
| 206 | 206 | * [owner=0|manager=1|coursecreator=2|editingteacher=3|teacher=4|student=5|guest=6|user=7|frontpage=8|ANY_CUSTOM_ROLE=xx] |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | * 9. CONFIGURATION FOR "NOTIFICATION SENDING" FEATURE |
| 212 | 212 | * |
| 213 | 213 | **/ |
| 214 | - /* |
|
| 214 | + /* |
|
| 215 | 215 | * When the value is set to 1 (checked) the 'notification sending' |
| 216 | 216 | * capability can be used by the user creating or editing the room or |
| 217 | 217 | * activity. |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | * 10. CONFIGURATION FOR "RECORDING READY" FEATURE |
| 226 | 226 | * |
| 227 | 227 | **/ |
| 228 | - /* |
|
| 228 | + /* |
|
| 229 | 229 | * When the value is set to 1 (checked) the 'notify users when recording ready' |
| 230 | 230 | * capability is enabled, meaning that a message will be sent to all enrolled |
| 231 | 231 | * users in a course when a recording is ready |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | * 12. GENERAL CONFIGURATION FOR RECORDINGS UI |
| 250 | 250 | * |
| 251 | 251 | **/ |
| 252 | - /* |
|
| 252 | + /* |
|
| 253 | 253 | * When the value is set to 1 (checked) the bigbluebuttonbn resources |
| 254 | 254 | * will show the recodings in an html table by default. |
| 255 | 255 | * $CFG->bigbluebuttonbn['recordings_html_default'] = 0; |
@@ -273,22 +273,22 @@ discard block |
||
| 273 | 273 | * $CFG->bigbluebuttonbn['recordings_deleted_editable'] = 0; |
| 274 | 274 | */ |
| 275 | 275 | |
| 276 | - /* |
|
| 276 | + /* |
|
| 277 | 277 | * When the value is set to 1 (checked) the bigbluebuttonbn resources for recordings |
| 278 | 278 | * will show only the imported links as part of the list. |
| 279 | 279 | * $CFG->bigbluebuttonbn['recordings_imported_default'] = 0; |
| 280 | 280 | */ |
| 281 | 281 | |
| 282 | - /* |
|
| 282 | + /* |
|
| 283 | 283 | * When the value is set to 1 (checked) the 'show only imported links' |
| 284 | 284 | * capability can be enabled/disabled by the user creating or editing the resource for recordings. |
| 285 | 285 | * $CFG->bigbluebuttonbn['recordings_imported_editable'] = 1; |
| 286 | 286 | */ |
| 287 | 287 | |
| 288 | - /* |
|
| 288 | + /* |
|
| 289 | 289 | * CONFIGURATION FOR FEATURES OFFERED BY BN SERVERS |
| 290 | 290 | ** ------------------------------------------------------------------ **/ |
| 291 | - /* |
|
| 291 | + /* |
|
| 292 | 292 | * When general_warning_message value is different than "", the string is shown |
| 293 | 293 | * as a warning message to privileged users (administrators and Teachers or users allowed to edit). |
| 294 | 294 | * $CFG->bigbluebuttonbn['general_warning_message'] = "This will may have recordings enabled when upgraded to premium."; |
@@ -94,9 +94,9 @@ discard block |
||
| 94 | 94 | */ |
| 95 | 95 | function bigbluebuttonbn_get_join_url($meetingid, $username, $pw, $logouturl, $configtoken = null, $userid = null) { |
| 96 | 96 | $data = ['meetingID' => $meetingid, |
| 97 | - 'fullName' => $username, |
|
| 98 | - 'password' => $pw, |
|
| 99 | - 'logoutURL' => $logouturl, |
|
| 97 | + 'fullName' => $username, |
|
| 98 | + 'password' => $pw, |
|
| 99 | + 'logoutURL' => $logouturl, |
|
| 100 | 100 | ]; |
| 101 | 101 | if (!is_null($configtoken)) { |
| 102 | 102 | $data['configToken'] = $configtoken; |
@@ -140,23 +140,23 @@ discard block |
||
| 140 | 140 | function bigbluebuttonbn_get_meeting_info_array($meetingid) { |
| 141 | 141 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 142 | 142 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
| 143 | - ); |
|
| 143 | + ); |
|
| 144 | 144 | if ($xml && $xml->returncode == 'SUCCESS' && empty($xml->messageKey)) { |
| 145 | 145 | // Meeting info was returned. |
| 146 | 146 | return array('returncode' => $xml->returncode, |
| 147 | - 'meetingID' => $xml->meetingID, |
|
| 148 | - 'moderatorPW' => $xml->moderatorPW, |
|
| 149 | - 'attendeePW' => $xml->attendeePW, |
|
| 150 | - 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded, |
|
| 151 | - 'running' => $xml->running, |
|
| 152 | - 'recording' => $xml->recording, |
|
| 153 | - 'startTime' => $xml->startTime, |
|
| 154 | - 'endTime' => $xml->endTime, |
|
| 155 | - 'participantCount' => $xml->participantCount, |
|
| 156 | - 'moderatorCount' => $xml->moderatorCount, |
|
| 157 | - 'attendees' => $xml->attendees, |
|
| 158 | - 'metadata' => $xml->metadata, |
|
| 159 | - ); |
|
| 147 | + 'meetingID' => $xml->meetingID, |
|
| 148 | + 'moderatorPW' => $xml->moderatorPW, |
|
| 149 | + 'attendeePW' => $xml->attendeePW, |
|
| 150 | + 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded, |
|
| 151 | + 'running' => $xml->running, |
|
| 152 | + 'recording' => $xml->recording, |
|
| 153 | + 'startTime' => $xml->startTime, |
|
| 154 | + 'endTime' => $xml->endTime, |
|
| 155 | + 'participantCount' => $xml->participantCount, |
|
| 156 | + 'moderatorCount' => $xml->moderatorCount, |
|
| 157 | + 'attendees' => $xml->attendees, |
|
| 158 | + 'metadata' => $xml->metadata, |
|
| 159 | + ); |
|
| 160 | 160 | } |
| 161 | 161 | if ($xml) { |
| 162 | 162 | // Either failure or success without meeting info. |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | function bigbluebuttonbn_get_default_config_xml() { |
| 279 | 279 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 280 | 280 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getDefaultConfigXML') |
| 281 | - ); |
|
| 281 | + ); |
|
| 282 | 282 | return $xml; |
| 283 | 283 | } |
| 284 | 284 | |
@@ -347,7 +347,7 @@ discard block |
||
| 347 | 347 | foreach ($ids as $id) { |
| 348 | 348 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 349 | 349 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('deleteRecordings', ['recordID' => $id]) |
| 350 | - ); |
|
| 350 | + ); |
|
| 351 | 351 | if ($xml && $xml->returncode != 'SUCCESS') { |
| 352 | 352 | return false; |
| 353 | 353 | } |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | foreach ($ids as $id) { |
| 365 | 365 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 366 | 366 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('publishRecordings', ['recordID' => $id, 'publish' => $publish]) |
| 367 | - ); |
|
| 367 | + ); |
|
| 368 | 368 | if ($xml && $xml->returncode != 'SUCCESS') { |
| 369 | 369 | return false; |
| 370 | 370 | } |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | foreach ($ids as $id) { |
| 382 | 382 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 383 | 383 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params) |
| 384 | - ); |
|
| 384 | + ); |
|
| 385 | 385 | if ($xml && $xml->returncode != 'SUCCESS') { |
| 386 | 386 | return false; |
| 387 | 387 | } |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | function bigbluebuttonbn_end_meeting($meetingid, $modpw) { |
| 397 | 397 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 398 | 398 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('end', ['meetingID' => $meetingid, 'password' => $modpw]) |
| 399 | - ); |
|
| 399 | + ); |
|
| 400 | 400 | if ($xml) { |
| 401 | 401 | // If the xml packet returned failure it displays the message to the user. |
| 402 | 402 | return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | function bigbluebuttonbn_is_meeting_running($meetingid) { |
| 412 | 412 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 413 | 413 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('isMeetingRunning', ['meetingID' => $meetingid]) |
| 414 | - ); |
|
| 414 | + ); |
|
| 415 | 415 | if ($xml && $xml->returncode == 'SUCCESS') { |
| 416 | 416 | return ($xml->running == 'true'); |
| 417 | 417 | } |
@@ -421,7 +421,7 @@ discard block |
||
| 421 | 421 | function bigbluebuttonbn_get_server_version() { |
| 422 | 422 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 423 | 423 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url() |
| 424 | - ); |
|
| 424 | + ); |
|
| 425 | 425 | if ($xml && $xml->returncode == 'SUCCESS') { |
| 426 | 426 | return $xml->version; |
| 427 | 427 | } |
@@ -476,10 +476,10 @@ discard block |
||
| 476 | 476 | |
| 477 | 477 | $options = array(); |
| 478 | 478 | $options['CURLOPT_HTTPHEADER'] = array( |
| 479 | - 'Content-Type: '.$contenttype, |
|
| 480 | - 'Content-Length: '.strlen($data), |
|
| 481 | - 'Content-Language: en-US', |
|
| 482 | - ); |
|
| 479 | + 'Content-Type: '.$contenttype, |
|
| 480 | + 'Content-Length: '.strlen($data), |
|
| 481 | + 'Content-Language: en-US', |
|
| 482 | + ); |
|
| 483 | 483 | |
| 484 | 484 | return $c->post($url, $data, $options); |
| 485 | 485 | } |
@@ -558,13 +558,13 @@ discard block |
||
| 558 | 558 | |
| 559 | 559 | function bigbluebuttonbn_role_unknown() { |
| 560 | 560 | return array( |
| 561 | - "id" => "0", |
|
| 562 | - "name" => "", |
|
| 563 | - "shortname" => "unknown", |
|
| 564 | - "description" => "", |
|
| 565 | - "sortorder" => "0", |
|
| 566 | - "archetype" => "guest", |
|
| 567 | - "localname" => "Unknown" |
|
| 561 | + "id" => "0", |
|
| 562 | + "name" => "", |
|
| 563 | + "shortname" => "unknown", |
|
| 564 | + "description" => "", |
|
| 565 | + "sortorder" => "0", |
|
| 566 | + "archetype" => "guest", |
|
| 567 | + "localname" => "Unknown" |
|
| 568 | 568 | ); |
| 569 | 569 | } |
| 570 | 570 | |
@@ -573,16 +573,16 @@ discard block |
||
| 573 | 573 | 'all' => array( |
| 574 | 574 | 'name' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'), |
| 575 | 575 | 'children' => [] |
| 576 | - ) |
|
| 577 | - ); |
|
| 576 | + ) |
|
| 577 | + ); |
|
| 578 | 578 | $data['role'] = array( |
| 579 | 579 | 'name' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'), |
| 580 | 580 | 'children' => bigbluebuttonbn_get_roles_select($context) |
| 581 | - ); |
|
| 581 | + ); |
|
| 582 | 582 | $data['user'] = array( |
| 583 | 583 | 'name' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'), |
| 584 | 584 | 'children' => bigbluebuttonbn_get_users_select($context) |
| 585 | - ); |
|
| 585 | + ); |
|
| 586 | 586 | return $data; |
| 587 | 587 | } |
| 588 | 588 | |
@@ -612,9 +612,9 @@ discard block |
||
| 612 | 612 | continue; |
| 613 | 613 | } |
| 614 | 614 | $participantlistarray[] = array( |
| 615 | - 'selectiontype' => 'role', |
|
| 616 | - 'selectionid' => $moderatordefault, |
|
| 617 | - 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR); |
|
| 615 | + 'selectiontype' => 'role', |
|
| 616 | + 'selectionid' => $moderatordefault, |
|
| 617 | + 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR); |
|
| 618 | 618 | } |
| 619 | 619 | return $participantlistarray; |
| 620 | 620 | } |
@@ -645,11 +645,11 @@ discard block |
||
| 645 | 645 | 'all' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'), |
| 646 | 646 | 'role' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'), |
| 647 | 647 | 'user' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'), |
| 648 | - ], |
|
| 648 | + ], |
|
| 649 | 649 | 'type_selected' => 'all', |
| 650 | 650 | 'options' => ['all' => '---------------'], |
| 651 | 651 | 'selected' => 'all', |
| 652 | - ]; |
|
| 652 | + ]; |
|
| 653 | 653 | } |
| 654 | 654 | |
| 655 | 655 | function bigbluebuttonbn_is_moderator($context, $participants, $userid = null, $userroles = null) { |
@@ -839,7 +839,7 @@ discard block |
||
| 839 | 839 | $eventproperties['other'] = $options['other']; |
| 840 | 840 | } |
| 841 | 841 | $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create', |
| 842 | - array($eventproperties)); |
|
| 842 | + array($eventproperties)); |
|
| 843 | 843 | $event->trigger(); |
| 844 | 844 | } |
| 845 | 845 | |
@@ -884,7 +884,7 @@ discard block |
||
| 884 | 884 | // Ping again and refresh the cache. |
| 885 | 885 | $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file( |
| 886 | 886 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
| 887 | - ); |
|
| 887 | + ); |
|
| 888 | 888 | $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); |
| 889 | 889 | return $meetinginfo; |
| 890 | 890 | } |
@@ -1120,8 +1120,8 @@ discard block |
||
| 1120 | 1120 | } |
| 1121 | 1121 | $id = 'playbacks-'.$recording['recordID']; |
| 1122 | 1122 | $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported, |
| 1123 | - 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
|
| 1124 | - 'title' => $title, $visibility => $visibility)); |
|
| 1123 | + 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
|
| 1124 | + 'title' => $title, $visibility => $visibility)); |
|
| 1125 | 1125 | foreach ($recording['playbacks'] as $playback) { |
| 1126 | 1126 | $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bigbluebuttonbnid, |
| 1127 | 1127 | $playback).' '; |
@@ -1135,7 +1135,7 @@ discard block |
||
| 1135 | 1135 | $title = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'); |
| 1136 | 1136 | $onclick = 'M.mod_bigbluebuttonbn.recordings.recordingPlay(this);'; |
| 1137 | 1137 | $href = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=play&bn='.$bigbluebuttonbnid. |
| 1138 | - '&mid='.$recording['meetingID'].'&rid='.$recording['recordID'].'&rtype='.$playback['type']; |
|
| 1138 | + '&mid='.$recording['meetingID'].'&rid='.$recording['recordID'].'&rtype='.$playback['type']; |
|
| 1139 | 1139 | if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') { |
| 1140 | 1140 | $href .= '&href='.urlencode(trim($playback['url'])); |
| 1141 | 1141 | } |
@@ -1147,7 +1147,7 @@ discard block |
||
| 1147 | 1147 | 'data-target' => $playback['type'], |
| 1148 | 1148 | 'data-href' => $href, |
| 1149 | 1149 | 'class' => 'btn btn-sm btn-default' |
| 1150 | - ); |
|
| 1150 | + ); |
|
| 1151 | 1151 | return $OUTPUT->action_link('#', $title, null, $linkattributes); |
| 1152 | 1152 | } |
| 1153 | 1153 | |
@@ -1231,7 +1231,7 @@ discard block |
||
| 1231 | 1231 | 'onclick' => $onclick, |
| 1232 | 1232 | 'data-action' => $data['action'], |
| 1233 | 1233 | 'data-links' => bigbluebuttonbn_get_count_recording_imported_instances($recording['recordID']) |
| 1234 | - ); |
|
| 1234 | + ); |
|
| 1235 | 1235 | return $OUTPUT->action_icon('#', $icon, null, $linkattributes, false); |
| 1236 | 1236 | } |
| 1237 | 1237 | // With text for $manageaction. |
@@ -1336,7 +1336,7 @@ discard block |
||
| 1336 | 1336 | $texthead . $rowdata->activity . $texttail, $texthead . $rowdata->description . $texttail, |
| 1337 | 1337 | $rowdata->preview, $texthead . $rowdata->date_formatted . $texttail, |
| 1338 | 1338 | $rowdata->duration_formatted |
| 1339 | - ); |
|
| 1339 | + ); |
|
| 1340 | 1340 | if ($bbbsession['managerecordings']) { |
| 1341 | 1341 | $row->cells[] = $rowdata->actionbar; |
| 1342 | 1342 | } |
@@ -1578,8 +1578,8 @@ discard block |
||
| 1578 | 1578 | $activitytime = ''; |
| 1579 | 1579 | if ($time) { |
| 1580 | 1580 | $activitytime = calendar_day_representation($time).' '. |
| 1581 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
| 1582 | - calendar_time_representation($time); |
|
| 1581 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
| 1582 | + calendar_time_representation($time); |
|
| 1583 | 1583 | } |
| 1584 | 1584 | return $activitytime; |
| 1585 | 1585 | } |
@@ -1757,7 +1757,7 @@ discard block |
||
| 1757 | 1757 | $renderer->render_group_element('participant_moderator_default', |
| 1758 | 1758 | $renderer->render_group_element_configmultiselect('participant_moderator_default', |
| 1759 | 1759 | array_keys($owner), array_merge($owner, $roles)) |
| 1760 | - ); |
|
| 1760 | + ); |
|
| 1761 | 1761 | } |
| 1762 | 1762 | } |
| 1763 | 1763 | |
@@ -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 | const BIGBLUEBUTTONBN_FORCED = true; |
| 34 | 34 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | if (isset($meta)) { |
| 81 | 81 | $log->meta = $meta; |
| 82 | 82 | } else if ($event == BIGBLUEBUTTONBN_LOG_EVENT_CREATE) { |
| 83 | - $log->meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}'; |
|
| 83 | + $log->meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}'; |
|
| 84 | 84 | } |
| 85 | 85 | $DB->insert_record('bigbluebuttonbn_logs', $log); |
| 86 | 86 | } |
@@ -120,8 +120,8 @@ discard block |
||
| 120 | 120 | $data = null; |
| 121 | 121 | if (!is_null($pname) && !is_null($purl)) { |
| 122 | 122 | $method = BIGBLUEBUTTONBN_METHOD_POST; |
| 123 | - $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='". |
|
| 124 | - $purl."' /></module></modules>"; |
|
| 123 | + $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='" . |
|
| 124 | + $purl . "' /></module></modules>"; |
|
| 125 | 125 | } |
| 126 | 126 | $xml = bigbluebuttonbn_wrap_xml_load_file($createmeetingurl, $method, $data); |
| 127 | 127 | if ($xml) { |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | // Override imported flag with actual ID. |
| 270 | 270 | $recording['imported'] = $recordimported->id; |
| 271 | 271 | if (isset($recordimported->protected)) { |
| 272 | - $recording['protected'] = (string) $recordimported->protected; |
|
| 272 | + $recording['protected'] = (string)$recordimported->protected; |
|
| 273 | 273 | } |
| 274 | 274 | $recordsimportedarray[$recording['recordID']] = $recording; |
| 275 | 275 | } |
@@ -285,36 +285,36 @@ discard block |
||
| 285 | 285 | |
| 286 | 286 | function bigbluebuttonbn_get_default_config_xml_array() { |
| 287 | 287 | $defaultconfigxml = bigbluebuttonbn_getDefaultConfigXML(); |
| 288 | - return (array) $defaultconfigxml; |
|
| 288 | + return (array)$defaultconfigxml; |
|
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | function bigbluebuttonbn_get_recording_array_value($recording) { |
| 292 | 292 | // Add formats. |
| 293 | 293 | $playbackarray = array(); |
| 294 | 294 | foreach ($recording->playback->format as $format) { |
| 295 | - $playbackarray[(string) $format->type] = array('type' => (string) $format->type, |
|
| 296 | - 'url' => trim((string) $format->url), 'length' => (string) $format->length); |
|
| 295 | + $playbackarray[(string)$format->type] = array('type' => (string)$format->type, |
|
| 296 | + 'url' => trim((string)$format->url), 'length' => (string)$format->length); |
|
| 297 | 297 | // Add preview per format when existing. |
| 298 | 298 | if ($format->preview) { |
| 299 | 299 | $imagesarray = array(); |
| 300 | 300 | foreach ($format->preview->images->image as $image) { |
| 301 | - $imagearray = array('url' => trim((string) $image)); |
|
| 301 | + $imagearray = array('url' => trim((string)$image)); |
|
| 302 | 302 | foreach ($image->attributes() as $attkey => $attvalue) { |
| 303 | - $imagearray[$attkey] = (string) $attvalue; |
|
| 303 | + $imagearray[$attkey] = (string)$attvalue; |
|
| 304 | 304 | } |
| 305 | 305 | array_push($imagesarray, $imagearray); |
| 306 | 306 | } |
| 307 | - $playbackarray[(string) $format->type]['preview'] = $imagesarray; |
|
| 307 | + $playbackarray[(string)$format->type]['preview'] = $imagesarray; |
|
| 308 | 308 | } |
| 309 | 309 | } |
| 310 | 310 | // Add the metadata to the recordings array. |
| 311 | 311 | $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata)); |
| 312 | - $recordingarray = array('recordID' => (string) $recording->recordID, |
|
| 313 | - 'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name, |
|
| 314 | - 'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime, |
|
| 315 | - 'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray); |
|
| 312 | + $recordingarray = array('recordID' => (string)$recording->recordID, |
|
| 313 | + 'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name, |
|
| 314 | + 'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime, |
|
| 315 | + 'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray); |
|
| 316 | 316 | if (isset($recording->protected)) { |
| 317 | - $recordingarray['protected'] = (string) $recording->protected; |
|
| 317 | + $recordingarray['protected'] = (string)$recording->protected; |
|
| 318 | 318 | } |
| 319 | 319 | return $recordingarray + $metadataarray; |
| 320 | 320 | } |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | if (is_object($value)) { |
| 326 | 326 | $value = ''; |
| 327 | 327 | } |
| 328 | - $metadataarray['meta_'.$key] = $value; |
|
| 328 | + $metadataarray['meta_' . $key] = $value; |
|
| 329 | 329 | } |
| 330 | 330 | return $metadataarray; |
| 331 | 331 | } |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | $ids = explode(',', $recordids); |
| 382 | 382 | foreach ($ids as $id) { |
| 383 | 383 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 384 | - \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params) |
|
| 384 | + \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params) |
|
| 385 | 385 | ); |
| 386 | 386 | if ($xml && $xml->returncode != 'SUCCESS') { |
| 387 | 387 | return false; |
@@ -448,7 +448,7 @@ discard block |
||
| 448 | 448 | return $xml; |
| 449 | 449 | } catch (Exception $e) { |
| 450 | 450 | libxml_use_internal_errors($previous); |
| 451 | - $error = 'Caught exception: '.$e->getMessage(); |
|
| 451 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
| 452 | 452 | debugging($error, DEBUG_DEVELOPER); |
| 453 | 453 | return null; |
| 454 | 454 | } |
@@ -459,7 +459,7 @@ discard block |
||
| 459 | 459 | $response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS); |
| 460 | 460 | return $response; |
| 461 | 461 | } catch (Exception $e) { |
| 462 | - $error = 'Caught exception: '.$e->getMessage(); |
|
| 462 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
| 463 | 463 | debugging($error, DEBUG_DEVELOPER); |
| 464 | 464 | libxml_use_internal_errors($previous); |
| 465 | 465 | return null; |
@@ -477,8 +477,8 @@ discard block |
||
| 477 | 477 | |
| 478 | 478 | $options = array(); |
| 479 | 479 | $options['CURLOPT_HTTPHEADER'] = array( |
| 480 | - 'Content-Type: '.$contenttype, |
|
| 481 | - 'Content-Length: '.strlen($data), |
|
| 480 | + 'Content-Type: ' . $contenttype, |
|
| 481 | + 'Content-Length: ' . strlen($data), |
|
| 482 | 482 | 'Content-Language: en-US', |
| 483 | 483 | ); |
| 484 | 484 | |
@@ -489,7 +489,7 @@ discard block |
||
| 489 | 489 | |
| 490 | 490 | function bigbluebuttonbn_end_meeting_if_running($bigbluebuttonbn) { |
| 491 | 491 | // End the session associated with this instance (if it's running). |
| 492 | - $meetingid = $bigbluebuttonbn->meetingid.'-'.$bigbluebuttonbn->course.'-'.$bigbluebuttonbn->id; |
|
| 492 | + $meetingid = $bigbluebuttonbn->meetingid . '-' . $bigbluebuttonbn->course . '-' . $bigbluebuttonbn->id; |
|
| 493 | 493 | if (bigbluebuttonbn_is_meeting_running($meetingid)) { |
| 494 | 494 | bigbluebuttonbn_end_meeting($meetingid, $bigbluebuttonbn->moderatorpass); |
| 495 | 495 | } |
@@ -501,9 +501,9 @@ discard block |
||
| 501 | 501 | if ($userroles) { |
| 502 | 502 | $where = ''; |
| 503 | 503 | foreach ($userroles as $value) { |
| 504 | - $where .= (empty($where) ? ' WHERE' : ' OR').' id='.$value->roleid; |
|
| 504 | + $where .= (empty($where) ? ' WHERE' : ' OR') . ' id=' . $value->roleid; |
|
| 505 | 505 | } |
| 506 | - $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where); |
|
| 506 | + $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where); |
|
| 507 | 507 | } |
| 508 | 508 | return $userroles; |
| 509 | 509 | } |
@@ -514,7 +514,7 @@ discard block |
||
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | function bigbluebuttonbn_get_users(context $context = null) { |
| 517 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
| 517 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
| 518 | 518 | foreach ($users as $key => $value) { |
| 519 | 519 | $users[$key] = fullname($value); |
| 520 | 520 | } |
@@ -522,7 +522,7 @@ discard block |
||
| 522 | 522 | } |
| 523 | 523 | |
| 524 | 524 | function bigbluebuttonbn_get_users_select(context $context = null) { |
| 525 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
| 525 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
| 526 | 526 | foreach ($users as $key => $value) { |
| 527 | 527 | $users[$key] = array('id' => $value->id, 'name' => fullname($value)); |
| 528 | 528 | } |
@@ -530,7 +530,7 @@ discard block |
||
| 530 | 530 | } |
| 531 | 531 | |
| 532 | 532 | function bigbluebuttonbn_get_roles(context $context = null) { |
| 533 | - $roles = (array) role_get_names($context); |
|
| 533 | + $roles = (array)role_get_names($context); |
|
| 534 | 534 | foreach ($roles as $key => $value) { |
| 535 | 535 | $roles[$key] = $value->localname; |
| 536 | 536 | } |
@@ -538,7 +538,7 @@ discard block |
||
| 538 | 538 | } |
| 539 | 539 | |
| 540 | 540 | function bigbluebuttonbn_get_roles_select(context $context = null) { |
| 541 | - $roles = (array) role_get_names($context); |
|
| 541 | + $roles = (array)role_get_names($context); |
|
| 542 | 542 | foreach ($roles as $key => $value) { |
| 543 | 543 | $roles[$key] = array('id' => $value->id, 'name' => $value->localname); |
| 544 | 544 | } |
@@ -546,7 +546,7 @@ discard block |
||
| 546 | 546 | } |
| 547 | 547 | |
| 548 | 548 | function bigbluebuttonbn_get_role($id) { |
| 549 | - $roles = (array) role_get_names(); |
|
| 549 | + $roles = (array)role_get_names(); |
|
| 550 | 550 | if (is_numeric($id)) { |
| 551 | 551 | return (object)$roles[$id]; |
| 552 | 552 | } |
@@ -626,11 +626,11 @@ discard block |
||
| 626 | 626 | return array(); |
| 627 | 627 | } |
| 628 | 628 | foreach ($rules as $key => $rule) { |
| 629 | - if ( $rule['selectiontype'] !== 'role' || is_numeric($rule['selectionid']) ) { |
|
| 629 | + if ($rule['selectiontype'] !== 'role' || is_numeric($rule['selectionid'])) { |
|
| 630 | 630 | continue; |
| 631 | 631 | } |
| 632 | 632 | $role = bigbluebuttonbn_get_role($rule['selectionid']); |
| 633 | - if ( $role == null ) { |
|
| 633 | + if ($role == null) { |
|
| 634 | 634 | unset($rules[$key]); |
| 635 | 635 | continue; |
| 636 | 636 | } |
@@ -669,10 +669,10 @@ discard block |
||
| 669 | 669 | if (empty($userroles)) { |
| 670 | 670 | $userroles = get_user_roles($context, $userid, true); |
| 671 | 671 | } |
| 672 | - return bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles); |
|
| 672 | + return bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles); |
|
| 673 | 673 | } |
| 674 | 674 | |
| 675 | -function bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles) { |
|
| 675 | +function bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles) { |
|
| 676 | 676 | // Iterate participant rules. |
| 677 | 677 | foreach ($participantlist as $participant) { |
| 678 | 678 | if (bigbluebuttonbn_is_moderator_validate_rule($participant, $userid, $userroles)) { |
@@ -717,9 +717,9 @@ discard block |
||
| 717 | 717 | $isunique = true; |
| 718 | 718 | if ($voicebridge != 0) { |
| 719 | 719 | $table = 'bigbluebuttonbn'; |
| 720 | - $select = 'voicebridge = '.$voicebridge; |
|
| 720 | + $select = 'voicebridge = ' . $voicebridge; |
|
| 721 | 721 | if ($id) { |
| 722 | - $select .= ' AND id <> '.$id; |
|
| 722 | + $select .= ' AND id <> ' . $id; |
|
| 723 | 723 | } |
| 724 | 724 | if ($DB->get_records_select($table, $select)) { |
| 725 | 725 | $isunique = false; |
@@ -773,7 +773,7 @@ discard block |
||
| 773 | 773 | function bigbluebuttonbn_generate_nonce() { |
| 774 | 774 | $mt = microtime(); |
| 775 | 775 | $rand = mt_rand(); |
| 776 | - return md5($mt.$rand); |
|
| 776 | + return md5($mt . $rand); |
|
| 777 | 777 | } |
| 778 | 778 | |
| 779 | 779 | function bigbluebuttonbn_random_password($length = 8, $unique = "") { |
@@ -786,41 +786,41 @@ discard block |
||
| 786 | 786 | |
| 787 | 787 | function bigbluebuttonbn_events() { |
| 788 | 788 | return array( |
| 789 | - (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
| 790 | - (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
| 791 | - (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
| 792 | - (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
| 793 | - (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
| 794 | - (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
| 795 | - (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
| 796 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
| 797 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
| 798 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
| 799 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
| 800 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
| 801 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
| 802 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
| 803 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
| 789 | + (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
| 790 | + (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
| 791 | + (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
| 792 | + (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
| 793 | + (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
| 794 | + (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
| 795 | + (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
| 796 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
| 797 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
| 798 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
| 799 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
| 800 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
| 801 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
| 802 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
| 803 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
| 804 | 804 | ); |
| 805 | 805 | } |
| 806 | 806 | |
| 807 | 807 | function bigbluebuttonbn_events_action() { |
| 808 | 808 | return array( |
| 809 | - 'view' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
| 810 | - 'view_management' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
| 811 | - 'live_action' => (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
| 812 | - 'meeting_create' => (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
| 813 | - 'meeting_end' => (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
| 814 | - 'meeting_join' => (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
| 815 | - 'meeting_left' => (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
| 816 | - 'recording_delete' => (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
| 817 | - 'recording_import' => (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
| 818 | - 'recording_protect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
| 819 | - 'recording_publish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
| 820 | - 'recording_unprotect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
| 821 | - 'recording_unpublish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
| 822 | - 'recording_edit' => (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
| 823 | - 'recording_play' => (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
| 809 | + 'view' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
| 810 | + 'view_management' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
| 811 | + 'live_action' => (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
| 812 | + 'meeting_create' => (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
| 813 | + 'meeting_end' => (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
| 814 | + 'meeting_join' => (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
| 815 | + 'meeting_left' => (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
| 816 | + 'recording_delete' => (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
| 817 | + 'recording_import' => (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
| 818 | + 'recording_protect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
| 819 | + 'recording_publish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
| 820 | + 'recording_unprotect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
| 821 | + 'recording_unpublish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
| 822 | + 'recording_edit' => (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
| 823 | + 'recording_play' => (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
| 824 | 824 | ); |
| 825 | 825 | } |
| 826 | 826 | |
@@ -841,7 +841,7 @@ discard block |
||
| 841 | 841 | if (array_key_exists('other', $options)) { |
| 842 | 842 | $eventproperties['other'] = $options['other']; |
| 843 | 843 | } |
| 844 | - $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create', |
|
| 844 | + $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_' . $eventtype . '::create', |
|
| 845 | 845 | array($eventproperties)); |
| 846 | 846 | $event->trigger(); |
| 847 | 847 | } |
@@ -882,10 +882,10 @@ discard block |
||
| 882 | 882 | $now = time(); |
| 883 | 883 | if (!$forced && isset($result) && $now < ($result['creation_time'] + $cachettl)) { |
| 884 | 884 | // Use the value in the cache. |
| 885 | - return (array) json_decode($result['meeting_info']); |
|
| 885 | + return (array)json_decode($result['meeting_info']); |
|
| 886 | 886 | } |
| 887 | 887 | // Ping again and refresh the cache. |
| 888 | - $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file( |
|
| 888 | + $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file( |
|
| 889 | 889 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
| 890 | 890 | ); |
| 891 | 891 | $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); |
@@ -960,8 +960,8 @@ discard block |
||
| 960 | 960 | * @param string $configxml |
| 961 | 961 | */ |
| 962 | 962 | function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) { |
| 963 | - $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid); |
|
| 964 | - $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.\mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
| 963 | + $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid); |
|
| 964 | + $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . \mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
| 965 | 965 | return $configxmlparams; |
| 966 | 966 | } |
| 967 | 967 | |
@@ -970,7 +970,7 @@ discard block |
||
| 970 | 970 | * @param string $configxml |
| 971 | 971 | */ |
| 972 | 972 | function bigbluebuttonbn_set_config_xml($meetingid, $configxml) { |
| 973 | - $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?'; |
|
| 973 | + $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?'; |
|
| 974 | 974 | $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml); |
| 975 | 975 | $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, BIGBLUEBUTTONBN_METHOD_POST, |
| 976 | 976 | $configxmlparams, 'application/x-www-form-urlencoded'); |
@@ -983,7 +983,7 @@ discard block |
||
| 983 | 983 | */ |
| 984 | 984 | function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) { |
| 985 | 985 | $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml); |
| 986 | - $configxmlarray = (array) $configxml; |
|
| 986 | + $configxmlarray = (array)$configxml; |
|
| 987 | 987 | if ($configxmlarray['returncode'] != 'SUCCESS') { |
| 988 | 988 | debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER); |
| 989 | 989 | return ''; |
@@ -1033,7 +1033,7 @@ discard block |
||
| 1033 | 1033 | global $USER; |
| 1034 | 1034 | $starttime = $starttime - ($starttime % 1000); |
| 1035 | 1035 | // Set formatted date. |
| 1036 | - $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z'; |
|
| 1036 | + $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z'; |
|
| 1037 | 1037 | return userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone)); |
| 1038 | 1038 | } |
| 1039 | 1039 | |
@@ -1049,7 +1049,7 @@ discard block |
||
| 1049 | 1049 | function bigbluebuttonbn_get_recording_data_row_actionbar($recording, $tools) { |
| 1050 | 1050 | $actionbar = ''; |
| 1051 | 1051 | foreach ($tools as $tool) { |
| 1052 | - if ( $tool == 'protect' && !isset($recording['protected']) ) { |
|
| 1052 | + if ($tool == 'protect' && !isset($recording['protected'])) { |
|
| 1053 | 1053 | continue; |
| 1054 | 1054 | } |
| 1055 | 1055 | $buttonpayload = bigbluebuttonbn_get_recording_data_row_actionbar_payload($recording, $tool); |
@@ -1093,7 +1093,7 @@ discard block |
||
| 1093 | 1093 | $visibility = 'hidden '; |
| 1094 | 1094 | } |
| 1095 | 1095 | $recordingpreview = html_writer::start_tag('div', |
| 1096 | - array('id' => 'preview-'.$recording['recordID'], $visibility => $visibility)); |
|
| 1096 | + array('id' => 'preview-' . $recording['recordID'], $visibility => $visibility)); |
|
| 1097 | 1097 | foreach ($recording['playbacks'] as $playback) { |
| 1098 | 1098 | if (isset($playback['preview'])) { |
| 1099 | 1099 | foreach ($playback['preview'] as $image) { |
@@ -1121,13 +1121,13 @@ discard block |
||
| 1121 | 1121 | if ($recording['published'] === 'false') { |
| 1122 | 1122 | $visibility = 'hidden '; |
| 1123 | 1123 | } |
| 1124 | - $id = 'playbacks-'.$recording['recordID']; |
|
| 1124 | + $id = 'playbacks-' . $recording['recordID']; |
|
| 1125 | 1125 | $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported, |
| 1126 | 1126 | 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
| 1127 | 1127 | 'title' => $title, $visibility => $visibility)); |
| 1128 | 1128 | foreach ($recording['playbacks'] as $playback) { |
| 1129 | 1129 | $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bigbluebuttonbnid, |
| 1130 | - $playback).' '; |
|
| 1130 | + $playback) . ' '; |
|
| 1131 | 1131 | } |
| 1132 | 1132 | $recordingtypes .= html_writer::end_tag('div'); |
| 1133 | 1133 | return $recordingtypes; |
@@ -1135,12 +1135,12 @@ discard block |
||
| 1135 | 1135 | |
| 1136 | 1136 | function bigbluebuttonbn_get_recording_data_row_type($recording, $bigbluebuttonbnid, $playback) { |
| 1137 | 1137 | global $CFG, $OUTPUT; |
| 1138 | - $title = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'); |
|
| 1138 | + $title = get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn'); |
|
| 1139 | 1139 | $onclick = 'M.mod_bigbluebuttonbn.recordings.recordingPlay(this);'; |
| 1140 | - $href = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=play&bn='.$bigbluebuttonbnid. |
|
| 1141 | - '&mid='.$recording['meetingID'].'&rid='.$recording['recordID'].'&rtype='.$playback['type']; |
|
| 1140 | + $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bigbluebuttonbnid . |
|
| 1141 | + '&mid=' . $recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
| 1142 | 1142 | if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') { |
| 1143 | - $href .= '&href='.urlencode(trim($playback['url'])); |
|
| 1143 | + $href .= '&href=' . urlencode(trim($playback['url'])); |
|
| 1144 | 1144 | } |
| 1145 | 1145 | $id = 'recording-play-' . $playback['type'] . '-' . $recording['recordID']; |
| 1146 | 1146 | $linkattributes = array( |
@@ -1226,7 +1226,7 @@ discard block |
||
| 1226 | 1226 | if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recording_icons_enabled')) { |
| 1227 | 1227 | // With icon for $manageaction. |
| 1228 | 1228 | $iconattributes = array('id' => $id, 'class' => 'iconsmall'); |
| 1229 | - $icon = new pix_icon('i/'.$data['tag'], |
|
| 1229 | + $icon = new pix_icon('i/' . $data['tag'], |
|
| 1230 | 1230 | get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'), |
| 1231 | 1231 | 'moodle', $iconattributes); |
| 1232 | 1232 | $linkattributes = array( |
@@ -1308,7 +1308,7 @@ discard block |
||
| 1308 | 1308 | if (isset($recordings) && !array_key_exists('messageKey', $recordings)) { |
| 1309 | 1309 | // There are recordings for this meeting. |
| 1310 | 1310 | foreach ($recordings as $recording) { |
| 1311 | - if ( !bigbluebuttonbn_include_recording_table_row($bbbsession, $recording) ) { |
|
| 1311 | + if (!bigbluebuttonbn_include_recording_table_row($bbbsession, $recording)) { |
|
| 1312 | 1312 | continue; |
| 1313 | 1313 | } |
| 1314 | 1314 | bigbluebuttonbn_get_recording_table_row($bbbsession, $recording, $tools, $table); |
@@ -1323,7 +1323,7 @@ discard block |
||
| 1323 | 1323 | return; |
| 1324 | 1324 | } |
| 1325 | 1325 | $row = new html_table_row(); |
| 1326 | - $row->id = 'recording-td-'.$recording['recordID']; |
|
| 1326 | + $row->id = 'recording-td-' . $recording['recordID']; |
|
| 1327 | 1327 | $row->attributes['data-imported'] = 'false'; |
| 1328 | 1328 | $texthead = ''; |
| 1329 | 1329 | $texttail = ''; |
@@ -1347,7 +1347,7 @@ discard block |
||
| 1347 | 1347 | } |
| 1348 | 1348 | |
| 1349 | 1349 | function bigbluebuttonbn_include_recording_table_row($bbbsession, $recording) { |
| 1350 | - if ( isset($recording['imported']) || !isset($bbbsession['group']) || $recording['meetingID'] == $bbbsession['meetingid'] ) { |
|
| 1350 | + if (isset($recording['imported']) || !isset($bbbsession['group']) || $recording['meetingID'] == $bbbsession['meetingid']) { |
|
| 1351 | 1351 | return true; |
| 1352 | 1352 | } |
| 1353 | 1353 | return false; |
@@ -1360,9 +1360,9 @@ discard block |
||
| 1360 | 1360 | // Build the message_body. |
| 1361 | 1361 | $msg->activity_type = ''; |
| 1362 | 1362 | $msg->activity_title = $bigbluebuttonbn->name; |
| 1363 | - $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn').' '. |
|
| 1364 | - $msg->activity_type.' "'.$msg->activity_title.'" '. |
|
| 1365 | - get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>'; |
|
| 1363 | + $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . ' ' . |
|
| 1364 | + $msg->activity_type . ' "' . $msg->activity_title . '" ' . |
|
| 1365 | + get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>'; |
|
| 1366 | 1366 | \mod_bigbluebuttonbn\locallib\notifier::notification_send($sender, $bigbluebuttonbn, $messagetext); |
| 1367 | 1367 | } |
| 1368 | 1368 | |
@@ -1509,7 +1509,7 @@ discard block |
||
| 1509 | 1509 | } |
| 1510 | 1510 | // Prepare select for loading records based on existent bigbluebuttonbns. |
| 1511 | 1511 | $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE '; |
| 1512 | - $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')'; |
|
| 1512 | + $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')'; |
|
| 1513 | 1513 | // Include only Create events and exclude those with record not true. |
| 1514 | 1514 | $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?'; |
| 1515 | 1515 | // Execute select for loading records based on existent bigbluebuttonbns. |
@@ -1584,8 +1584,8 @@ discard block |
||
| 1584 | 1584 | function bigbluebuttonbn_format_activity_time($time) { |
| 1585 | 1585 | $activitytime = ''; |
| 1586 | 1586 | if ($time) { |
| 1587 | - $activitytime = calendar_day_representation($time).' '. |
|
| 1588 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
| 1587 | + $activitytime = calendar_day_representation($time) . ' ' . |
|
| 1588 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' . |
|
| 1589 | 1589 | calendar_time_representation($time); |
| 1590 | 1590 | } |
| 1591 | 1591 | return $activitytime; |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | defined('MOODLE_INTERNAL') || die; |
| 27 | 27 | |
| 28 | -require_once($CFG->dirroot.'/mod/bigbluebuttonbn/backup/moodle2/backup_bigbluebuttonbn_stepslib.php'); |
|
| 28 | +require_once($CFG->dirroot . '/mod/bigbluebuttonbn/backup/moodle2/backup_bigbluebuttonbn_stepslib.php'); |
|
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | 31 | * Backup task that provides all the settings and steps to perform one complete backup of the activity. |
@@ -62,14 +62,14 @@ discard block |
||
| 62 | 62 | public static function encode_content_links($content) { |
| 63 | 63 | global $CFG; |
| 64 | 64 | |
| 65 | - $base = preg_quote($CFG->wwwroot.'/mod/bigbluebuttonbn', '#'); |
|
| 65 | + $base = preg_quote($CFG->wwwroot . '/mod/bigbluebuttonbn', '#'); |
|
| 66 | 66 | |
| 67 | 67 | // Link to the list of bigbluebuttonbns. |
| 68 | - $pattern = '#('.$base."\/index.php\?id\=)([0-9]+)#"; |
|
| 68 | + $pattern = '#(' . $base . "\/index.php\?id\=)([0-9]+)#"; |
|
| 69 | 69 | $content = preg_replace($pattern, '$@BIGBLUEBUTTONBNINDEX*$2@$', $content); |
| 70 | 70 | |
| 71 | 71 | // Link to bigbluebuttonbn view by moduleid. |
| 72 | - $pattern = '#('.$base."\/view.php\?id\=)([0-9]+)#"; |
|
| 72 | + $pattern = '#(' . $base . "\/view.php\?id\=)([0-9]+)#"; |
|
| 73 | 73 | $content = preg_replace($pattern, '$@BIGBLUEBUTTONBNVIEWBYID*$2@$', $content); |
| 74 | 74 | |
| 75 | 75 | return $content; |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | $logs = new backup_nested_element('logs'); |
| 49 | 49 | |
| 50 | 50 | $log = new backup_nested_element('log', array('id'), array( |
| 51 | - 'courseid', 'bigbluebuttonbnid', 'userid', 'timecreated', 'meetingid', 'log', 'meta', )); |
|
| 51 | + 'courseid', 'bigbluebuttonbnid', 'userid', 'timecreated', 'meetingid', 'log', 'meta',)); |
|
| 52 | 52 | |
| 53 | 53 | // Build the tree. |
| 54 | 54 | $bigbluebuttonbn->add_child($logs); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | protected function process_bigbluebuttonbn($data) { |
| 51 | 51 | global $DB; |
| 52 | - $data = (object) $data; |
|
| 52 | + $data = (object)$data; |
|
| 53 | 53 | $data->course = $this->get_courseid(); |
| 54 | 54 | $data->timemodified = $this->apply_date_offset($data->timemodified); |
| 55 | 55 | // Insert the bigbluebuttonbn record. |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | protected function process_bigbluebuttonbn_logs($data) { |
| 67 | 67 | global $DB; |
| 68 | - $data = (object) $data; |
|
| 68 | + $data = (object)$data; |
|
| 69 | 69 | // Apply modifications. |
| 70 | 70 | $data->courseid = $this->get_mappingid('course', $data->courseid); |
| 71 | 71 | $data->bigbluebuttonbnid = $this->get_new_parentid('bigbluebuttonbn'); |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | |
| 26 | 26 | defined('MOODLE_INTERNAL') || die(); |
| 27 | 27 | |
| 28 | -require_once($CFG->dirroot.'/mod/bigbluebuttonbn/backup/moodle2/restore_bigbluebuttonbn_stepslib.php'); |
|
| 28 | +require_once($CFG->dirroot . '/mod/bigbluebuttonbn/backup/moodle2/restore_bigbluebuttonbn_stepslib.php'); |
|
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | 31 | * Restore task that provides all the settings and steps to perform one complete restore of the activity. |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | return $output; |
| 356 | 356 | } |
| 357 | 357 | $output .= $OUTPUT->box_start('box boxalignleft adminerror alert alert-' . $type . ' alert-block fade in', |
| 358 | - 'bigbluebuttonbn_view_general_warning')."\n"; |
|
| 358 | + 'bigbluebuttonbn_view_general_warning')."\n"; |
|
| 359 | 359 | $output .= ' <button type="button" class="close" data-dismiss="alert">×</button>'.$message."\n"; |
| 360 | 360 | $output .= ' <div class="singlebutton">'."\n"; |
| 361 | 361 | if (!empty($href)) { |
@@ -439,13 +439,13 @@ discard block |
||
| 439 | 439 | $recordings = bigbluebuttonbn_get_recordings( |
| 440 | 440 | $bbbsession['course']->id, $bigbluebuttonbnid, $showroom, |
| 441 | 441 | $bbbsession['bigbluebuttonbn']->recordings_deleted |
| 442 | - ); |
|
| 442 | + ); |
|
| 443 | 443 | } |
| 444 | 444 | |
| 445 | 445 | // Get recording links. |
| 446 | 446 | $recordingsimported = bigbluebuttonbn_get_recordings_imported_array( |
| 447 | 447 | $bbbsession['course']->id, $bigbluebuttonbnid, $showroom |
| 448 | - ); |
|
| 448 | + ); |
|
| 449 | 449 | |
| 450 | 450 | /* Perform aritmetic addition instead of merge so the imported recordings corresponding to existent |
| 451 | 451 | * recordings are not included. */ |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | // JavaScript variables for recordings. |
| 462 | 462 | $jsvars += array( |
| 463 | 463 | 'recordings_html' => $bbbsession['bigbluebuttonbn']->recordings_html == '1', |
| 464 | - ); |
|
| 464 | + ); |
|
| 465 | 465 | |
| 466 | 466 | // If there are meetings with recordings load the data to the table. |
| 467 | 467 | if ($bbbsession['bigbluebuttonbn']->recordings_html) { |
@@ -473,7 +473,7 @@ discard block |
||
| 473 | 473 | $jsvars += array( |
| 474 | 474 | 'columns' => bigbluebuttonbn_get_recording_columns($bbbsession), |
| 475 | 475 | 'data' => bigbluebuttonbn_get_recording_data($bbbsession, $recordings), |
| 476 | - ); |
|
| 476 | + ); |
|
| 477 | 477 | |
| 478 | 478 | // Render a YUI table. |
| 479 | 479 | return html_writer::div('', '', array('id' => 'bigbluebuttonbn_yui_table')); |
@@ -484,10 +484,10 @@ discard block |
||
| 484 | 484 | |
| 485 | 485 | $button = html_writer::tag('input', '', |
| 486 | 486 | array('type' => 'button', |
| 487 | - 'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'), |
|
| 488 | - 'class' => 'btn btn-secondary', |
|
| 489 | - 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='. |
|
| 490 | - $bbbsession['bigbluebuttonbn']->id.'\'')); |
|
| 487 | + 'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'), |
|
| 488 | + 'class' => 'btn btn-secondary', |
|
| 489 | + 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='. |
|
| 490 | + $bbbsession['bigbluebuttonbn']->id.'\'')); |
|
| 491 | 491 | $output = html_writer::start_tag('br'); |
| 492 | 492 | $output .= html_writer::tag('span', $button, array('id' => 'import_recording_links_button')); |
| 493 | 493 | $output .= html_writer::tag('span', '', array('id' => 'import_recording_links_table')); |
@@ -505,7 +505,7 @@ discard block |
||
| 505 | 505 | return '<h4>'.get_string('view_section_title_presentation', 'bigbluebuttonbn').'</h4>'. |
| 506 | 506 | ''.$OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false).''. |
| 507 | 507 | ''.$OUTPUT->action_link($bbbsession['presentation']['url'], |
| 508 | - $bbbsession['presentation']['name'], null, $attributes).'<br><br>'; |
|
| 508 | + $bbbsession['presentation']['name'], null, $attributes).'<br><br>'; |
|
| 509 | 509 | } |
| 510 | 510 | |
| 511 | 511 | return ''; |
@@ -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); |
@@ -58,21 +58,21 @@ discard block |
||
| 58 | 58 | if (is_null($serverversion)) { |
| 59 | 59 | if ($bbbsession['administrator']) { |
| 60 | 60 | print_error('view_error_unable_join', 'bigbluebuttonbn', |
| 61 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 61 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 62 | 62 | exit; |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | if ($bbbsession['moderator']) { |
| 66 | 66 | print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', |
| 67 | - $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course); |
|
| 67 | + $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course); |
|
| 68 | 68 | exit; |
| 69 | 69 | } |
| 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; |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | $bbbsession['viewerPW'] = $bbbsession['bigbluebuttonbn']->viewerpass; |
| 150 | 150 | |
| 151 | 151 | // Database info related to the activity. |
| 152 | - $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'. |
|
| 152 | + $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' . |
|
| 153 | 153 | $bbbsession['bigbluebuttonbn']->id; |
| 154 | 154 | $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name; |
| 155 | 155 | $bbbsession['meetingdescription'] = $bbbsession['bigbluebuttonbn']->intro; |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | $bbbsession['welcome'] = get_string('mod_form_field_welcome_default', 'bigbluebuttonbn'); |
| 171 | 171 | } |
| 172 | 172 | if ($bbbsession['bigbluebuttonbn']->record) { |
| 173 | - $bbbsession['welcome'] .= '<br><br>'.get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
|
| 173 | + $bbbsession['welcome'] .= '<br><br>' . get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | $bbbsession['openingtime'] = $bbbsession['bigbluebuttonbn']->openingtime; |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | $bbbsession['originServerName'] = $parsedurl['host']; |
| 187 | 187 | $bbbsession['originServerUrl'] = $CFG->wwwroot; |
| 188 | 188 | $bbbsession['originServerCommonName'] = ''; |
| 189 | - $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn ('.get_config('mod_bigbluebuttonbn', 'version').')'; |
|
| 189 | + $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn (' . get_config('mod_bigbluebuttonbn', 'version') . ')'; |
|
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | function bigbluebuttonbn_view_bbbsession_roles($context, $userid) { |
@@ -248,9 +248,9 @@ discard block |
||
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | // Assign group default values. |
| 251 | - $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'. |
|
| 252 | - $bbbsession['bigbluebuttonbn']->id.'['.$bbbsession['group'].']'; |
|
| 253 | - $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name.' ('.$groupname.')'; |
|
| 251 | + $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' . |
|
| 252 | + $bbbsession['bigbluebuttonbn']->id . '[' . $bbbsession['group'] . ']'; |
|
| 253 | + $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name . ' (' . $groupname . ')'; |
|
| 254 | 254 | |
| 255 | 255 | if (count($groups) == 0) { |
| 256 | 256 | // Only the All participants group exists. |
@@ -265,12 +265,12 @@ discard block |
||
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 | bigbluebuttonbn_view_message_box($bbbsession, get_string('view_groups_selection_warning', 'bigbluebuttonbn'), 'warning'); |
| 268 | - $urltoroot = $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bbbsession['cm']->id; |
|
| 268 | + $urltoroot = $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id; |
|
| 269 | 269 | groups_print_activity_menu($bbbsession['cm'], $urltoroot); |
| 270 | 270 | echo '<br><br>'; |
| 271 | 271 | } |
| 272 | 272 | |
| 273 | -function bigbluebuttonbn_view_message_box(&$bbbsession, $message, $type='warning', $onlymoderator=false) { |
|
| 273 | +function bigbluebuttonbn_view_message_box(&$bbbsession, $message, $type = 'warning', $onlymoderator = false) { |
|
| 274 | 274 | global $OUTPUT; |
| 275 | 275 | if ($onlymoderator && !$bbbsession['moderator'] && !$bbbsession['administrator']) { |
| 276 | 276 | return; |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | |
| 302 | 302 | // Renders general warning when configured. |
| 303 | 303 | $cfg = \mod_bigbluebuttonbn\locallib\config::get_options(); |
| 304 | - $output = bigbluebuttonbn_view_render_warning( |
|
| 304 | + $output = bigbluebuttonbn_view_render_warning( |
|
| 305 | 305 | (string)$cfg['general_warning_message'], |
| 306 | 306 | (string)$cfg['general_warning_box_type'], |
| 307 | 307 | (string)$cfg['general_warning_button_href'], |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | 'M.mod_bigbluebuttonbn.recordings.init', array($jsvars)); |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | - echo $output.html_writer::empty_tag('br').html_writer::empty_tag('br').html_writer::empty_tag('br'); |
|
| 326 | + echo $output . html_writer::empty_tag('br') . html_writer::empty_tag('br') . html_writer::empty_tag('br'); |
|
| 327 | 327 | $PAGE->requires->yui_module('moodle-mod_bigbluebuttonbn-broker', 'M.mod_bigbluebuttonbn.broker.init', array($jsvars)); |
| 328 | 328 | } |
| 329 | 329 | |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | return $output; |
| 349 | 349 | } |
| 350 | 350 | |
| 351 | -function bigbluebuttonbn_view_render_warning($message, $type='info', $href='', $text='', $class='') { |
|
| 351 | +function bigbluebuttonbn_view_render_warning($message, $type = 'info', $href = '', $text = '', $class = '') { |
|
| 352 | 352 | global $OUTPUT; |
| 353 | 353 | $output = "\n"; |
| 354 | 354 | // Evaluates if config_warning is enabled. |
@@ -356,14 +356,14 @@ discard block |
||
| 356 | 356 | return $output; |
| 357 | 357 | } |
| 358 | 358 | $output .= $OUTPUT->box_start('box boxalignleft adminerror alert alert-' . $type . ' alert-block fade in', |
| 359 | - 'bigbluebuttonbn_view_general_warning')."\n"; |
|
| 360 | - $output .= ' <button type="button" class="close" data-dismiss="alert">×</button>'.$message."\n"; |
|
| 361 | - $output .= ' <div class="singlebutton">'."\n"; |
|
| 359 | + 'bigbluebuttonbn_view_general_warning') . "\n"; |
|
| 360 | + $output .= ' <button type="button" class="close" data-dismiss="alert">×</button>' . $message . "\n"; |
|
| 361 | + $output .= ' <div class="singlebutton">' . "\n"; |
|
| 362 | 362 | if (!empty($href)) { |
| 363 | 363 | $output .= bigbluebuttonbn_view_render_warning_button($href, $text, $class); |
| 364 | 364 | } |
| 365 | - $output .= ' </div>'."\n"; |
|
| 366 | - $output .= $OUTPUT->box_end()."\n"; |
|
| 365 | + $output .= ' </div>' . "\n"; |
|
| 366 | + $output .= $OUTPUT->box_end() . "\n"; |
|
| 367 | 367 | return $output; |
| 368 | 368 | } |
| 369 | 369 | |
@@ -374,11 +374,11 @@ discard block |
||
| 374 | 374 | if ($class == '') { |
| 375 | 375 | $class = 'btn btn-secondary'; |
| 376 | 376 | } |
| 377 | - $output = ' <form method="post" action="' . $href . '" class="form-inline">'."\n"; |
|
| 378 | - $output .= ' <button type="submit" class="' . $class . '"'."\n"; |
|
| 379 | - $output .= ' title=""'."\n"; |
|
| 380 | - $output .= ' >' . $text . '</button>'."\n"; |
|
| 381 | - $output .= ' </form>'."\n"; |
|
| 377 | + $output = ' <form method="post" action="' . $href . '" class="form-inline">' . "\n"; |
|
| 378 | + $output .= ' <button type="submit" class="' . $class . '"' . "\n"; |
|
| 379 | + $output .= ' title=""' . "\n"; |
|
| 380 | + $output .= ' >' . $text . '</button>' . "\n"; |
|
| 381 | + $output .= ' </form>' . "\n"; |
|
| 382 | 382 | return $output; |
| 383 | 383 | } |
| 384 | 384 | |
@@ -388,12 +388,12 @@ discard block |
||
| 388 | 388 | // JavaScript variables for room. |
| 389 | 389 | $openingtime = ''; |
| 390 | 390 | if ($bbbsession['openingtime']) { |
| 391 | - $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn').': '. |
|
| 391 | + $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn') . ': ' . |
|
| 392 | 392 | userdate($bbbsession['openingtime']); |
| 393 | 393 | } |
| 394 | 394 | $closingtime = ''; |
| 395 | 395 | if ($bbbsession['closingtime']) { |
| 396 | - $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn').': '. |
|
| 396 | + $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn') . ': ' . |
|
| 397 | 397 | userdate($bbbsession['closingtime']); |
| 398 | 398 | } |
| 399 | 399 | $jsvars += array( |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | $output .= $OUTPUT->box_end(); |
| 411 | 411 | |
| 412 | 412 | $output .= $OUTPUT->box_start('generalbox boxaligncenter', 'bigbluebuttonbn_view_action_button_box'); |
| 413 | - $output .= '<br><br><span id="join_button"></span> <span id="end_button"></span>'."\n"; |
|
| 413 | + $output .= '<br><br><span id="join_button"></span> <span id="end_button"></span>' . "\n"; |
|
| 414 | 414 | $output .= $OUTPUT->box_end(); |
| 415 | 415 | |
| 416 | 416 | if ($activity == 'ended') { |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | |
| 437 | 437 | // Get recordings. |
| 438 | 438 | $recordings = array(); |
| 439 | - if ( bigbluebuttonbn_view_include_recordings($bbbsession) ) { |
|
| 439 | + if (bigbluebuttonbn_view_include_recordings($bbbsession)) { |
|
| 440 | 440 | $recordings = bigbluebuttonbn_get_recordings( |
| 441 | 441 | $bbbsession['course']->id, $bigbluebuttonbnid, $showroom, |
| 442 | 442 | $bbbsession['bigbluebuttonbn']->recordings_deleted |
@@ -467,7 +467,7 @@ discard block |
||
| 467 | 467 | // If there are meetings with recordings load the data to the table. |
| 468 | 468 | if ($bbbsession['bigbluebuttonbn']->recordings_html) { |
| 469 | 469 | // Render a plain html table. |
| 470 | - return bigbluebutton_output_recording_table($bbbsession, $recordings)."\n"; |
|
| 470 | + return bigbluebutton_output_recording_table($bbbsession, $recordings) . "\n"; |
|
| 471 | 471 | } |
| 472 | 472 | |
| 473 | 473 | // JavaScript variables for recordings with YUI. |
@@ -487,8 +487,8 @@ discard block |
||
| 487 | 487 | array('type' => 'button', |
| 488 | 488 | 'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'), |
| 489 | 489 | 'class' => 'btn btn-secondary', |
| 490 | - 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='. |
|
| 491 | - $bbbsession['bigbluebuttonbn']->id.'\'')); |
|
| 490 | + 'onclick' => 'window.location=\'' . $CFG->wwwroot . '/mod/bigbluebuttonbn/import_view.php?bn=' . |
|
| 491 | + $bbbsession['bigbluebuttonbn']->id . '\'')); |
|
| 492 | 492 | $output = html_writer::start_tag('br'); |
| 493 | 493 | $output .= html_writer::tag('span', $button, array('id' => 'import_recording_links_button')); |
| 494 | 494 | $output .= html_writer::tag('span', '', array('id' => 'import_recording_links_table')); |
@@ -503,10 +503,10 @@ discard block |
||
| 503 | 503 | $attributes = array('title' => $bbbsession['presentation']['name']); |
| 504 | 504 | $icon = new pix_icon($bbbsession['presentation']['icon'], $bbbsession['presentation']['mimetype_description']); |
| 505 | 505 | |
| 506 | - return '<h4>'.get_string('view_section_title_presentation', 'bigbluebuttonbn').'</h4>'. |
|
| 507 | - ''.$OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false).''. |
|
| 508 | - ''.$OUTPUT->action_link($bbbsession['presentation']['url'], |
|
| 509 | - $bbbsession['presentation']['name'], null, $attributes).'<br><br>'; |
|
| 506 | + return '<h4>' . get_string('view_section_title_presentation', 'bigbluebuttonbn') . '</h4>' . |
|
| 507 | + '' . $OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false) . '' . |
|
| 508 | + '' . $OUTPUT->action_link($bbbsession['presentation']['url'], |
|
| 509 | + $bbbsession['presentation']['name'], null, $attributes) . '<br><br>'; |
|
| 510 | 510 | } |
| 511 | 511 | |
| 512 | 512 | return ''; |
@@ -301,12 +301,12 @@ |
||
| 301 | 301 | $str = '<div class="bigbluebuttonbn overview">'."\n"; |
| 302 | 302 | $str .= ' <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; |
| 303 | 303 | $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule. |
| 304 | - '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
| 304 | + '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
| 305 | 305 | $str .= ' </div>'."\n"; |
| 306 | 306 | $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime). |
| 307 | 307 | '</div>'."\n"; |
| 308 | 308 | $str .= ' <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) |
| 309 | - .'</div>'."\n"; |
|
| 309 | + .'</div>'."\n"; |
|
| 310 | 310 | $str .= '</div>'."\n"; |
| 311 | 311 | return $str; |
| 312 | 312 | } |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | * $return->time = the time they did it |
| 208 | 208 | * $return->info = a short text description. |
| 209 | 209 | * |
| 210 | - * @return bool |
|
| 210 | + * @return string |
|
| 211 | 211 | */ |
| 212 | 212 | function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) { |
| 213 | 213 | global $DB; |
@@ -488,6 +488,8 @@ discard block |
||
| 488 | 488 | |
| 489 | 489 | /** |
| 490 | 490 | * Helper for validating pluginfile. |
| 491 | + * @param stdClass $context |
|
| 492 | + * @param string $filearea |
|
| 491 | 493 | */ |
| 492 | 494 | function bigbluebuttonbn_pluginfile_valid($context, $filearea) { |
| 493 | 495 | if ($context->contextlevel != CONTEXT_MODULE) { |
@@ -504,6 +506,10 @@ discard block |
||
| 504 | 506 | |
| 505 | 507 | /** |
| 506 | 508 | * Helper for getting pluginfile. |
| 509 | + * @param stdClass $course |
|
| 510 | + * @param stdClass $cm |
|
| 511 | + * @param stdClass $context |
|
| 512 | + * @param string $filearea |
|
| 507 | 513 | */ |
| 508 | 514 | function bigbluebuttonbn_pluginfile_file($course, $cm, $context, $filearea, $args) { |
| 509 | 515 | $filename = bigbluebuttonbn_pluginfile_filename($course, $cm, $context, $args); |
@@ -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 | } |
@@ -84,19 +84,19 @@ discard block |
||
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | $features = array( |
| 87 | - (string) FEATURE_IDNUMBER => true, |
|
| 88 | - (string) FEATURE_GROUPS => true, |
|
| 89 | - (string) FEATURE_GROUPINGS => true, |
|
| 90 | - (string) FEATURE_GROUPMEMBERSONLY => true, |
|
| 91 | - (string) FEATURE_MOD_INTRO => true, |
|
| 92 | - (string) FEATURE_BACKUP_MOODLE2 => true, |
|
| 93 | - (string) FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
| 94 | - (string) FEATURE_GRADE_HAS_GRADE => false, |
|
| 95 | - (string) FEATURE_GRADE_OUTCOMES => false, |
|
| 96 | - (string) FEATURE_SHOW_DESCRIPTION => true, |
|
| 87 | + (string)FEATURE_IDNUMBER => true, |
|
| 88 | + (string)FEATURE_GROUPS => true, |
|
| 89 | + (string)FEATURE_GROUPINGS => true, |
|
| 90 | + (string)FEATURE_GROUPMEMBERSONLY => true, |
|
| 91 | + (string)FEATURE_MOD_INTRO => true, |
|
| 92 | + (string)FEATURE_BACKUP_MOODLE2 => true, |
|
| 93 | + (string)FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
| 94 | + (string)FEATURE_GRADE_HAS_GRADE => false, |
|
| 95 | + (string)FEATURE_GRADE_OUTCOMES => false, |
|
| 96 | + (string)FEATURE_SHOW_DESCRIPTION => true, |
|
| 97 | 97 | ); |
| 98 | 98 | |
| 99 | - if (isset($features[(string) $feature])) { |
|
| 99 | + if (isset($features[(string)$feature])) { |
|
| 100 | 100 | return $features[$feature]; |
| 101 | 101 | } |
| 102 | 102 | |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | $log->timecreated = time(); |
| 190 | 190 | $log->log = BIGBLUEBUTTONBN_LOG_EVENT_DELETE; |
| 191 | 191 | $sql = "SELECT * FROM {bigbluebuttonbn_logs} "; |
| 192 | - $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND ". $DB->sql_compare_text('meta') . " = ?"; |
|
| 192 | + $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND " . $DB->sql_compare_text('meta') . " = ?"; |
|
| 193 | 193 | $logs = $DB->get_records_sql($sql, array($bigbluebuttonbn->id, BIGBLUEBUTTONBN_LOG_EVENT_CREATE, "{\"record\":true}")); |
| 194 | 194 | $log->meta = "{\"has_recordings\":false}"; |
| 195 | 195 | if (!empty($logs)) { |
@@ -212,10 +212,10 @@ discard block |
||
| 212 | 212 | function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) { |
| 213 | 213 | global $DB; |
| 214 | 214 | $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id, |
| 215 | - 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join', ), '*'); |
|
| 215 | + 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join',), '*'); |
|
| 216 | 216 | if ($completed > 0) { |
| 217 | - return fullname($user).' '.get_string('view_message_has_joined', 'bigbluebuttonbn').' '. |
|
| 218 | - get_string('view_message_session_for', 'bigbluebuttonbn').' '.(string) $completed.' '. |
|
| 217 | + return fullname($user) . ' ' . get_string('view_message_has_joined', 'bigbluebuttonbn') . ' ' . |
|
| 218 | + get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string)$completed . ' ' . |
|
| 219 | 219 | get_string('view_message_times', 'bigbluebuttonbn'); |
| 220 | 220 | } |
| 221 | 221 | return ''; |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | function bigbluebuttonbn_user_complete($course, $user, $mod, $bigbluebuttonbn) { |
| 231 | 231 | global $DB; |
| 232 | 232 | $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id, |
| 233 | - 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join', ), |
|
| 233 | + 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join',), |
|
| 234 | 234 | '*', IGNORE_MULTIPLE); |
| 235 | 235 | return $completed > 0; |
| 236 | 236 | } |
@@ -301,16 +301,16 @@ discard block |
||
| 301 | 301 | if ($bigbluebuttonbn->visible) { |
| 302 | 302 | $classes = 'class="dimmed" '; |
| 303 | 303 | } |
| 304 | - $str = '<div class="bigbluebuttonbn overview">'."\n"; |
|
| 305 | - $str .= ' <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; |
|
| 306 | - $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule. |
|
| 307 | - '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
| 308 | - $str .= ' </div>'."\n"; |
|
| 309 | - $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime). |
|
| 310 | - '</div>'."\n"; |
|
| 311 | - $str .= ' <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) |
|
| 312 | - .'</div>'."\n"; |
|
| 313 | - $str .= '</div>'."\n"; |
|
| 304 | + $str = '<div class="bigbluebuttonbn overview">' . "\n"; |
|
| 305 | + $str .= ' <div class="name">' . get_string('modulename', 'bigbluebuttonbn') . ': ' . "\n"; |
|
| 306 | + $str .= ' <a ' . $classes . 'href="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bigbluebuttonbn->coursemodule . |
|
| 307 | + '">' . $bigbluebuttonbn->name . '</a>' . "\n"; |
|
| 308 | + $str .= ' </div>' . "\n"; |
|
| 309 | + $str .= ' <div class="info">' . get_string($start, 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->openingtime) . |
|
| 310 | + '</div>' . "\n"; |
|
| 311 | + $str .= ' <div class="info">' . get_string('ends_at', 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->closingtime) |
|
| 312 | + .'</div>' . "\n"; |
|
| 313 | + $str .= '</div>' . "\n"; |
|
| 314 | 314 | return $str; |
| 315 | 315 | } |
| 316 | 316 | |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | if (count($files) == 1) { |
| 455 | 455 | // Get the first (and only) file. |
| 456 | 456 | $file = reset($files); |
| 457 | - $filesrc = '/'.$file->get_filename(); |
|
| 457 | + $filesrc = '/' . $file->get_filename(); |
|
| 458 | 458 | } |
| 459 | 459 | return $filesrc; |
| 460 | 460 | } |
@@ -510,7 +510,7 @@ discard block |
||
| 510 | 510 | if (!$filename) { |
| 511 | 511 | return false; |
| 512 | 512 | } |
| 513 | - $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename; |
|
| 513 | + $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename; |
|
| 514 | 514 | $fs = get_file_storage(); |
| 515 | 515 | $file = $fs->get_file_by_hash(sha1($fullpath)); |
| 516 | 516 | if (!$file || $file->is_directory()) { |