@@ -137,7 +137,7 @@ |
||
137 | 137 | * Sign a string with a given key and algorithm. |
138 | 138 | * |
139 | 139 | * @param string $msg The message to sign |
140 | - * @param string|resource $key The secret key |
|
140 | + * @param string $key The secret key |
|
141 | 141 | * @param string $alg The signing algorithm. Supported algorithms |
142 | 142 | * are 'HS256', 'HS384', 'HS512' and 'RS256' |
143 | 143 | * |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | throw new DomainException('Algorithm not supported'); |
151 | 151 | } |
152 | 152 | list($function, $algorithm) = self::$supported_algs[$alg]; |
153 | - switch($function) { |
|
153 | + switch ($function) { |
|
154 | 154 | case 'hash_hmac': |
155 | 155 | return hash_hmac($algorithm, $msg, $key, true); |
156 | 156 | case 'openssl': |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | } |
182 | 182 | |
183 | 183 | list($function, $algorithm) = self::$supported_algs[$alg]; |
184 | - switch($function) { |
|
184 | + switch ($function) { |
|
185 | 185 | case 'openssl': |
186 | 186 | $success = openssl_verify($msg, $signature, $key, $algorithm); |
187 | 187 | if (!$success) { |
@@ -228,8 +228,8 @@ discard block |
||
228 | 228 | * manually detect large ints in the JSON string and quote them (thus converting |
229 | 229 | *them to strings) before decoding, hence the preg_replace() call. |
230 | 230 | */ |
231 | - $max_int_length = strlen((string) PHP_INT_MAX) - 1; |
|
232 | - $json_without_bigints = preg_replace('/:\s*(-?\d{'.$max_int_length.',})/', ': "$1"', $input); |
|
231 | + $max_int_length = strlen((string)PHP_INT_MAX) - 1; |
|
232 | + $json_without_bigints = preg_replace('/:\s*(-?\d{' . $max_int_length . ',})/', ': "$1"', $input); |
|
233 | 233 | $obj = json_decode($json_without_bigints); |
234 | 234 | } |
235 | 235 |
@@ -66,7 +66,6 @@ discard block |
||
66 | 66 | * will create a new instance and return the id number |
67 | 67 | * of the new instance. |
68 | 68 | * |
69 | - * @param object $bigbluebuttonbn An object from the form in mod_form.php |
|
70 | 69 | * @return int The id of the newly inserted bigbluebuttonbn record |
71 | 70 | */ |
72 | 71 | function bigbluebuttonbn_add_instance($data, $mform) { |
@@ -93,7 +92,6 @@ discard block |
||
93 | 92 | * (defined by the form in mod_form.php) this function |
94 | 93 | * will update an existing instance with new data. |
95 | 94 | * |
96 | - * @param object $bigbluebuttonbn An object from the form in mod_form.php |
|
97 | 95 | * @return boolean Success/Fail |
98 | 96 | */ |
99 | 97 | function bigbluebuttonbn_update_instance($data, $mform) { |
@@ -162,7 +160,7 @@ discard block |
||
162 | 160 | * $return->time = the time they did it |
163 | 161 | * $return->info = a short text description |
164 | 162 | * |
165 | - * @return null |
|
163 | + * @return boolean |
|
166 | 164 | */ |
167 | 165 | function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) { |
168 | 166 | return true; |
@@ -230,7 +228,7 @@ discard block |
||
230 | 228 | * See other modules as example. |
231 | 229 | * |
232 | 230 | * @param int $bigbluebuttonbnid ID of an instance of this module |
233 | - * @return mixed boolean/array of students |
|
231 | + * @return boolean boolean/array of students |
|
234 | 232 | */ |
235 | 233 | function bigbluebuttonbn_get_participants($bigbluebuttonbnid) { |
236 | 234 | return false; |
@@ -238,7 +236,7 @@ discard block |
||
238 | 236 | |
239 | 237 | /** |
240 | 238 | * Returns all other caps used in module |
241 | - * @return array |
|
239 | + * @return string[] |
|
242 | 240 | */ |
243 | 241 | function bigbluebuttonbn_get_extra_capabilities() { |
244 | 242 | return array('moodle/site:accessallgroups'); |
@@ -255,7 +253,7 @@ discard block |
||
255 | 253 | * as reference. |
256 | 254 | * |
257 | 255 | * @param int $bigbluebuttonbnid ID of an instance of this module |
258 | - * @return mixed |
|
256 | + * @return boolean |
|
259 | 257 | */ |
260 | 258 | function bigbluebuttonbn_scale_used($bigbluebuttonbnid, $scaleid) { |
261 | 259 | $return = false; |
@@ -288,7 +286,7 @@ discard block |
||
288 | 286 | |
289 | 287 | /** |
290 | 288 | * List of view style log actions |
291 | - * @return array |
|
289 | + * @return string[] |
|
292 | 290 | */ |
293 | 291 | function bigbluebuttonbn_get_view_actions() { |
294 | 292 | return array('view', 'view all'); |
@@ -296,7 +294,7 @@ discard block |
||
296 | 294 | |
297 | 295 | /** |
298 | 296 | * List of update style log actions |
299 | - * @return array |
|
297 | + * @return string[] |
|
300 | 298 | */ |
301 | 299 | function bigbluebuttonbn_get_post_actions() { |
302 | 300 | return array('update', 'add', 'create', 'join', 'end', 'left', 'publish', 'unpublish', 'delete'); |
@@ -310,7 +308,7 @@ discard block |
||
310 | 308 | * |
311 | 309 | * @global object |
312 | 310 | * @param object $coursemodule |
313 | - * @return object|null |
|
311 | + * @return null|cached_cm_info |
|
314 | 312 | */ |
315 | 313 | function bigbluebuttonbn_get_coursemodule_info($coursemodule) { |
316 | 314 | global $CFG, $DB; |
@@ -502,7 +500,7 @@ discard block |
||
502 | 500 | * @param array $args extra arguments |
503 | 501 | * @param bool $forcedownload whether or not force download |
504 | 502 | * @param array $options additional options affecting the file serving |
505 | - * @return bool false if file not found, does not return if found - justsend the file |
|
503 | + * @return false|null false if file not found, does not return if found - justsend the file |
|
506 | 504 | */ |
507 | 505 | function bigbluebuttonbn_pluginfile($course, $cm, $context, $filearea, $args, $forcedownload, array $options=array()) { |
508 | 506 | global $CFG, $DB; |
@@ -206,7 +206,6 @@ |
||
206 | 206 | |
207 | 207 | /** |
208 | 208 | * Prints single activity item prepared by {@see recordingsbn_get_recent_mod_activity()} |
209 | - |
|
210 | 209 | * @return void |
211 | 210 | */ |
212 | 211 | function bigbluebuttonbn_print_recent_mod_activity($activity, $courseid, $detail, $modnames, $viewfullnames) { |
@@ -13,21 +13,21 @@ discard block |
||
13 | 13 | |
14 | 14 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
15 | 15 | |
16 | -require_once($CFG->dirroot.'/calendar/lib.php'); |
|
17 | -require_once($CFG->dirroot.'/message/lib.php'); |
|
18 | -require_once($CFG->dirroot.'/lib/accesslib.php'); |
|
19 | -require_once($CFG->dirroot.'/lib/filelib.php'); |
|
20 | -require_once($CFG->dirroot.'/lib/formslib.php'); |
|
21 | -require_once($CFG->dirroot.'/mod/lti/OAuth.php'); |
|
22 | -require_once($CFG->libdir.'/accesslib.php'); |
|
23 | -require_once($CFG->libdir.'/completionlib.php'); |
|
24 | -require_once($CFG->libdir.'/datalib.php'); |
|
25 | -require_once(dirname(__FILE__).'/JWT.php'); |
|
26 | - |
|
27 | -if( file_exists(dirname(__FILE__).'/config.php') ) { |
|
28 | - require_once(dirname(__FILE__).'/config.php'); |
|
29 | - if( isset($BIGBLUEBUTTONBN_CFG) ) { |
|
30 | - $CFG = (object) array_merge((array)$CFG, (array)$BIGBLUEBUTTONBN_CFG); |
|
16 | +require_once($CFG->dirroot . '/calendar/lib.php'); |
|
17 | +require_once($CFG->dirroot . '/message/lib.php'); |
|
18 | +require_once($CFG->dirroot . '/lib/accesslib.php'); |
|
19 | +require_once($CFG->dirroot . '/lib/filelib.php'); |
|
20 | +require_once($CFG->dirroot . '/lib/formslib.php'); |
|
21 | +require_once($CFG->dirroot . '/mod/lti/OAuth.php'); |
|
22 | +require_once($CFG->libdir . '/accesslib.php'); |
|
23 | +require_once($CFG->libdir . '/completionlib.php'); |
|
24 | +require_once($CFG->libdir . '/datalib.php'); |
|
25 | +require_once(dirname(__FILE__) . '/JWT.php'); |
|
26 | + |
|
27 | +if (file_exists(dirname(__FILE__) . '/config.php')) { |
|
28 | + require_once(dirname(__FILE__) . '/config.php'); |
|
29 | + if (isset($BIGBLUEBUTTONBN_CFG)) { |
|
30 | + $CFG = (object)array_merge((array)$CFG, (array)$BIGBLUEBUTTONBN_CFG); |
|
31 | 31 | } |
32 | 32 | } else { |
33 | 33 | $BIGBLUEBUTTONBN_CFG = new stdClass(); |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | |
45 | 45 | function bigbluebuttonbn_supports($feature) { |
46 | - switch($feature) { |
|
46 | + switch ($feature) { |
|
47 | 47 | case FEATURE_IDNUMBER: return true; |
48 | 48 | case FEATURE_GROUPS: return true; |
49 | 49 | case FEATURE_GROUPINGS: return true; |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | function bigbluebuttonbn_add_instance($data, $mform) { |
73 | 73 | global $DB, $CFG; |
74 | 74 | |
75 | - $draftitemid = isset($data->presentation)? $data->presentation: null; |
|
75 | + $draftitemid = isset($data->presentation) ? $data->presentation : null; |
|
76 | 76 | $context = bigbluebuttonbn_get_context_module($data->coursemodule); |
77 | 77 | |
78 | 78 | bigbluebuttonbn_process_pre_save($data); |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | global $DB, $CFG; |
101 | 101 | |
102 | 102 | $data->id = $data->instance; |
103 | - $draftitemid = isset($data->presentation)? $data->presentation: null; |
|
103 | + $draftitemid = isset($data->presentation) ? $data->presentation : null; |
|
104 | 104 | $context = bigbluebuttonbn_get_context_module($data->coursemodule); |
105 | 105 | |
106 | 106 | bigbluebuttonbn_process_pre_save($data); |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | function bigbluebuttonbn_delete_instance($id) { |
127 | 127 | global $CFG, $DB; |
128 | 128 | |
129 | - if (! $bigbluebuttonbn = $DB->get_record('bigbluebuttonbn', array('id' => $id))) { |
|
129 | + if (!$bigbluebuttonbn = $DB->get_record('bigbluebuttonbn', array('id' => $id))) { |
|
130 | 130 | return false; |
131 | 131 | } |
132 | 132 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | // |
136 | 136 | // End the session associated with this instance (if it's running) |
137 | 137 | // |
138 | - $meetingID = $bigbluebuttonbn->meetingid.'-'.$bigbluebuttonbn->course.'-'.$bigbluebuttonbn->id; |
|
138 | + $meetingID = $bigbluebuttonbn->meetingid . '-' . $bigbluebuttonbn->course . '-' . $bigbluebuttonbn->id; |
|
139 | 139 | |
140 | 140 | $modPW = $bigbluebuttonbn->moderatorpass; |
141 | 141 | $url = bigbluebuttonbn_get_cfg_server_url(); |
@@ -144,11 +144,11 @@ discard block |
||
144 | 144 | //if( bigbluebuttonbn_isMeetingRunning($meetingID, $url, $shared_secret) ) |
145 | 145 | // $getArray = bigbluebuttonbn_doEndMeeting( $meetingID, $modPW, $url, $shared_secret ); |
146 | 146 | |
147 | - if (! $DB->delete_records('bigbluebuttonbn', array('id' => $bigbluebuttonbn->id))) { |
|
147 | + if (!$DB->delete_records('bigbluebuttonbn', array('id' => $bigbluebuttonbn->id))) { |
|
148 | 148 | $result = false; |
149 | 149 | } |
150 | 150 | |
151 | - if (! $DB->delete_records('event', array('modulename'=>'bigbluebuttonbn', 'instance'=>$bigbluebuttonbn->id))) { |
|
151 | + if (!$DB->delete_records('event', array('modulename'=>'bigbluebuttonbn', 'instance'=>$bigbluebuttonbn->id))) { |
|
152 | 152 | $result = false; |
153 | 153 | } |
154 | 154 | |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | * @return boolean |
187 | 187 | */ |
188 | 188 | function bigbluebuttonbn_print_recent_activity($course, $isteacher, $timestart) { |
189 | - return false; // True if anything was printed, otherwise false |
|
189 | + return false; // True if anything was printed, otherwise false |
|
190 | 190 | } |
191 | 191 | |
192 | 192 | /** |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | * @param int $groupid defaults to 0 |
202 | 202 | * @return void adds items into $activities and increases $index |
203 | 203 | */ |
204 | -function bigbluebuttonbn_get_recent_mod_activity(&$activities, &$index, $timestart, $courseid, $cmid, $userid=0, $groupid=0) { |
|
204 | +function bigbluebuttonbn_get_recent_mod_activity(&$activities, &$index, $timestart, $courseid, $cmid, $userid = 0, $groupid = 0) { |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | /** |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | * |
220 | 220 | * @return boolean |
221 | 221 | **/ |
222 | -function bigbluebuttonbn_cron () { |
|
222 | +function bigbluebuttonbn_cron() { |
|
223 | 223 | return true; |
224 | 224 | } |
225 | 225 | |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | function bigbluebuttonbn_get_coursemodule_info($coursemodule) { |
316 | 316 | global $CFG, $DB; |
317 | 317 | |
318 | - if ( !$bigbluebuttonbn = $DB->get_record('bigbluebuttonbn', array('id'=>$coursemodule->instance), 'id, name, intro, introformat, newwindow')) { |
|
318 | + if (!$bigbluebuttonbn = $DB->get_record('bigbluebuttonbn', array('id'=>$coursemodule->instance), 'id, name, intro, introformat, newwindow')) { |
|
319 | 319 | return NULL; |
320 | 320 | } |
321 | 321 | |
@@ -341,10 +341,10 @@ discard block |
||
341 | 341 | function bigbluebuttonbn_process_pre_save(&$bigbluebuttonbn) { |
342 | 342 | global $DB, $CFG; |
343 | 343 | |
344 | - if ( !isset($bigbluebuttonbn->timecreated) || !$bigbluebuttonbn->timecreated ) { |
|
344 | + if (!isset($bigbluebuttonbn->timecreated) || !$bigbluebuttonbn->timecreated) { |
|
345 | 345 | $bigbluebuttonbn->timecreated = time(); |
346 | 346 | //Assign password only if it is a new activity |
347 | - if( isset($bigbluebuttonbn->add) && !empty($bigbluebuttonbn->add) ) { |
|
347 | + if (isset($bigbluebuttonbn->add) && !empty($bigbluebuttonbn->add)) { |
|
348 | 348 | $bigbluebuttonbn->moderatorpass = bigbluebuttonbn_random_password(12); |
349 | 349 | $bigbluebuttonbn->viewerpass = bigbluebuttonbn_random_password(12); |
350 | 350 | } |
@@ -353,13 +353,13 @@ discard block |
||
353 | 353 | $bigbluebuttonbn->timemodified = time(); |
354 | 354 | } |
355 | 355 | |
356 | - if (! isset($bigbluebuttonbn->newwindow)) |
|
356 | + if (!isset($bigbluebuttonbn->newwindow)) |
|
357 | 357 | $bigbluebuttonbn->newwindow = 0; |
358 | - if (! isset($bigbluebuttonbn->wait)) |
|
358 | + if (!isset($bigbluebuttonbn->wait)) |
|
359 | 359 | $bigbluebuttonbn->wait = 0; |
360 | - if (! isset($bigbluebuttonbn->record)) |
|
360 | + if (!isset($bigbluebuttonbn->record)) |
|
361 | 361 | $bigbluebuttonbn->record = 0; |
362 | - if (! isset($bigbluebuttonbn->tagging)) |
|
362 | + if (!isset($bigbluebuttonbn->tagging)) |
|
363 | 363 | $bigbluebuttonbn->tagging = 0; |
364 | 364 | |
365 | 365 | $bigbluebuttonbn->participants = htmlspecialchars_decode($bigbluebuttonbn->participants); |
@@ -378,8 +378,8 @@ discard block |
||
378 | 378 | |
379 | 379 | // Now that an id was assigned, generate and set the meetingid property based on |
380 | 380 | // [Moodle Instance + Activity ID + BBB Secret] (but only for new activities) |
381 | - if( isset($bigbluebuttonbn->add) && !empty($bigbluebuttonbn->add) ) { |
|
382 | - $bigbluebuttonbn_meetingid = sha1($CFG->wwwroot.$bigbluebuttonbn->id.bigbluebuttonbn_get_cfg_shared_secret()); |
|
381 | + if (isset($bigbluebuttonbn->add) && !empty($bigbluebuttonbn->add)) { |
|
382 | + $bigbluebuttonbn_meetingid = sha1($CFG->wwwroot . $bigbluebuttonbn->id . bigbluebuttonbn_get_cfg_shared_secret()); |
|
383 | 383 | $DB->set_field('bigbluebuttonbn', 'meetingid', $bigbluebuttonbn_meetingid, array('id' => $bigbluebuttonbn->id)); |
384 | 384 | $action = get_string('mod_form_field_notification_msg_created', 'bigbluebuttonbn'); |
385 | 385 | } else { |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | $at = get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn'); |
389 | 389 | |
390 | 390 | // Add evento to the calendar when if openingtime is set |
391 | - if ( isset($bigbluebuttonbn->openingtime) && $bigbluebuttonbn->openingtime ){ |
|
391 | + if (isset($bigbluebuttonbn->openingtime) && $bigbluebuttonbn->openingtime) { |
|
392 | 392 | $event = new stdClass(); |
393 | 393 | $event->name = $bigbluebuttonbn->name; |
394 | 394 | $event->courseid = $bigbluebuttonbn->course; |
@@ -398,13 +398,13 @@ discard block |
||
398 | 398 | $event->instance = $bigbluebuttonbn->id; |
399 | 399 | $event->timestart = $bigbluebuttonbn->openingtime; |
400 | 400 | |
401 | - if ( $bigbluebuttonbn->closingtime ){ |
|
401 | + if ($bigbluebuttonbn->closingtime) { |
|
402 | 402 | $event->durationtime = $bigbluebuttonbn->closingtime - $bigbluebuttonbn->openingtime; |
403 | 403 | } else { |
404 | 404 | $event->durationtime = 0; |
405 | 405 | } |
406 | 406 | |
407 | - if ( $event->id = $DB->get_field('event', 'id', array('modulename'=>'bigbluebuttonbn', 'instance'=>$bigbluebuttonbn->id)) ) { |
|
407 | + if ($event->id = $DB->get_field('event', 'id', array('modulename'=>'bigbluebuttonbn', 'instance'=>$bigbluebuttonbn->id))) { |
|
408 | 408 | $calendarevent = calendar_event::load($event->id); |
409 | 409 | $calendarevent->update($event); |
410 | 410 | } else { |
@@ -415,45 +415,45 @@ discard block |
||
415 | 415 | $DB->delete_records('event', array('modulename'=>'bigbluebuttonbn', 'instance'=>$bigbluebuttonbn->id)); |
416 | 416 | } |
417 | 417 | |
418 | - if( isset($bigbluebuttonbn->notification) && $bigbluebuttonbn->notification ) { |
|
418 | + if (isset($bigbluebuttonbn->notification) && $bigbluebuttonbn->notification) { |
|
419 | 419 | // Prepare message |
420 | 420 | $msg = new stdClass(); |
421 | 421 | |
422 | 422 | /// Build the message_body |
423 | 423 | $msg->action = $action; |
424 | 424 | $msg->activity_type = ""; |
425 | - if( isset($bigbluebuttonbn->type) && $bigbluebuttonbn->type != 0 ) |
|
425 | + if (isset($bigbluebuttonbn->type) && $bigbluebuttonbn->type != 0) |
|
426 | 426 | $msg->activity_type = bigbluebuttonbn_get_predefinedprofile_name($bigbluebuttonbn->type); |
427 | 427 | $msg->activity_title = $bigbluebuttonbn->name; |
428 | - $message_text = '<p>'.$msg->activity_type.' "'.$msg->activity_title.'" '.get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn').' '.$msg->action.'.</p>'; |
|
428 | + $message_text = '<p>' . $msg->activity_type . ' "' . $msg->activity_title . '" ' . get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn') . ' ' . $msg->action . '.</p>'; |
|
429 | 429 | |
430 | 430 | /// Add the meeting details to the message_body |
431 | 431 | $msg->action = ucfirst($action); |
432 | 432 | $msg->activity_description = ""; |
433 | - if( !empty($bigbluebuttonbn->intro) ) |
|
433 | + if (!empty($bigbluebuttonbn->intro)) |
|
434 | 434 | $msg->activity_description = trim($bigbluebuttonbn->intro); |
435 | 435 | $msg->activity_openingtime = ""; |
436 | 436 | if ($bigbluebuttonbn->openingtime) { |
437 | - $msg->activity_openingtime = calendar_day_representation($bigbluebuttonbn->openingtime).' '.$at.' '.calendar_time_representation($bigbluebuttonbn->openingtime); |
|
437 | + $msg->activity_openingtime = calendar_day_representation($bigbluebuttonbn->openingtime) . ' ' . $at . ' ' . calendar_time_representation($bigbluebuttonbn->openingtime); |
|
438 | 438 | } |
439 | 439 | $msg->activity_closingtime = ""; |
440 | - if ($bigbluebuttonbn->closingtime ) { |
|
441 | - $msg->activity_closingtime = calendar_day_representation($bigbluebuttonbn->closingtime).' '.$at.' '.calendar_time_representation($bigbluebuttonbn->closingtime); |
|
440 | + if ($bigbluebuttonbn->closingtime) { |
|
441 | + $msg->activity_closingtime = calendar_day_representation($bigbluebuttonbn->closingtime) . ' ' . $at . ' ' . calendar_time_representation($bigbluebuttonbn->closingtime); |
|
442 | 442 | } |
443 | - $msg->activity_owner = $USER->firstname.' '.$USER->lastname; |
|
443 | + $msg->activity_owner = $USER->firstname . ' ' . $USER->lastname; |
|
444 | 444 | |
445 | - $message_text .= '<p><b>'.$msg->activity_title.'</b> '.get_string('email_body_notification_meeting_details', 'bigbluebuttonbn').':'; |
|
445 | + $message_text .= '<p><b>' . $msg->activity_title . '</b> ' . get_string('email_body_notification_meeting_details', 'bigbluebuttonbn') . ':'; |
|
446 | 446 | $message_text .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>'; |
447 | - $message_text .= '<tr><td style="font-weight:bold;color:#555;">'.get_string('email_body_notification_meeting_title', 'bigbluebuttonbn').': </td><td>'; |
|
448 | - $message_text .= $msg->activity_title.'</td></tr>'; |
|
449 | - $message_text .= '<tr><td style="font-weight:bold;color:#555;">'.get_string('email_body_notification_meeting_description', 'bigbluebuttonbn').': </td><td>'; |
|
450 | - $message_text .= $msg->activity_description.'</td></tr>'; |
|
451 | - $message_text .= '<tr><td style="font-weight:bold;color:#555;">'.get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn').': </td><td>'; |
|
452 | - $message_text .= $msg->activity_openingtime.'</td></tr>'; |
|
453 | - $message_text .= '<tr><td style="font-weight:bold;color:#555;">'.get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn').': </td><td>'; |
|
454 | - $message_text .= $msg->activity_closingtime.'</td></tr>'; |
|
455 | - $message_text .= '<tr><td style="font-weight:bold;color:#555;">'.$msg->action.' '.get_string('email_body_notification_meeting_by', 'bigbluebuttonbn').': </td><td>'; |
|
456 | - $message_text .= $msg->activity_owner.'</td></tr></tbody></table></p>'; |
|
447 | + $message_text .= '<tr><td style="font-weight:bold;color:#555;">' . get_string('email_body_notification_meeting_title', 'bigbluebuttonbn') . ': </td><td>'; |
|
448 | + $message_text .= $msg->activity_title . '</td></tr>'; |
|
449 | + $message_text .= '<tr><td style="font-weight:bold;color:#555;">' . get_string('email_body_notification_meeting_description', 'bigbluebuttonbn') . ': </td><td>'; |
|
450 | + $message_text .= $msg->activity_description . '</td></tr>'; |
|
451 | + $message_text .= '<tr><td style="font-weight:bold;color:#555;">' . get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn') . ': </td><td>'; |
|
452 | + $message_text .= $msg->activity_openingtime . '</td></tr>'; |
|
453 | + $message_text .= '<tr><td style="font-weight:bold;color:#555;">' . get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn') . ': </td><td>'; |
|
454 | + $message_text .= $msg->activity_closingtime . '</td></tr>'; |
|
455 | + $message_text .= '<tr><td style="font-weight:bold;color:#555;">' . $msg->action . ' ' . get_string('email_body_notification_meeting_by', 'bigbluebuttonbn') . ': </td><td>'; |
|
456 | + $message_text .= $msg->activity_owner . '</td></tr></tbody></table></p>'; |
|
457 | 457 | |
458 | 458 | // Send notification to all users enrolled |
459 | 459 | bigbluebuttonbn_send_notification($USER, $bigbluebuttonbn, $message_text); |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | * @param array $options additional options affecting the file serving |
505 | 505 | * @return bool false if file not found, does not return if found - justsend the file |
506 | 506 | */ |
507 | -function bigbluebuttonbn_pluginfile($course, $cm, $context, $filearea, $args, $forcedownload, array $options=array()) { |
|
507 | +function bigbluebuttonbn_pluginfile($course, $cm, $context, $filearea, $args, $forcedownload, array $options = array()) { |
|
508 | 508 | global $CFG, $DB; |
509 | 509 | |
510 | 510 | if ($context->contextlevel != CONTEXT_MODULE) { |
@@ -520,21 +520,21 @@ discard block |
||
520 | 520 | return false; |
521 | 521 | } |
522 | 522 | |
523 | - if( sizeof($args) > 1 ) { |
|
523 | + if (sizeof($args) > 1) { |
|
524 | 524 | $cache = cache::make_from_params(cache_store::MODE_APPLICATION, 'mod_bigbluebuttonbn', 'presentation_cache'); |
525 | 525 | $presentation_nonce_key = sha1($bigbluebuttonbn->id); |
526 | 526 | $presentation_nonce = $cache->get($presentation_nonce_key); |
527 | 527 | $presentation_nonce_value = $presentation_nonce['value']; |
528 | 528 | $presentation_nonce_counter = $presentation_nonce['counter']; |
529 | 529 | |
530 | - if( $args["0"] != $presentation_nonce_value ) { |
|
530 | + if ($args["0"] != $presentation_nonce_value) { |
|
531 | 531 | return false; |
532 | 532 | } |
533 | 533 | |
534 | 534 | //The nonce value is actually used twice because BigBlueButton reads the file two times |
535 | 535 | $presentation_nonce_counter += 1; |
536 | - if( $presentation_nonce_counter < 2 ) { |
|
537 | - $cache->set($presentation_nonce_key, array( "value" => $presentation_nonce_value, "counter" => $presentation_nonce_counter )); |
|
536 | + if ($presentation_nonce_counter < 2) { |
|
537 | + $cache->set($presentation_nonce_key, array("value" => $presentation_nonce_value, "counter" => $presentation_nonce_counter)); |
|
538 | 538 | } else { |
539 | 539 | $cache->delete($presentation_nonce_key); |
540 | 540 | } |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | } |
553 | 553 | |
554 | 554 | if ($filearea === 'presentation') { |
555 | - $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename; |
|
555 | + $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename; |
|
556 | 556 | } else { |
557 | 557 | return false; |
558 | 558 | } |
@@ -586,10 +586,10 @@ discard block |
||
586 | 586 | * @package mod_bigbluebuttonbn |
587 | 587 | * @return array a list of available roles |
588 | 588 | */ |
589 | -function bigbluebuttonbn_get_db_moodle_roles($rolename='all') { |
|
589 | +function bigbluebuttonbn_get_db_moodle_roles($rolename = 'all') { |
|
590 | 590 | global $DB; |
591 | 591 | |
592 | - if( $rolename != 'all') |
|
592 | + if ($rolename != 'all') |
|
593 | 593 | $roles = $DB->get_record('role', array('shortname' => $rolename)); |
594 | 594 | else |
595 | 595 | $roles = $DB->get_records('role', array()); |
@@ -608,22 +608,22 @@ discard block |
||
608 | 608 | |
609 | 609 | $roles = bigbluebuttonbn_get_db_moodle_roles(); |
610 | 610 | $sqluserids = array(); |
611 | - foreach($roles as $role){ |
|
611 | + foreach ($roles as $role) { |
|
612 | 612 | $users = get_role_users($role->id, $context); |
613 | - foreach($users as $user) { |
|
613 | + foreach ($users as $user) { |
|
614 | 614 | array_push($sqluserids, $user->id); |
615 | 615 | } |
616 | 616 | } |
617 | 617 | |
618 | 618 | $users_array = array(); |
619 | - if( !empty($sqluserids) ) { |
|
619 | + if (!empty($sqluserids)) { |
|
620 | 620 | $users_array = $DB->get_records_select("user", "id IN (" . implode(', ', $sqluserids) . ") AND deleted = 0"); |
621 | 621 | } |
622 | 622 | |
623 | 623 | return $users_array; |
624 | 624 | } |
625 | 625 | |
626 | -function bigbluebuttonbn_send_notification($sender, $bigbluebuttonbn, $message="") { |
|
626 | +function bigbluebuttonbn_send_notification($sender, $bigbluebuttonbn, $message = "") { |
|
627 | 627 | global $CFG, $DB; |
628 | 628 | |
629 | 629 | $context = bigbluebuttonbn_get_context_course($bigbluebuttonbn->course); |
@@ -631,19 +631,19 @@ discard block |
||
631 | 631 | |
632 | 632 | //Complete message |
633 | 633 | $msg = new stdClass(); |
634 | - $msg->user_name = $sender->firstname.' '.$sender->lastname; |
|
634 | + $msg->user_name = $sender->firstname . ' ' . $sender->lastname; |
|
635 | 635 | $msg->user_email = $sender->email; |
636 | 636 | $msg->course_name = "$course->fullname"; |
637 | - $message .= '<p><hr/><br/>'.get_string('email_footer_sent_by', 'bigbluebuttonbn').' '.$msg->user_name.'('.$msg->user_email.') '; |
|
638 | - $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn').' '.$msg->course_name.'.</p>'; |
|
637 | + $message .= '<p><hr/><br/>' . get_string('email_footer_sent_by', 'bigbluebuttonbn') . ' ' . $msg->user_name . '(' . $msg->user_email . ') '; |
|
638 | + $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn') . ' ' . $msg->course_name . '.</p>'; |
|
639 | 639 | |
640 | 640 | $users = bigbluebuttonbn_get_users($context); |
641 | - foreach( $users as $user ) { |
|
642 | - if( $user->id != $sender->id ){ |
|
643 | - error_log("Sending msg to ".$user->firstname." ".$user->lastname."."); |
|
641 | + foreach ($users as $user) { |
|
642 | + if ($user->id != $sender->id) { |
|
643 | + error_log("Sending msg to " . $user->firstname . " " . $user->lastname . "."); |
|
644 | 644 | $messageid = message_post_message($sender, $user, $message, FORMAT_HTML); |
645 | 645 | if (!empty($messageid)) { |
646 | - error_log("Msg sent to ".$user->firstname." ".$user->lastname."."); |
|
646 | + error_log("Msg sent to " . $user->firstname . " " . $user->lastname . "."); |
|
647 | 647 | } else { |
648 | 648 | error_log("Msg was NOT sent."); |
649 | 649 | } |
@@ -655,7 +655,7 @@ discard block |
||
655 | 655 | global $CFG; |
656 | 656 | |
657 | 657 | $version_major = bigbluebuttonbn_get_moodle_version_major(); |
658 | - if ( $version_major < '2013111800' ) { |
|
658 | + if ($version_major < '2013111800') { |
|
659 | 659 | //This is valid before v2.6 |
660 | 660 | $context = get_context_instance(CONTEXT_MODULE, $id); |
661 | 661 | } else { |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | global $CFG; |
671 | 671 | |
672 | 672 | $version_major = bigbluebuttonbn_get_moodle_version_major(); |
673 | - if ( $version_major < '2013111800' ) { |
|
673 | + if ($version_major < '2013111800') { |
|
674 | 674 | //This is valid before v2.6 |
675 | 675 | $context = get_context_instance(CONTEXT_COURSE, $id); |
676 | 676 | } else { |
@@ -683,11 +683,11 @@ discard block |
||
683 | 683 | |
684 | 684 | function bigbluebuttonbn_get_cfg_server_url() { |
685 | 685 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
686 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_server_url)? trim(trim($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_server_url),'/').'/': (isset($CFG->bigbluebuttonbn_server_url)? trim(trim($CFG->bigbluebuttonbn_server_url),'/').'/': 'http://test-install.blindsidenetworks.com/bigbluebutton/')); |
|
686 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_server_url) ? trim(trim($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_server_url), '/') . '/' : (isset($CFG->bigbluebuttonbn_server_url) ? trim(trim($CFG->bigbluebuttonbn_server_url), '/') . '/' : 'http://test-install.blindsidenetworks.com/bigbluebutton/')); |
|
687 | 687 | } |
688 | 688 | |
689 | 689 | function bigbluebuttonbn_get_cfg_shared_secret() { |
690 | 690 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
691 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_shared_secret)? trim($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_shared_secret): (isset($CFG->bigbluebuttonbn_shared_secret)? trim($CFG->bigbluebuttonbn_shared_secret): '8cd8ef52e8e101574e400365b55e11a6')); |
|
691 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_shared_secret) ? trim($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_shared_secret) : (isset($CFG->bigbluebuttonbn_shared_secret) ? trim($CFG->bigbluebuttonbn_shared_secret) : '8cd8ef52e8e101574e400365b55e11a6')); |
|
692 | 692 | } |
693 | 693 |
@@ -353,14 +353,18 @@ discard block |
||
353 | 353 | $bigbluebuttonbn->timemodified = time(); |
354 | 354 | } |
355 | 355 | |
356 | - if (! isset($bigbluebuttonbn->newwindow)) |
|
357 | - $bigbluebuttonbn->newwindow = 0; |
|
358 | - if (! isset($bigbluebuttonbn->wait)) |
|
359 | - $bigbluebuttonbn->wait = 0; |
|
360 | - if (! isset($bigbluebuttonbn->record)) |
|
361 | - $bigbluebuttonbn->record = 0; |
|
362 | - if (! isset($bigbluebuttonbn->tagging)) |
|
363 | - $bigbluebuttonbn->tagging = 0; |
|
356 | + if (! isset($bigbluebuttonbn->newwindow)) { |
|
357 | + $bigbluebuttonbn->newwindow = 0; |
|
358 | + } |
|
359 | + if (! isset($bigbluebuttonbn->wait)) { |
|
360 | + $bigbluebuttonbn->wait = 0; |
|
361 | + } |
|
362 | + if (! isset($bigbluebuttonbn->record)) { |
|
363 | + $bigbluebuttonbn->record = 0; |
|
364 | + } |
|
365 | + if (! isset($bigbluebuttonbn->tagging)) { |
|
366 | + $bigbluebuttonbn->tagging = 0; |
|
367 | + } |
|
364 | 368 | |
365 | 369 | $bigbluebuttonbn->participants = htmlspecialchars_decode($bigbluebuttonbn->participants); |
366 | 370 | } |
@@ -422,16 +426,18 @@ discard block |
||
422 | 426 | /// Build the message_body |
423 | 427 | $msg->action = $action; |
424 | 428 | $msg->activity_type = ""; |
425 | - if( isset($bigbluebuttonbn->type) && $bigbluebuttonbn->type != 0 ) |
|
426 | - $msg->activity_type = bigbluebuttonbn_get_predefinedprofile_name($bigbluebuttonbn->type); |
|
429 | + if( isset($bigbluebuttonbn->type) && $bigbluebuttonbn->type != 0 ) { |
|
430 | + $msg->activity_type = bigbluebuttonbn_get_predefinedprofile_name($bigbluebuttonbn->type); |
|
431 | + } |
|
427 | 432 | $msg->activity_title = $bigbluebuttonbn->name; |
428 | 433 | $message_text = '<p>'.$msg->activity_type.' "'.$msg->activity_title.'" '.get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn').' '.$msg->action.'.</p>'; |
429 | 434 | |
430 | 435 | /// Add the meeting details to the message_body |
431 | 436 | $msg->action = ucfirst($action); |
432 | 437 | $msg->activity_description = ""; |
433 | - if( !empty($bigbluebuttonbn->intro) ) |
|
434 | - $msg->activity_description = trim($bigbluebuttonbn->intro); |
|
438 | + if( !empty($bigbluebuttonbn->intro) ) { |
|
439 | + $msg->activity_description = trim($bigbluebuttonbn->intro); |
|
440 | + } |
|
435 | 441 | $msg->activity_openingtime = ""; |
436 | 442 | if ($bigbluebuttonbn->openingtime) { |
437 | 443 | $msg->activity_openingtime = calendar_day_representation($bigbluebuttonbn->openingtime).' '.$at.' '.calendar_time_representation($bigbluebuttonbn->openingtime); |
@@ -589,10 +595,11 @@ discard block |
||
589 | 595 | function bigbluebuttonbn_get_db_moodle_roles($rolename='all') { |
590 | 596 | global $DB; |
591 | 597 | |
592 | - if( $rolename != 'all') |
|
593 | - $roles = $DB->get_record('role', array('shortname' => $rolename)); |
|
594 | - else |
|
595 | - $roles = $DB->get_records('role', array()); |
|
598 | + if( $rolename != 'all') { |
|
599 | + $roles = $DB->get_record('role', array('shortname' => $rolename)); |
|
600 | + } else { |
|
601 | + $roles = $DB->get_records('role', array()); |
|
602 | + } |
|
596 | 603 | |
597 | 604 | return $roles; |
598 | 605 | } |
@@ -36,6 +36,9 @@ discard block |
||
36 | 36 | const BIGBLUEBUTTONBN_LOG_EVENT_JOIN = "Join"; |
37 | 37 | const BIGBLUEBUTTONBN_LOG_EVENT_LOGOUT = "Logout"; |
38 | 38 | |
39 | +/** |
|
40 | + * @param string $event |
|
41 | + */ |
|
39 | 42 | function bigbluebuttonbn_log(array $bbbsession, $event) { |
40 | 43 | global $DB; |
41 | 44 | |
@@ -181,6 +184,9 @@ discard block |
||
181 | 184 | return $xml; |
182 | 185 | } |
183 | 186 | |
187 | +/** |
|
188 | + * @param string $meetingID |
|
189 | + */ |
|
184 | 190 | function bigbluebuttonbn_getMeetingInfoArray( $meetingID, $modPW, $URL, $SALT ) { |
185 | 191 | $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getMeetingInfoURL( $meetingID, $modPW, $URL, $SALT ) ); |
186 | 192 | |
@@ -285,6 +291,10 @@ discard block |
||
285 | 291 | else return 1; |
286 | 292 | } |
287 | 293 | |
294 | +/** |
|
295 | + * @param string $URL |
|
296 | + * @param string $SALT |
|
297 | + */ |
|
288 | 298 | function bigbluebuttonbn_doDeleteRecordings( $recordIDs, $URL, $SALT ) { |
289 | 299 | $ids = explode(",", $recordIDs); |
290 | 300 | foreach( $ids as $id){ |
@@ -295,6 +305,11 @@ discard block |
||
295 | 305 | return true; |
296 | 306 | } |
297 | 307 | |
308 | +/** |
|
309 | + * @param string $set |
|
310 | + * @param string $URL |
|
311 | + * @param string $SALT |
|
312 | + */ |
|
298 | 313 | function bigbluebuttonbn_doPublishRecordings( $recordIDs, $set, $URL, $SALT ) { |
299 | 314 | $ids = explode(",", $recordIDs); |
300 | 315 | foreach( $ids as $id){ |
@@ -305,6 +320,10 @@ discard block |
||
305 | 320 | return true; |
306 | 321 | } |
307 | 322 | |
323 | +/** |
|
324 | + * @param string $URL |
|
325 | + * @param string $SALT |
|
326 | + */ |
|
308 | 327 | function bigbluebuttonbn_doEndMeeting( $meetingID, $modPW, $URL, $SALT ) { |
309 | 328 | $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getEndMeetingURL( $meetingID, $modPW, $URL, $SALT ) ); |
310 | 329 | |
@@ -326,6 +345,9 @@ discard block |
||
326 | 345 | } |
327 | 346 | |
328 | 347 | |
348 | +/** |
|
349 | + * @param string $URL |
|
350 | + */ |
|
329 | 351 | function bigbluebuttonbn_getServerVersion( $URL ){ |
330 | 352 | $xml = bigbluebuttonbn_wrap_xml_load_file( $URL."api" ); |
331 | 353 | if ( $xml && $xml->returncode == 'SUCCESS' ) { |
@@ -344,6 +366,9 @@ discard block |
||
344 | 366 | } |
345 | 367 | } |
346 | 368 | |
369 | +/** |
|
370 | + * @param string $url |
|
371 | + */ |
|
347 | 372 | function bigbluebuttonbn_wrap_xml_load_file($url, $method=BIGBLUEBUTTONBN_METHOD_GET, $data=null) { |
348 | 373 | if (extension_loaded('curl')) { |
349 | 374 | $c = new curl(); |
@@ -776,6 +801,9 @@ discard block |
||
776 | 801 | $cache = cache::make_from_params(cache_store::MODE_APPLICATION, 'mod_bigbluebuttonbn', 'meetings_cache'); |
777 | 802 | } |
778 | 803 | |
804 | +/** |
|
805 | + * @param boolean $is_moderator |
|
806 | + */ |
|
779 | 807 | function bigbluebuttonbn_bbb_broker_participant_joined($meetingid, $is_moderator) { |
780 | 808 | $cache = cache::make_from_params(cache_store::MODE_APPLICATION, 'mod_bigbluebuttonbn', 'meetings_cache'); |
781 | 809 | $result = $cache->get($meetingid); |
@@ -1256,6 +1284,9 @@ discard block |
||
1256 | 1284 | return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingready_enabled)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingready_enabled: (isset($CFG->bigbluebuttonbn_recordingready_enabled)? $CFG->bigbluebuttonbn_recordingready_enabled: false)); |
1257 | 1285 | } |
1258 | 1286 | |
1287 | +/** |
|
1288 | + * @return string |
|
1289 | + */ |
|
1259 | 1290 | function bigbluebuttonbn_get_cfg_moderator_default() { |
1260 | 1291 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
1261 | 1292 | return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_moderator_default)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_moderator_default: (isset($CFG->bigbluebuttonbn_moderator_default)? $CFG->bigbluebuttonbn_moderator_default: 'owner')); |
@@ -53,9 +53,9 @@ |
||
53 | 53 | $returnid = $DB->insert_record('bigbluebuttonbn_log', $log); |
54 | 54 | } |
55 | 55 | |
56 | - //////////////////////////// |
|
56 | + //////////////////////////// |
|
57 | 57 | // BigBlueButton API Calls // |
58 | - //////////////////////////// |
|
58 | + //////////////////////////// |
|
59 | 59 | function bigbluebuttonbn_getJoinURL( $meetingID, $userName, $PW, $SALT, $URL ) { |
60 | 60 | $url_join = $URL."api/join?"; |
61 | 61 | $params = 'meetingID='.urlencode($meetingID).'&fullName='.urlencode($userName).'&password='.urlencode($PW); |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | |
15 | 15 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
16 | 16 | |
17 | -require_once(dirname(__FILE__).'/lib.php'); |
|
17 | +require_once(dirname(__FILE__) . '/lib.php'); |
|
18 | 18 | |
19 | 19 | const BIGBLUEBUTTONBN_FORCED = true; |
20 | 20 | |
@@ -47,8 +47,8 @@ discard block |
||
47 | 47 | $log->userid = $bbbsession['userID']; |
48 | 48 | $log->timecreated = time(); |
49 | 49 | $log->event = $event; |
50 | - if( $event == BIGBLUEBUTTONBN_LOG_EVENT_CREATE) |
|
51 | - $log->meta = '{"record":'.($bbbsession['record']? 'true': 'false').'}'; |
|
50 | + if ($event == BIGBLUEBUTTONBN_LOG_EVENT_CREATE) |
|
51 | + $log->meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}'; |
|
52 | 52 | |
53 | 53 | $returnid = $DB->insert_record('bigbluebuttonbn_log', $log); |
54 | 54 | } |
@@ -56,119 +56,119 @@ discard block |
||
56 | 56 | //////////////////////////// |
57 | 57 | // BigBlueButton API Calls // |
58 | 58 | //////////////////////////// |
59 | -function bigbluebuttonbn_getJoinURL( $meetingID, $userName, $PW, $SALT, $URL ) { |
|
60 | - $url_join = $URL."api/join?"; |
|
61 | - $params = 'meetingID='.urlencode($meetingID).'&fullName='.urlencode($userName).'&password='.urlencode($PW); |
|
62 | - return ($url_join.$params.'&checksum='.sha1("join".$params.$SALT) ); |
|
59 | +function bigbluebuttonbn_getJoinURL($meetingID, $userName, $PW, $SALT, $URL) { |
|
60 | + $url_join = $URL . "api/join?"; |
|
61 | + $params = 'meetingID=' . urlencode($meetingID) . '&fullName=' . urlencode($userName) . '&password=' . urlencode($PW); |
|
62 | + return ($url_join . $params . '&checksum=' . sha1("join" . $params . $SALT)); |
|
63 | 63 | } |
64 | 64 | |
65 | -function bigbluebuttonbn_getCreateMeetingURL($name, $meetingID, $attendeePW, $moderatorPW, $welcome, $logoutURL, $SALT, $URL, $record = 'false', $duration=0, $voiceBridge=0, $metadata = array() ) { |
|
66 | - $url_create = $URL."api/create?"; |
|
65 | +function bigbluebuttonbn_getCreateMeetingURL($name, $meetingID, $attendeePW, $moderatorPW, $welcome, $logoutURL, $SALT, $URL, $record = 'false', $duration = 0, $voiceBridge = 0, $metadata = array()) { |
|
66 | + $url_create = $URL . "api/create?"; |
|
67 | 67 | |
68 | - $params = 'name='.urlencode($name).'&meetingID='.urlencode($meetingID).'&attendeePW='.urlencode($attendeePW).'&moderatorPW='.urlencode($moderatorPW).'&logoutURL='.urlencode($logoutURL).'&record='.$record; |
|
68 | + $params = 'name=' . urlencode($name) . '&meetingID=' . urlencode($meetingID) . '&attendeePW=' . urlencode($attendeePW) . '&moderatorPW=' . urlencode($moderatorPW) . '&logoutURL=' . urlencode($logoutURL) . '&record=' . $record; |
|
69 | 69 | |
70 | 70 | $voiceBridge = intval($voiceBridge); |
71 | - if ( $voiceBridge > 0 && $voiceBridge < 79999) |
|
72 | - $params .= '&voiceBridge='.$voiceBridge; |
|
71 | + if ($voiceBridge > 0 && $voiceBridge < 79999) |
|
72 | + $params .= '&voiceBridge=' . $voiceBridge; |
|
73 | 73 | |
74 | 74 | $duration = intval($duration); |
75 | - if( $duration > 0 ) |
|
76 | - $params .= '&duration='.$duration; |
|
75 | + if ($duration > 0) |
|
76 | + $params .= '&duration=' . $duration; |
|
77 | 77 | |
78 | - if( trim( $welcome ) ) |
|
79 | - $params .= '&welcome='.urlencode($welcome); |
|
78 | + if (trim($welcome)) |
|
79 | + $params .= '&welcome=' . urlencode($welcome); |
|
80 | 80 | |
81 | 81 | foreach ($metadata as $key => $value) { |
82 | - $params .= '&'.$key.'='.urlencode($value); |
|
82 | + $params .= '&' . $key . '=' . urlencode($value); |
|
83 | 83 | } |
84 | 84 | |
85 | - return ( $url_create.$params.'&checksum='.sha1("create".$params.$SALT) ); |
|
85 | + return ($url_create . $params . '&checksum=' . sha1("create" . $params . $SALT)); |
|
86 | 86 | } |
87 | 87 | |
88 | -function bigbluebuttonbn_getIsMeetingRunningURL( $meetingID, $URL, $SALT ) { |
|
89 | - $base_url = $URL."api/isMeetingRunning?"; |
|
90 | - $params = 'meetingID='.urlencode($meetingID); |
|
91 | - return ($base_url.$params.'&checksum='.sha1("isMeetingRunning".$params.$SALT) ); |
|
88 | +function bigbluebuttonbn_getIsMeetingRunningURL($meetingID, $URL, $SALT) { |
|
89 | + $base_url = $URL . "api/isMeetingRunning?"; |
|
90 | + $params = 'meetingID=' . urlencode($meetingID); |
|
91 | + return ($base_url . $params . '&checksum=' . sha1("isMeetingRunning" . $params . $SALT)); |
|
92 | 92 | } |
93 | 93 | |
94 | -function bigbluebuttonbn_getMeetingInfoURL( $meetingID, $modPW, $URL, $SALT ) { |
|
95 | - $base_url = $URL."api/getMeetingInfo?"; |
|
96 | - $params = 'meetingID='.urlencode($meetingID).'&password='.urlencode($modPW); |
|
97 | - return ( $base_url.$params.'&checksum='.sha1("getMeetingInfo".$params.$SALT)); |
|
94 | +function bigbluebuttonbn_getMeetingInfoURL($meetingID, $modPW, $URL, $SALT) { |
|
95 | + $base_url = $URL . "api/getMeetingInfo?"; |
|
96 | + $params = 'meetingID=' . urlencode($meetingID) . '&password=' . urlencode($modPW); |
|
97 | + return ($base_url . $params . '&checksum=' . sha1("getMeetingInfo" . $params . $SALT)); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | function bigbluebuttonbn_getMeetingsURL($URL, $SALT) { |
101 | - $base_url = $URL."api/getMeetings?"; |
|
101 | + $base_url = $URL . "api/getMeetings?"; |
|
102 | 102 | $params = ''; |
103 | - return ( $base_url.$params.'&checksum='.sha1("getMeetings".$params.$SALT)); |
|
103 | + return ($base_url . $params . '&checksum=' . sha1("getMeetings" . $params . $SALT)); |
|
104 | 104 | } |
105 | 105 | |
106 | -function bigbluebuttonbn_getEndMeetingURL( $meetingID, $modPW, $URL, $SALT ) { |
|
107 | - $base_url = $URL."api/end?"; |
|
108 | - $params = 'meetingID='.urlencode($meetingID).'&password='.urlencode($modPW); |
|
109 | - return ( $base_url.$params.'&checksum='.sha1("end".$params.$SALT) ); |
|
106 | +function bigbluebuttonbn_getEndMeetingURL($meetingID, $modPW, $URL, $SALT) { |
|
107 | + $base_url = $URL . "api/end?"; |
|
108 | + $params = 'meetingID=' . urlencode($meetingID) . '&password=' . urlencode($modPW); |
|
109 | + return ($base_url . $params . '&checksum=' . sha1("end" . $params . $SALT)); |
|
110 | 110 | } |
111 | 111 | |
112 | -function bigbluebuttonbn_getRecordingsURL( $URL, $SALT, $meetingID=null ) { |
|
113 | - $base_url_record = $URL."api/getRecordings?"; |
|
114 | - if( $meetingID == null ) { |
|
112 | +function bigbluebuttonbn_getRecordingsURL($URL, $SALT, $meetingID = null) { |
|
113 | + $base_url_record = $URL . "api/getRecordings?"; |
|
114 | + if ($meetingID == null) { |
|
115 | 115 | $params = ""; |
116 | 116 | } else { |
117 | - $params = "meetingID=".urlencode($meetingID); |
|
117 | + $params = "meetingID=" . urlencode($meetingID); |
|
118 | 118 | } |
119 | - return ($base_url_record.$params."&checksum=".sha1("getRecordings".$params.$SALT) ); |
|
119 | + return ($base_url_record . $params . "&checksum=" . sha1("getRecordings" . $params . $SALT)); |
|
120 | 120 | } |
121 | 121 | |
122 | -function bigbluebuttonbn_getDeleteRecordingsURL( $recordID, $URL, $SALT ) { |
|
123 | - $url_delete = $URL."api/deleteRecordings?"; |
|
124 | - $params = 'recordID='.urlencode($recordID); |
|
125 | - return ($url_delete.$params.'&checksum='.sha1("deleteRecordings".$params.$SALT) ); |
|
122 | +function bigbluebuttonbn_getDeleteRecordingsURL($recordID, $URL, $SALT) { |
|
123 | + $url_delete = $URL . "api/deleteRecordings?"; |
|
124 | + $params = 'recordID=' . urlencode($recordID); |
|
125 | + return ($url_delete . $params . '&checksum=' . sha1("deleteRecordings" . $params . $SALT)); |
|
126 | 126 | } |
127 | 127 | |
128 | -function bigbluebuttonbn_getPublishRecordingsURL( $recordID, $set, $URL, $SALT ) { |
|
129 | - $url_publish = $URL."api/publishRecordings?"; |
|
130 | - $params = 'recordID='.$recordID."&publish=".$set; |
|
131 | - return ($url_publish.$params.'&checksum='.sha1("publishRecordings".$params.$SALT) ); |
|
128 | +function bigbluebuttonbn_getPublishRecordingsURL($recordID, $set, $URL, $SALT) { |
|
129 | + $url_publish = $URL . "api/publishRecordings?"; |
|
130 | + $params = 'recordID=' . $recordID . "&publish=" . $set; |
|
131 | + return ($url_publish . $params . '&checksum=' . sha1("publishRecordings" . $params . $SALT)); |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | function bigbluebuttonbn_getCapabilitiesURL($URL, $SALT) { |
135 | - $base_url = $URL."api/getCapabilities?"; |
|
135 | + $base_url = $URL . "api/getCapabilities?"; |
|
136 | 136 | $params = ''; |
137 | - return ( $base_url.$params.'&checksum='.sha1("getCapabilities".$params.$SALT)); |
|
137 | + return ($base_url . $params . '&checksum=' . sha1("getCapabilities" . $params . $SALT)); |
|
138 | 138 | } |
139 | 139 | |
140 | -function bigbluebuttonbn_getCreateMeetingArray( $username, $meetingID, $welcomeString, $mPW, $aPW, $SALT, $URL, $logoutURL, $record='false', $duration=0, $voiceBridge=0, $metadata=array(), $presentation_name=null, $presentation_url=null ) { |
|
141 | - if( !is_null($presentation_name) && !is_null($presentation_url) ) { |
|
142 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getCreateMeetingURL($username, $meetingID, $aPW, $mPW, $welcomeString, $logoutURL, $SALT, $URL, $record, $duration, $voiceBridge, $metadata), |
|
140 | +function bigbluebuttonbn_getCreateMeetingArray($username, $meetingID, $welcomeString, $mPW, $aPW, $SALT, $URL, $logoutURL, $record = 'false', $duration = 0, $voiceBridge = 0, $metadata = array(), $presentation_name = null, $presentation_url = null) { |
|
141 | + if (!is_null($presentation_name) && !is_null($presentation_url)) { |
|
142 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getCreateMeetingURL($username, $meetingID, $aPW, $mPW, $welcomeString, $logoutURL, $SALT, $URL, $record, $duration, $voiceBridge, $metadata), |
|
143 | 143 | BIGBLUEBUTTONBN_METHOD_POST, |
144 | - "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='".$presentation_url."' /></module></modules>" |
|
144 | + "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='" . $presentation_url . "' /></module></modules>" |
|
145 | 145 | ); |
146 | 146 | } else { |
147 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getCreateMeetingURL($username, $meetingID, $aPW, $mPW, $welcomeString, $logoutURL, $SALT, $URL, $record, $duration, $voiceBridge, $metadata) ); |
|
147 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getCreateMeetingURL($username, $meetingID, $aPW, $mPW, $welcomeString, $logoutURL, $SALT, $URL, $record, $duration, $voiceBridge, $metadata)); |
|
148 | 148 | } |
149 | 149 | |
150 | - if( $xml ) { |
|
151 | - if($xml->meetingID) return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey, 'meetingID' => $xml->meetingID, 'attendeePW' => $xml->attendeePW, 'moderatorPW' => $xml->moderatorPW, 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded ); |
|
152 | - else return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey ); |
|
150 | + if ($xml) { |
|
151 | + if ($xml->meetingID) return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey, 'meetingID' => $xml->meetingID, 'attendeePW' => $xml->attendeePW, 'moderatorPW' => $xml->moderatorPW, 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded); |
|
152 | + else return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); |
|
153 | 153 | } |
154 | 154 | else { |
155 | 155 | return null; |
156 | 156 | } |
157 | 157 | } |
158 | 158 | |
159 | -function bigbluebuttonbn_getMeetingsArray( $URL, $SALT ) { |
|
160 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getMeetingsURL( $URL, $SALT ) ); |
|
159 | +function bigbluebuttonbn_getMeetingsArray($URL, $SALT) { |
|
160 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getMeetingsURL($URL, $SALT)); |
|
161 | 161 | |
162 | - if( $xml && $xml->returncode == 'SUCCESS' && $xml->messageKey ) { //The meetings were returned |
|
162 | + if ($xml && $xml->returncode == 'SUCCESS' && $xml->messageKey) { //The meetings were returned |
|
163 | 163 | return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); |
164 | 164 | |
165 | - } else if($xml && $xml->returncode == 'SUCCESS'){ //If there were meetings already created |
|
165 | + } else if ($xml && $xml->returncode == 'SUCCESS') { //If there were meetings already created |
|
166 | 166 | foreach ($xml->meetings->meeting as $meeting) { |
167 | - $meetings[] = array( 'meetingID' => $meeting->meetingID, 'moderatorPW' => $meeting->moderatorPW, 'attendeePW' => $meeting->attendeePW, 'hasBeenForciblyEnded' => $meeting->hasBeenForciblyEnded, 'running' => $meeting->running ); |
|
167 | + $meetings[] = array('meetingID' => $meeting->meetingID, 'moderatorPW' => $meeting->moderatorPW, 'attendeePW' => $meeting->attendeePW, 'hasBeenForciblyEnded' => $meeting->hasBeenForciblyEnded, 'running' => $meeting->running); |
|
168 | 168 | } |
169 | 169 | return $meetings; |
170 | 170 | |
171 | - } else if( $xml ) { //If the xml packet returned failure it displays the message to the user |
|
171 | + } else if ($xml) { //If the xml packet returned failure it displays the message to the user |
|
172 | 172 | return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); |
173 | 173 | |
174 | 174 | } else { //If the server is unreachable, then prompts the user of the necessary action |
@@ -176,21 +176,21 @@ discard block |
||
176 | 176 | } |
177 | 177 | } |
178 | 178 | |
179 | -function bigbluebuttonbn_getMeetingInfo( $meetingID, $modPW, $URL, $SALT ) { |
|
180 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getMeetingInfoURL( $meetingID, $modPW, $URL, $SALT ) ); |
|
179 | +function bigbluebuttonbn_getMeetingInfo($meetingID, $modPW, $URL, $SALT) { |
|
180 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getMeetingInfoURL($meetingID, $modPW, $URL, $SALT)); |
|
181 | 181 | return $xml; |
182 | 182 | } |
183 | 183 | |
184 | -function bigbluebuttonbn_getMeetingInfoArray( $meetingID, $modPW, $URL, $SALT ) { |
|
185 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getMeetingInfoURL( $meetingID, $modPW, $URL, $SALT ) ); |
|
184 | +function bigbluebuttonbn_getMeetingInfoArray($meetingID, $modPW, $URL, $SALT) { |
|
185 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getMeetingInfoURL($meetingID, $modPW, $URL, $SALT)); |
|
186 | 186 | |
187 | - if( $xml && $xml->returncode == 'SUCCESS' && $xml->messageKey == null){//The meeting info was returned |
|
188 | - return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey ); |
|
187 | + if ($xml && $xml->returncode == 'SUCCESS' && $xml->messageKey == null) {//The meeting info was returned |
|
188 | + return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); |
|
189 | 189 | |
190 | - } else if($xml && $xml->returncode == 'SUCCESS'){ //If there were meetings already created |
|
191 | - return array('returncode' => $xml->returncode, 'meetingID' => $xml->meetingID, 'moderatorPW' => $xml->moderatorPW, 'attendeePW' => $xml->attendeePW, 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded, 'running' => $xml->running, 'recording' => $xml->recording, 'startTime' => $xml->startTime, 'endTime' => $xml->endTime, 'participantCount' => $xml->participantCount, 'moderatorCount' => $xml->moderatorCount, 'attendees' => $xml->attendees, 'metadata' => $xml->metadata ); |
|
190 | + } else if ($xml && $xml->returncode == 'SUCCESS') { //If there were meetings already created |
|
191 | + return array('returncode' => $xml->returncode, 'meetingID' => $xml->meetingID, 'moderatorPW' => $xml->moderatorPW, 'attendeePW' => $xml->attendeePW, 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded, 'running' => $xml->running, 'recording' => $xml->recording, 'startTime' => $xml->startTime, 'endTime' => $xml->endTime, 'participantCount' => $xml->participantCount, 'moderatorCount' => $xml->moderatorCount, 'attendees' => $xml->attendees, 'metadata' => $xml->metadata); |
|
192 | 192 | |
193 | - } else if( ($xml && $xml->returncode == 'FAILED') || $xml) { //If the xml packet returned failure it displays the message to the user |
|
193 | + } else if (($xml && $xml->returncode == 'FAILED') || $xml) { //If the xml packet returned failure it displays the message to the user |
|
194 | 194 | return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); |
195 | 195 | |
196 | 196 | } else { //If the server is unreachable, then prompts the user of the necessary action |
@@ -198,42 +198,42 @@ discard block |
||
198 | 198 | } |
199 | 199 | } |
200 | 200 | |
201 | -function bigbluebuttonbn_getRecordingsArray( $meetingIDs, $URL, $SALT ) { |
|
201 | +function bigbluebuttonbn_getRecordingsArray($meetingIDs, $URL, $SALT) { |
|
202 | 202 | $recordings = array(); |
203 | 203 | |
204 | - if( is_array($meetingIDs) ) { |
|
204 | + if (is_array($meetingIDs)) { |
|
205 | 205 | // getRecordings is executes using a method POST (supported only on BBB 1.0 and later) |
206 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getRecordingsURL( $URL, $SALT ), BIGBLUEBUTTONBN_METHOD_POST, $meetingIDs ); |
|
206 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getRecordingsURL($URL, $SALT), BIGBLUEBUTTONBN_METHOD_POST, $meetingIDs); |
|
207 | 207 | } else { |
208 | 208 | // getRecordings is executes using a method GET supported by any version of BBB |
209 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getRecordingsURL( $URL, $SALT, $meetingIDs ) ); |
|
209 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getRecordingsURL($URL, $SALT, $meetingIDs)); |
|
210 | 210 | } |
211 | 211 | |
212 | - if( $xml && $xml->returncode == 'SUCCESS' && $xml->messageKey ) {//The meetings were returned |
|
213 | - $recordings = array('returncode' => (string) $xml->returncode, 'message' => (string) $xml->message, 'messageKey' => (string) $xml->messageKey); |
|
212 | + if ($xml && $xml->returncode == 'SUCCESS' && $xml->messageKey) {//The meetings were returned |
|
213 | + $recordings = array('returncode' => (string)$xml->returncode, 'message' => (string)$xml->message, 'messageKey' => (string)$xml->messageKey); |
|
214 | 214 | |
215 | - } else if($xml && $xml->returncode == 'SUCCESS' && isset($xml->recordings)){ //If there were meetings already created |
|
215 | + } else if ($xml && $xml->returncode == 'SUCCESS' && isset($xml->recordings)) { //If there were meetings already created |
|
216 | 216 | foreach ($xml->recordings->recording as $recording) { |
217 | 217 | $playbackArray = array(); |
218 | - foreach ( $recording->playback->format as $format ){ |
|
219 | - $playbackArray[(string) $format->type] = array( 'type' => (string) $format->type, 'url' => (string) $format->url ); |
|
218 | + foreach ($recording->playback->format as $format) { |
|
219 | + $playbackArray[(string)$format->type] = array('type' => (string)$format->type, 'url' => (string)$format->url); |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | //Add the metadata to the recordings array |
223 | 223 | $metadataArray = array(); |
224 | 224 | $metadata = get_object_vars($recording->metadata); |
225 | 225 | foreach ($metadata as $key => $value) { |
226 | - if(is_object($value)) $value = ''; |
|
227 | - $metadataArray['meta_'.$key] = $value; |
|
226 | + if (is_object($value)) $value = ''; |
|
227 | + $metadataArray['meta_' . $key] = $value; |
|
228 | 228 | } |
229 | 229 | |
230 | - $recordings[] = array( 'recordID' => (string) $recording->recordID, 'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name, 'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime, 'endTime' => (string) $recording->endTime, 'playbacks' => $playbackArray ) + $metadataArray; |
|
230 | + $recordings[] = array('recordID' => (string)$recording->recordID, 'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name, 'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime, 'endTime' => (string)$recording->endTime, 'playbacks' => $playbackArray) + $metadataArray; |
|
231 | 231 | } |
232 | 232 | |
233 | 233 | usort($recordings, 'bigbluebuttonbn_recordingBuildSorter'); |
234 | 234 | |
235 | - } else if( $xml ) { //If the xml packet returned failure it displays the message to the user |
|
236 | - $recordings = array('returncode' => (string) $xml->returncode, 'message' => (string) $xml->message, 'messageKey' => (string) $xml->messageKey); |
|
235 | + } else if ($xml) { //If the xml packet returned failure it displays the message to the user |
|
236 | + $recordings = array('returncode' => (string)$xml->returncode, 'message' => (string)$xml->message, 'messageKey' => (string)$xml->messageKey); |
|
237 | 237 | |
238 | 238 | } else { //If the server is unreachable, then prompts the user of the necessary action |
239 | 239 | } |
@@ -241,37 +241,37 @@ discard block |
||
241 | 241 | return $recordings; |
242 | 242 | } |
243 | 243 | |
244 | -function bigbluebuttonbn_getRecordingArray( $recordingID, $meetingID, $URL, $SALT ) { |
|
244 | +function bigbluebuttonbn_getRecordingArray($recordingID, $meetingID, $URL, $SALT) { |
|
245 | 245 | $recording = array(); |
246 | 246 | |
247 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getRecordingsURL( $URL, $SALT, $meetingID ) ); |
|
247 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getRecordingsURL($URL, $SALT, $meetingID)); |
|
248 | 248 | |
249 | - if( $xml && $xml->returncode == 'SUCCESS' && $xml->messageKey ) {//The meetings were returned |
|
250 | - $recordings = array('returncode' => (string) $xml->returncode, 'message' => (string) $xml->message, 'messageKey' => (string) $xml->messageKey); |
|
249 | + if ($xml && $xml->returncode == 'SUCCESS' && $xml->messageKey) {//The meetings were returned |
|
250 | + $recordings = array('returncode' => (string)$xml->returncode, 'message' => (string)$xml->message, 'messageKey' => (string)$xml->messageKey); |
|
251 | 251 | |
252 | - } else if($xml && $xml->returncode == 'SUCCESS' && isset($xml->recordings)){ //If there were meetings already created |
|
252 | + } else if ($xml && $xml->returncode == 'SUCCESS' && isset($xml->recordings)) { //If there were meetings already created |
|
253 | 253 | foreach ($xml->recordings->recording as $recording) { |
254 | - if( $recording->recordID == $recordingID ) { |
|
254 | + if ($recording->recordID == $recordingID) { |
|
255 | 255 | $playbackArray = array(); |
256 | - foreach ( $recording->playback->format as $format ){ |
|
257 | - $playbackArray[(string) $format->type] = array( 'type' => (string) $format->type, 'url' => (string) $format->url ); |
|
256 | + foreach ($recording->playback->format as $format) { |
|
257 | + $playbackArray[(string)$format->type] = array('type' => (string)$format->type, 'url' => (string)$format->url); |
|
258 | 258 | } |
259 | 259 | |
260 | 260 | //Add the metadata to the recordings array |
261 | 261 | $metadataArray = array(); |
262 | 262 | $metadata = get_object_vars($recording->metadata); |
263 | 263 | foreach ($metadata as $key => $value) { |
264 | - if(is_object($value)) $value = ''; |
|
265 | - $metadataArray['meta_'.$key] = $value; |
|
264 | + if (is_object($value)) $value = ''; |
|
265 | + $metadataArray['meta_' . $key] = $value; |
|
266 | 266 | } |
267 | 267 | |
268 | - $recording = array( 'recordID' => (string) $recording->recordID, 'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name, 'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime, 'endTime' => (string) $recording->endTime, 'playbacks' => $playbackArray ) + $metadataArray; |
|
268 | + $recording = array('recordID' => (string)$recording->recordID, 'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name, 'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime, 'endTime' => (string)$recording->endTime, 'playbacks' => $playbackArray) + $metadataArray; |
|
269 | 269 | break; |
270 | 270 | } |
271 | 271 | } |
272 | 272 | |
273 | - } else if( $xml ) { //If the xml packet returned failure it displays the message to the user |
|
274 | - $recording = array('returncode' => (string) $xml->returncode, 'message' => (string) $xml->message, 'messageKey' => (string) $xml->messageKey); |
|
273 | + } else if ($xml) { //If the xml packet returned failure it displays the message to the user |
|
274 | + $recording = array('returncode' => (string)$xml->returncode, 'message' => (string)$xml->message, 'messageKey' => (string)$xml->messageKey); |
|
275 | 275 | |
276 | 276 | } else { //If the server is unreachable, then prompts the user of the necessary action |
277 | 277 | } |
@@ -279,36 +279,36 @@ discard block |
||
279 | 279 | return $recording; |
280 | 280 | } |
281 | 281 | |
282 | -function bigbluebuttonbn_recordingBuildSorter($a, $b){ |
|
283 | - if( $a['startTime'] < $b['startTime']) return -1; |
|
284 | - else if( $a['startTime'] == $b['startTime']) return 0; |
|
282 | +function bigbluebuttonbn_recordingBuildSorter($a, $b) { |
|
283 | + if ($a['startTime'] < $b['startTime']) return -1; |
|
284 | + else if ($a['startTime'] == $b['startTime']) return 0; |
|
285 | 285 | else return 1; |
286 | 286 | } |
287 | 287 | |
288 | -function bigbluebuttonbn_doDeleteRecordings( $recordIDs, $URL, $SALT ) { |
|
289 | - $ids = explode(",", $recordIDs); |
|
290 | - foreach( $ids as $id){ |
|
291 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getDeleteRecordingsURL($id, $URL, $SALT) ); |
|
292 | - if( $xml && $xml->returncode != 'SUCCESS' ) |
|
288 | +function bigbluebuttonbn_doDeleteRecordings($recordIDs, $URL, $SALT) { |
|
289 | + $ids = explode(",", $recordIDs); |
|
290 | + foreach ($ids as $id) { |
|
291 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getDeleteRecordingsURL($id, $URL, $SALT)); |
|
292 | + if ($xml && $xml->returncode != 'SUCCESS') |
|
293 | 293 | return false; |
294 | 294 | } |
295 | 295 | return true; |
296 | 296 | } |
297 | 297 | |
298 | -function bigbluebuttonbn_doPublishRecordings( $recordIDs, $set, $URL, $SALT ) { |
|
299 | - $ids = explode(",", $recordIDs); |
|
300 | - foreach( $ids as $id){ |
|
301 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getPublishRecordingsURL($id, $set, $URL, $SALT) ); |
|
302 | - if( $xml && $xml->returncode != 'SUCCESS' ) |
|
298 | +function bigbluebuttonbn_doPublishRecordings($recordIDs, $set, $URL, $SALT) { |
|
299 | + $ids = explode(",", $recordIDs); |
|
300 | + foreach ($ids as $id) { |
|
301 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getPublishRecordingsURL($id, $set, $URL, $SALT)); |
|
302 | + if ($xml && $xml->returncode != 'SUCCESS') |
|
303 | 303 | return false; |
304 | 304 | } |
305 | 305 | return true; |
306 | 306 | } |
307 | 307 | |
308 | -function bigbluebuttonbn_doEndMeeting( $meetingID, $modPW, $URL, $SALT ) { |
|
309 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getEndMeetingURL( $meetingID, $modPW, $URL, $SALT ) ); |
|
308 | +function bigbluebuttonbn_doEndMeeting($meetingID, $modPW, $URL, $SALT) { |
|
309 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getEndMeetingURL($meetingID, $modPW, $URL, $SALT)); |
|
310 | 310 | |
311 | - if( $xml ) { //If the xml packet returned failure it displays the message to the user |
|
311 | + if ($xml) { //If the xml packet returned failure it displays the message to the user |
|
312 | 312 | return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); |
313 | 313 | } |
314 | 314 | else { //If the server is unreachable, then prompts the user of the necessary action |
@@ -316,44 +316,44 @@ discard block |
||
316 | 316 | } |
317 | 317 | } |
318 | 318 | |
319 | -function bigbluebuttonbn_isMeetingRunning( $meetingID, $URL, $SALT ) { |
|
320 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getIsMeetingRunningURL( $meetingID, $URL, $SALT ) ); |
|
321 | - if ( $xml && $xml->returncode == 'SUCCESS' ) { |
|
322 | - return ( ( $xml->running == 'true' ) ? true : false); |
|
319 | +function bigbluebuttonbn_isMeetingRunning($meetingID, $URL, $SALT) { |
|
320 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getIsMeetingRunningURL($meetingID, $URL, $SALT)); |
|
321 | + if ($xml && $xml->returncode == 'SUCCESS') { |
|
322 | + return (($xml->running == 'true') ? true : false); |
|
323 | 323 | } else { |
324 | - return ( false ); |
|
324 | + return (false); |
|
325 | 325 | } |
326 | 326 | } |
327 | 327 | |
328 | 328 | |
329 | -function bigbluebuttonbn_getServerVersion( $URL ){ |
|
330 | - $xml = bigbluebuttonbn_wrap_xml_load_file( $URL."api" ); |
|
331 | - if ( $xml && $xml->returncode == 'SUCCESS' ) { |
|
329 | +function bigbluebuttonbn_getServerVersion($URL) { |
|
330 | + $xml = bigbluebuttonbn_wrap_xml_load_file($URL . "api"); |
|
331 | + if ($xml && $xml->returncode == 'SUCCESS') { |
|
332 | 332 | return $xml->version; |
333 | 333 | } else { |
334 | 334 | return NULL; |
335 | 335 | } |
336 | 336 | } |
337 | 337 | |
338 | -function bigbluebuttonbn_getMeetingXML( $meetingID, $URL, $SALT ) { |
|
339 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getIsMeetingRunningURL( $meetingID, $URL, $SALT ) ); |
|
340 | - if ( $xml && $xml->returncode == 'SUCCESS') { |
|
341 | - return ( str_replace('</response>', '', str_replace("<?xml version=\"1.0\"?>\n<response>", '', $xml->asXML()))); |
|
338 | +function bigbluebuttonbn_getMeetingXML($meetingID, $URL, $SALT) { |
|
339 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getIsMeetingRunningURL($meetingID, $URL, $SALT)); |
|
340 | + if ($xml && $xml->returncode == 'SUCCESS') { |
|
341 | + return (str_replace('</response>', '', str_replace("<?xml version=\"1.0\"?>\n<response>", '', $xml->asXML()))); |
|
342 | 342 | } else { |
343 | 343 | return 'false'; |
344 | 344 | } |
345 | 345 | } |
346 | 346 | |
347 | -function bigbluebuttonbn_wrap_xml_load_file($url, $method=BIGBLUEBUTTONBN_METHOD_GET, $data=null) { |
|
347 | +function bigbluebuttonbn_wrap_xml_load_file($url, $method = BIGBLUEBUTTONBN_METHOD_GET, $data = null) { |
|
348 | 348 | if (extension_loaded('curl')) { |
349 | 349 | $c = new curl(); |
350 | - $c->setopt( Array( "SSL_VERIFYPEER" => true)); |
|
351 | - if( $method == BIGBLUEBUTTONBN_METHOD_POST ) { |
|
352 | - if( !is_null($data) ) { |
|
353 | - if( !is_array($data) ) { |
|
350 | + $c->setopt(Array("SSL_VERIFYPEER" => true)); |
|
351 | + if ($method == BIGBLUEBUTTONBN_METHOD_POST) { |
|
352 | + if (!is_null($data)) { |
|
353 | + if (!is_array($data)) { |
|
354 | 354 | $options['CURLOPT_HTTPHEADER'] = array( |
355 | 355 | 'Content-Type: text/xml', |
356 | - 'Content-Length: '.strlen($data), |
|
356 | + 'Content-Length: ' . strlen($data), |
|
357 | 357 | 'Content-Language: en-US' |
358 | 358 | ); |
359 | 359 | $response = $c->post($url, $data, $options); |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | try { |
376 | 376 | $xml = new SimpleXMLElement($response, LIBXML_NOCDATA); |
377 | 377 | return $xml; |
378 | - } catch (Exception $e){ |
|
378 | + } catch (Exception $e) { |
|
379 | 379 | libxml_use_internal_errors($previous); |
380 | 380 | error_log("The XML response is not correct on wrap_simplexml_load_file"); |
381 | 381 | error_log($response); |
@@ -389,18 +389,18 @@ discard block |
||
389 | 389 | } else { |
390 | 390 | $previous = libxml_use_internal_errors(true); |
391 | 391 | try { |
392 | - $xml = simplexml_load_file($url,'SimpleXMLElement', LIBXML_NOCDATA); |
|
392 | + $xml = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA); |
|
393 | 393 | return $xml; |
394 | - } catch (Exception $e){ |
|
394 | + } catch (Exception $e) { |
|
395 | 395 | libxml_use_internal_errors($previous); |
396 | 396 | return NULL; |
397 | 397 | } |
398 | 398 | } |
399 | 399 | } |
400 | 400 | |
401 | -function bigbluebuttonbn_get_role_name($role_shortname){ |
|
401 | +function bigbluebuttonbn_get_role_name($role_shortname) { |
|
402 | 402 | $role = bigbluebuttonbn_get_db_moodle_roles($role_shortname); |
403 | - if( $role != null && $role->name != "") { |
|
403 | + if ($role != null && $role->name != "") { |
|
404 | 404 | $role_name = $role->name; |
405 | 405 | } else { |
406 | 406 | switch ($role_shortname) { |
@@ -420,13 +420,13 @@ discard block |
||
420 | 420 | return $role_name; |
421 | 421 | } |
422 | 422 | |
423 | -function bigbluebuttonbn_get_roles($rolename='all', $format='json'){ |
|
423 | +function bigbluebuttonbn_get_roles($rolename = 'all', $format = 'json') { |
|
424 | 424 | $roles = bigbluebuttonbn_get_db_moodle_roles($rolename); |
425 | 425 | $roles_array = array(); |
426 | - foreach($roles as $role){ |
|
427 | - if( $format=='json' ) { |
|
426 | + foreach ($roles as $role) { |
|
427 | + if ($format == 'json') { |
|
428 | 428 | array_push($roles_array, |
429 | - array( "id" => $role->shortname, |
|
429 | + array("id" => $role->shortname, |
|
430 | 430 | "name" => bigbluebuttonbn_get_role_name($role->shortname) |
431 | 431 | ) |
432 | 432 | ); |
@@ -437,19 +437,19 @@ discard block |
||
437 | 437 | return $roles_array; |
438 | 438 | } |
439 | 439 | |
440 | -function bigbluebuttonbn_get_roles_json($rolename='all'){ |
|
440 | +function bigbluebuttonbn_get_roles_json($rolename = 'all') { |
|
441 | 441 | return json_encode(bigbluebuttonbn_get_roles($rolename)); |
442 | 442 | } |
443 | 443 | |
444 | -function bigbluebuttonbn_get_users_json($users, $full=false) { |
|
445 | - if( $full ) { |
|
444 | +function bigbluebuttonbn_get_users_json($users, $full = false) { |
|
445 | + if ($full) { |
|
446 | 446 | return json_encode($users); |
447 | 447 | } else { |
448 | 448 | $users_array = array(); |
449 | - foreach($users as $user){ |
|
449 | + foreach ($users as $user) { |
|
450 | 450 | array_push($users_array, |
451 | - array( "id" => $user->id, |
|
452 | - "name" => $user->firstname.' '.$user->lastname |
|
451 | + array("id" => $user->id, |
|
452 | + "name" => $user->firstname . ' ' . $user->lastname |
|
453 | 453 | ) |
454 | 454 | ); |
455 | 455 | } |
@@ -457,15 +457,15 @@ discard block |
||
457 | 457 | } |
458 | 458 | } |
459 | 459 | |
460 | -function bigbluebuttonbn_get_participant_list($bigbluebuttonbn=null, $context=null){ |
|
460 | +function bigbluebuttonbn_get_participant_list($bigbluebuttonbn = null, $context = null) { |
|
461 | 461 | global $CFG, $USER; |
462 | 462 | |
463 | 463 | $participant_list_array = array(); |
464 | 464 | |
465 | - if( $bigbluebuttonbn != null ) { |
|
465 | + if ($bigbluebuttonbn != null) { |
|
466 | 466 | $participant_list = json_decode($bigbluebuttonbn->participants); |
467 | 467 | if (is_array($participant_list)) { |
468 | - foreach($participant_list as $participant){ |
|
468 | + foreach ($participant_list as $participant) { |
|
469 | 469 | array_push($participant_list_array, |
470 | 470 | array( |
471 | 471 | "selectiontype" => $participant->selectiontype, |
@@ -485,16 +485,16 @@ discard block |
||
485 | 485 | ); |
486 | 486 | |
487 | 487 | $moderator_defaults = bigbluebuttonbn_get_cfg_moderator_default(); |
488 | - if ( !isset($moderator_defaults) ) { |
|
488 | + if (!isset($moderator_defaults)) { |
|
489 | 489 | $moderator_defaults = array('owner'); |
490 | 490 | } else { |
491 | 491 | $moderator_defaults = explode(',', $moderator_defaults); |
492 | 492 | } |
493 | - foreach( $moderator_defaults as $moderator_default ) { |
|
494 | - if( $moderator_default == 'owner' ) { |
|
493 | + foreach ($moderator_defaults as $moderator_default) { |
|
494 | + if ($moderator_default == 'owner') { |
|
495 | 495 | $users = bigbluebuttonbn_get_users($context); |
496 | - foreach( $users as $user ){ |
|
497 | - if( $user->id == $USER->id ){ |
|
496 | + foreach ($users as $user) { |
|
497 | + if ($user->id == $USER->id) { |
|
498 | 498 | array_push($participant_list_array, |
499 | 499 | array( |
500 | 500 | "selectiontype" => "user", |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | return $participant_list_array; |
521 | 521 | } |
522 | 522 | |
523 | -function bigbluebuttonbn_get_participant_list_json($bigbluebuttonbnid=null){ |
|
523 | +function bigbluebuttonbn_get_participant_list_json($bigbluebuttonbnid = null) { |
|
524 | 524 | return json_encode(bigbluebuttonbn_get_participant_list($bigbluebuttonbnid)); |
525 | 525 | } |
526 | 526 | |
@@ -529,21 +529,21 @@ discard block |
||
529 | 529 | |
530 | 530 | if (is_array($participant_list)) { |
531 | 531 | // Iterate looking for all configuration |
532 | - foreach($participant_list as $participant){ |
|
533 | - if( $participant->selectiontype == 'all' ) { |
|
534 | - if ( $participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR ) |
|
532 | + foreach ($participant_list as $participant) { |
|
533 | + if ($participant->selectiontype == 'all') { |
|
534 | + if ($participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR) |
|
535 | 535 | return true; |
536 | 536 | } |
537 | 537 | } |
538 | 538 | |
539 | 539 | //Iterate looking for roles |
540 | 540 | $db_moodle_roles = bigbluebuttonbn_get_db_moodle_roles(); |
541 | - foreach($participant_list as $participant){ |
|
542 | - if( $participant->selectiontype == 'role' ) { |
|
543 | - foreach( $roles as $role ) { |
|
541 | + foreach ($participant_list as $participant) { |
|
542 | + if ($participant->selectiontype == 'role') { |
|
543 | + foreach ($roles as $role) { |
|
544 | 544 | $db_moodle_role = bigbluebuttonbn_moodle_db_role_lookup($db_moodle_roles, $role->roleid); |
545 | - if( $participant->selectionid == $db_moodle_role->shortname ) { |
|
546 | - if ( $participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR ) |
|
545 | + if ($participant->selectionid == $db_moodle_role->shortname) { |
|
546 | + if ($participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR) |
|
547 | 547 | return true; |
548 | 548 | } |
549 | 549 | } |
@@ -551,10 +551,10 @@ discard block |
||
551 | 551 | } |
552 | 552 | |
553 | 553 | //Iterate looking for users |
554 | - foreach($participant_list as $participant){ |
|
555 | - if( $participant->selectiontype == 'user' ) { |
|
556 | - if( $participant->selectionid == $user ) { |
|
557 | - if ( $participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR ) |
|
554 | + foreach ($participant_list as $participant) { |
|
555 | + if ($participant->selectiontype == 'user') { |
|
556 | + if ($participant->selectionid == $user) { |
|
557 | + if ($participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR) |
|
558 | 558 | return true; |
559 | 559 | } |
560 | 560 | } |
@@ -565,8 +565,8 @@ discard block |
||
565 | 565 | } |
566 | 566 | |
567 | 567 | function bigbluebuttonbn_moodle_db_role_lookup($db_moodle_roles, $role_id) { |
568 | - foreach( $db_moodle_roles as $db_moodle_role ){ |
|
569 | - if( $role_id == $db_moodle_role->id ) { |
|
568 | + foreach ($db_moodle_roles as $db_moodle_role) { |
|
569 | + if ($role_id == $db_moodle_role->id) { |
|
570 | 570 | return $db_moodle_role; |
571 | 571 | } |
572 | 572 | } |
@@ -574,22 +574,22 @@ discard block |
||
574 | 574 | |
575 | 575 | function bigbluebuttonbn_get_error_key($messageKey, $defaultKey = null) { |
576 | 576 | $key = $defaultKey; |
577 | - if ( $messageKey == "checksumError" ){ |
|
577 | + if ($messageKey == "checksumError") { |
|
578 | 578 | $key = 'index_error_checksum'; |
579 | - } else if ( $messageKey == 'maxConcurrent' ) { |
|
579 | + } else if ($messageKey == 'maxConcurrent') { |
|
580 | 580 | $key = 'view_error_max_concurrent'; |
581 | 581 | } |
582 | 582 | return $key; |
583 | 583 | } |
584 | 584 | |
585 | -function bigbluebuttonbn_voicebridge_unique($voicebridge, $id=null) { |
|
585 | +function bigbluebuttonbn_voicebridge_unique($voicebridge, $id = null) { |
|
586 | 586 | global $DB; |
587 | 587 | $is_unique = true; |
588 | - if( $voicebridge != 0 ) { |
|
588 | + if ($voicebridge != 0) { |
|
589 | 589 | $table = "bigbluebuttonbn"; |
590 | - $select = "voicebridge = ".$voicebridge; |
|
591 | - if( $id ) $select .= " AND id <> ".$id; |
|
592 | - if ( $rooms = $DB->get_records_select($table, $select) ) { |
|
590 | + $select = "voicebridge = " . $voicebridge; |
|
591 | + if ($id) $select .= " AND id <> " . $id; |
|
592 | + if ($rooms = $DB->get_records_select($table, $select)) { |
|
593 | 593 | $is_unique = false; |
594 | 594 | } |
595 | 595 | } |
@@ -602,8 +602,8 @@ discard block |
||
602 | 602 | |
603 | 603 | $duration = 0; |
604 | 604 | $now = time(); |
605 | - if( $closingtime > 0 && $now < $closingtime ) { |
|
606 | - $duration = ceil(($closingtime - $now)/60); |
|
605 | + if ($closingtime > 0 && $now < $closingtime) { |
|
606 | + $duration = ceil(($closingtime - $now) / 60); |
|
607 | 607 | $compensation_time = intval(bigbluebuttonbn_get_cfg_scheduled_duration_compensation()); |
608 | 608 | $duration = intval($duration) + $compensation_time; |
609 | 609 | } |
@@ -611,13 +611,13 @@ discard block |
||
611 | 611 | return $duration; |
612 | 612 | } |
613 | 613 | |
614 | -function bigbluebuttonbn_get_presentation_array($context, $presentation, $id=null) { |
|
614 | +function bigbluebuttonbn_get_presentation_array($context, $presentation, $id = null) { |
|
615 | 615 | $presentation_name = null; |
616 | 616 | $presentation_url = null; |
617 | 617 | $presentation_icon = null; |
618 | 618 | $presentation_mimetype_description = null; |
619 | 619 | |
620 | - if( !empty($presentation) ) { |
|
620 | + if (!empty($presentation)) { |
|
621 | 621 | $fs = get_file_storage(); |
622 | 622 | $files = $fs->get_area_files($context->id, 'mod_bigbluebuttonbn', 'presentation', 0, 'itemid, filepath, filename', false); |
623 | 623 | if (count($files) < 1) { |
@@ -631,12 +631,12 @@ discard block |
||
631 | 631 | $presentation_icon = file_file_icon($file, 24); |
632 | 632 | $presentation_mimetype_description = get_mimetype_description($file); |
633 | 633 | |
634 | - if( !is_null($id) ) { |
|
634 | + if (!is_null($id)) { |
|
635 | 635 | //Create the nonce component for granting a temporary public access |
636 | 636 | $cache = cache::make_from_params(cache_store::MODE_APPLICATION, 'mod_bigbluebuttonbn', 'presentation_cache'); |
637 | 637 | $presentation_nonce_key = sha1($id); |
638 | 638 | $presentation_nonce_value = bigbluebuttonbn_generate_nonce(); |
639 | - $cache->set($presentation_nonce_key, array( "value" => $presentation_nonce_value, "counter" => 0 )); |
|
639 | + $cache->set($presentation_nonce_key, array("value" => $presentation_nonce_value, "counter" => 0)); |
|
640 | 640 | |
641 | 641 | //The item id was adapted for granting public access to the presentation once in order to allow BigBlueButton to gather the file |
642 | 642 | $url = moodle_url::make_pluginfile_url($file->get_contextid(), $file->get_component(), $file->get_filearea(), $presentation_nonce_value, $file->get_filepath(), $file->get_filename()); |
@@ -647,7 +647,7 @@ discard block |
||
647 | 647 | } |
648 | 648 | } |
649 | 649 | |
650 | - $presentation_array = array( "url" => $presentation_url, "name" => $presentation_name, "icon" => $presentation_icon, "mimetype_description" => $presentation_mimetype_description); |
|
650 | + $presentation_array = array("url" => $presentation_url, "name" => $presentation_name, "icon" => $presentation_icon, "mimetype_description" => $presentation_mimetype_description); |
|
651 | 651 | |
652 | 652 | return $presentation_array; |
653 | 653 | } |
@@ -657,13 +657,13 @@ discard block |
||
657 | 657 | $mt = microtime(); |
658 | 658 | $rand = mt_rand(); |
659 | 659 | |
660 | - return md5($mt.$rand); |
|
660 | + return md5($mt . $rand); |
|
661 | 661 | } |
662 | 662 | |
663 | -function bigbluebuttonbn_random_password( $length = 8 ) { |
|
663 | +function bigbluebuttonbn_random_password($length = 8) { |
|
664 | 664 | |
665 | 665 | $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_-=+;:,.?"; |
666 | - $password = substr( str_shuffle( $chars ), 0, $length ); |
|
666 | + $password = substr(str_shuffle($chars), 0, $length); |
|
667 | 667 | |
668 | 668 | return $password; |
669 | 669 | } |
@@ -755,7 +755,7 @@ discard block |
||
755 | 755 | global $CFG; |
756 | 756 | |
757 | 757 | $version_major = bigbluebuttonbn_get_moodle_version_major(); |
758 | - if ( $version_major < '2014051200' ) { |
|
758 | + if ($version_major < '2014051200') { |
|
759 | 759 | //This is valid before v2.7 |
760 | 760 | bigbluebuttonbn_event_log_legacy($event_type, $bigbluebuttonbn, $context, $cm); |
761 | 761 | |
@@ -765,7 +765,7 @@ discard block |
||
765 | 765 | } |
766 | 766 | } |
767 | 767 | |
768 | -function bigbluebuttonbn_bbb_broker_get_recordings($meetingid, $password, $forced=false) { |
|
768 | +function bigbluebuttonbn_bbb_broker_get_recordings($meetingid, $password, $forced = false) { |
|
769 | 769 | global $CFG; |
770 | 770 | |
771 | 771 | $recordings = array(); |
@@ -781,19 +781,19 @@ discard block |
||
781 | 781 | $result = $cache->get($meetingid); |
782 | 782 | $meeting_info = json_decode($result['meeting_info']); |
783 | 783 | $meeting_info->participantCount += 1; |
784 | - if( $is_moderator ) { |
|
784 | + if ($is_moderator) { |
|
785 | 785 | $meeting_info->moderatorCount += 1; |
786 | 786 | } |
787 | - $cache->set($meetingid, array('creation_time' => $result['creation_time'], 'meeting_info' => json_encode($meeting_info) )); |
|
787 | + $cache->set($meetingid, array('creation_time' => $result['creation_time'], 'meeting_info' => json_encode($meeting_info))); |
|
788 | 788 | } |
789 | 789 | |
790 | 790 | function bigbluebuttonbn_bbb_broker_is_meeting_running($meeting_info) { |
791 | - $meeting_running = ( isset($meeting_info) && isset($meeting_info->returncode) && $meeting_info->returncode == 'SUCCESS' ); |
|
791 | + $meeting_running = (isset($meeting_info) && isset($meeting_info->returncode) && $meeting_info->returncode == 'SUCCESS'); |
|
792 | 792 | |
793 | 793 | return $meeting_running; |
794 | 794 | } |
795 | 795 | |
796 | -function bigbluebuttonbn_bbb_broker_get_meeting_info($meetingid, $password, $forced=false) { |
|
796 | +function bigbluebuttonbn_bbb_broker_get_meeting_info($meetingid, $password, $forced = false) { |
|
797 | 797 | global $CFG; |
798 | 798 | |
799 | 799 | $meeting_info = array(); |
@@ -804,19 +804,19 @@ discard block |
||
804 | 804 | $cache = cache::make_from_params(cache_store::MODE_APPLICATION, 'mod_bigbluebuttonbn', 'meetings_cache'); |
805 | 805 | $result = $cache->get($meetingid); |
806 | 806 | $now = time(); |
807 | - if( isset($result) && $now < ($result['creation_time'] + $cache_ttl) && !$forced ) { |
|
807 | + if (isset($result) && $now < ($result['creation_time'] + $cache_ttl) && !$forced) { |
|
808 | 808 | //Use the value in the cache |
809 | 809 | $meeting_info = json_decode($result['meeting_info']); |
810 | 810 | } else { |
811 | 811 | //Ping again and refresh the cache |
812 | - $meeting_info = (array) bigbluebuttonbn_getMeetingInfo( $meetingid, $password, $endpoint, $shared_secret ); |
|
813 | - $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meeting_info) )); |
|
812 | + $meeting_info = (array)bigbluebuttonbn_getMeetingInfo($meetingid, $password, $endpoint, $shared_secret); |
|
813 | + $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meeting_info))); |
|
814 | 814 | } |
815 | 815 | |
816 | 816 | return $meeting_info; |
817 | 817 | } |
818 | 818 | |
819 | -function bigbluebuttonbn_bbb_broker_do_end_meeting($meetingid, $password){ |
|
819 | +function bigbluebuttonbn_bbb_broker_do_end_meeting($meetingid, $password) { |
|
820 | 820 | global $CFG; |
821 | 821 | |
822 | 822 | $endpoint = bigbluebuttonbn_get_cfg_server_url(); |
@@ -825,16 +825,16 @@ discard block |
||
825 | 825 | bigbluebuttonbn_doEndMeeting($meetingid, $password, $endpoint, $shared_secret); |
826 | 826 | } |
827 | 827 | |
828 | -function bigbluebuttonbn_bbb_broker_do_publish_recording($recordingid, $publish=true){ |
|
828 | +function bigbluebuttonbn_bbb_broker_do_publish_recording($recordingid, $publish = true) { |
|
829 | 829 | global $CFG; |
830 | 830 | |
831 | 831 | $endpoint = bigbluebuttonbn_get_cfg_server_url(); |
832 | 832 | $shared_secret = bigbluebuttonbn_get_cfg_shared_secret(); |
833 | 833 | |
834 | - bigbluebuttonbn_doPublishRecordings($recordingid, ($publish)? 'true': 'false', $endpoint, $shared_secret); |
|
834 | + bigbluebuttonbn_doPublishRecordings($recordingid, ($publish) ? 'true' : 'false', $endpoint, $shared_secret); |
|
835 | 835 | } |
836 | 836 | |
837 | -function bigbluebuttonbn_bbb_broker_do_delete_recording($recordingid){ |
|
837 | +function bigbluebuttonbn_bbb_broker_do_delete_recording($recordingid) { |
|
838 | 838 | global $CFG; |
839 | 839 | |
840 | 840 | $endpoint = bigbluebuttonbn_get_cfg_server_url(); |
@@ -846,18 +846,18 @@ discard block |
||
846 | 846 | function bigbluebuttonbn_bbb_broker_validate_parameters($params) { |
847 | 847 | $error = ''; |
848 | 848 | |
849 | - if ( !isset($params['callback']) ) { |
|
849 | + if (!isset($params['callback'])) { |
|
850 | 850 | $error = $bigbluebuttonbn_bbb_broker_add_error($error, 'This call must include a javascript callback.'); |
851 | 851 | } |
852 | 852 | |
853 | - if ( !isset($params['action']) ) { |
|
853 | + if (!isset($params['action'])) { |
|
854 | 854 | $error = $bigbluebuttonbn_bbb_broker_add_error($error, 'Action parameter must be included.'); |
855 | 855 | } else { |
856 | - switch ( strtolower($params['action']) ){ |
|
856 | + switch (strtolower($params['action'])) { |
|
857 | 857 | case 'server_ping': |
858 | 858 | case 'meeting_info': |
859 | 859 | case 'meeting_end': |
860 | - if ( !isset($params['id']) ) { |
|
860 | + if (!isset($params['id'])) { |
|
861 | 861 | $error = $bigbluebuttonbn_bbb_broker_add_error($error, 'The meetingID must be specified.'); |
862 | 862 | } |
863 | 863 | break; |
@@ -866,28 +866,28 @@ discard block |
||
866 | 866 | case 'recording_publish': |
867 | 867 | case 'recording_unpublish': |
868 | 868 | case 'recording_delete': |
869 | - if ( !isset($params['id']) ) { |
|
869 | + if (!isset($params['id'])) { |
|
870 | 870 | $error = bigbluebuttonbn_bbb_broker_add_error($error, 'The recordingID must be specified.'); |
871 | 871 | } |
872 | 872 | break; |
873 | 873 | case 'recording_ready': |
874 | - if( empty($params['signed_parameters']) ) { |
|
874 | + if (empty($params['signed_parameters'])) { |
|
875 | 875 | $error = bigbluebuttonbn_bbb_broker_add_error($error, 'A JWT encoded string must be included as [signed_parameters].'); |
876 | 876 | } |
877 | 877 | break; |
878 | 878 | default: |
879 | - $error = bigbluebuttonbn_bbb_broker_add_error($error, 'Action '.$params['action'].' can not be performed.'); |
|
879 | + $error = bigbluebuttonbn_bbb_broker_add_error($error, 'Action ' . $params['action'] . ' can not be performed.'); |
|
880 | 880 | } |
881 | 881 | } |
882 | 882 | |
883 | 883 | return $error; |
884 | 884 | } |
885 | 885 | |
886 | -function bigbluebuttonbn_bbb_broker_add_error($org_msg, $new_msg='') { |
|
886 | +function bigbluebuttonbn_bbb_broker_add_error($org_msg, $new_msg = '') { |
|
887 | 887 | $error = $org_msg; |
888 | 888 | |
889 | - if( !empty($new_msg) ) { |
|
890 | - if( !empty($error) ) $error .= ' '; |
|
889 | + if (!empty($new_msg)) { |
|
890 | + if (!empty($error)) $error .= ' '; |
|
891 | 891 | $error .= $new_msg; |
892 | 892 | } |
893 | 893 | |
@@ -899,27 +899,27 @@ discard block |
||
899 | 899 | |
900 | 900 | $row = null; |
901 | 901 | |
902 | - if ( $bbbsession['managerecordings'] || $recording['published'] == 'true' ) { |
|
902 | + if ($bbbsession['managerecordings'] || $recording['published'] == 'true') { |
|
903 | 903 | $length = 0; |
904 | - $endTime = isset($recording['endTime'])? floatval($recording['endTime']):0; |
|
904 | + $endTime = isset($recording['endTime']) ? floatval($recording['endTime']) : 0; |
|
905 | 905 | $endTime = $endTime - ($endTime % 1000); |
906 | - $startTime = isset($recording['startTime'])? floatval($recording['startTime']):0; |
|
906 | + $startTime = isset($recording['startTime']) ? floatval($recording['startTime']) : 0; |
|
907 | 907 | $startTime = $startTime - ($startTime % 1000); |
908 | 908 | $duration = intval(($endTime - $startTime) / 60000); |
909 | 909 | |
910 | 910 | //$meta_course = isset($recording['meta_context'])?str_replace('"', '\"', $recording['meta_context']):''; |
911 | 911 | //For backward compatibility |
912 | - if( isset($recording['meta_contextactivity']) ) { |
|
912 | + if (isset($recording['meta_contextactivity'])) { |
|
913 | 913 | $meta_activity = str_replace('"', '\"', $recording['meta_contextactivity']); |
914 | - } if( isset($recording['meta_bbb-recording-name']) ) { |
|
914 | + } if (isset($recording['meta_bbb-recording-name'])) { |
|
915 | 915 | $meta_activity = str_replace('"', '\"', $recording['meta_bbb-recording-name']); |
916 | 916 | } else { |
917 | 917 | $meta_activity = str_replace('"', '\"', $recording['meetingName']); |
918 | 918 | } |
919 | 919 | |
920 | - if( isset($recording['meta_contextactivitydescription']) ) { |
|
920 | + if (isset($recording['meta_contextactivitydescription'])) { |
|
921 | 921 | $meta_description = str_replace('"', '\"', $recording['meta_contextactivitydescription']); |
922 | - } else if( isset($recording['meta_bbb-recording-description']) ) { |
|
922 | + } else if (isset($recording['meta_bbb-recording-description'])) { |
|
923 | 923 | $meta_description = str_replace('"', '\"', $recording['meta_bbb-recording-description']); |
924 | 924 | } else { |
925 | 925 | $meta_description = ''; |
@@ -928,12 +928,12 @@ discard block |
||
928 | 928 | $actionbar = ''; |
929 | 929 | $params['id'] = $bbbsession['cm']->id; |
930 | 930 | $params['recordingid'] = $recording['recordID']; |
931 | - if ( $bbbsession['managerecordings'] ) { |
|
931 | + if ($bbbsession['managerecordings']) { |
|
932 | 932 | $url = '#'; |
933 | 933 | $action = null; |
934 | 934 | |
935 | 935 | ///Set action [show|hide] |
936 | - if ( $recording['published'] == 'true' ){ |
|
936 | + if ($recording['published'] == 'true') { |
|
937 | 937 | $manage_tag = 'hide'; |
938 | 938 | $manage_action = 'unpublish'; |
939 | 939 | } else { |
@@ -941,36 +941,36 @@ discard block |
||
941 | 941 | $manage_action = 'publish'; |
942 | 942 | } |
943 | 943 | |
944 | - if ( bigbluebuttonbn_get_cfg_recording_icons_enabled() ) { |
|
944 | + if (bigbluebuttonbn_get_cfg_recording_icons_enabled()) { |
|
945 | 945 | //With icon for publish/unpublish |
946 | - $icon_attributes = array('id' => 'recording-btn-'.$manage_action.'-'.$recording['recordID']); |
|
947 | - $icon = new pix_icon('t/'.$manage_tag, get_string($manage_tag), 'moodle', $icon_attributes); |
|
948 | - $link_attributes = array('id' => 'recording-link-'.$manage_action.'-'.$recording['recordID'], 'onclick' => 'M.mod_bigbluebuttonbn.broker_manageRecording("'.$manage_action.'", "'.$recording['recordID'].'", "'.$recording['meetingID'].'");'); |
|
946 | + $icon_attributes = array('id' => 'recording-btn-' . $manage_action . '-' . $recording['recordID']); |
|
947 | + $icon = new pix_icon('t/' . $manage_tag, get_string($manage_tag), 'moodle', $icon_attributes); |
|
948 | + $link_attributes = array('id' => 'recording-link-' . $manage_action . '-' . $recording['recordID'], 'onclick' => 'M.mod_bigbluebuttonbn.broker_manageRecording("' . $manage_action . '", "' . $recording['recordID'] . '", "' . $recording['meetingID'] . '");'); |
|
949 | 949 | $actionbar .= $OUTPUT->action_icon($url, $icon, $action, $link_attributes, false); |
950 | 950 | |
951 | 951 | //With icon for delete |
952 | - $icon_attributes = array('id' => 'recording-btn-delete-'.$recording['recordID']); |
|
952 | + $icon_attributes = array('id' => 'recording-btn-delete-' . $recording['recordID']); |
|
953 | 953 | $icon = new pix_icon('t/delete', get_string('delete'), 'moodle', $icon_attributes); |
954 | - $link_attributes = array('id' => 'recording-link-delete-'.$recording['recordID'], 'onclick' => 'if(confirm("'.get_string('view_recording_delete_confirmation', 'bigbluebuttonbn').'?")) M.mod_bigbluebuttonbn.broker_manageRecording("delete", "'.$recording['recordID'].'", "'.$recording['meetingID'].'");'); |
|
954 | + $link_attributes = array('id' => 'recording-link-delete-' . $recording['recordID'], 'onclick' => 'if(confirm("' . get_string('view_recording_delete_confirmation', 'bigbluebuttonbn') . '?")) M.mod_bigbluebuttonbn.broker_manageRecording("delete", "' . $recording['recordID'] . '", "' . $recording['meetingID'] . '");'); |
|
955 | 955 | $actionbar .= $OUTPUT->action_icon($url, $icon, $action, $link_attributes, false); |
956 | 956 | |
957 | 957 | } else { |
958 | 958 | //With text for publish/unpublish |
959 | - $actionbar .= $OUTPUT->action_link($url, get_string($manage_tag), $action, array('title' => get_string($manage_tag), 'class' => 'btn btn-xs', 'onclick' => 'M.mod_bigbluebuttonbn.broker_manageRecording("'.$manage_action.'", "'.$recording['recordID'].'", "'.$recording['meetingID'].'");') ); |
|
959 | + $actionbar .= $OUTPUT->action_link($url, get_string($manage_tag), $action, array('title' => get_string($manage_tag), 'class' => 'btn btn-xs', 'onclick' => 'M.mod_bigbluebuttonbn.broker_manageRecording("' . $manage_action . '", "' . $recording['recordID'] . '", "' . $recording['meetingID'] . '");')); |
|
960 | 960 | $actionbar .= " "; |
961 | 961 | |
962 | 962 | //With text for delete |
963 | - $actionbar .= $OUTPUT->action_link($url, get_string('delete'), $action, array('title' => get_string('delete'), 'class' => 'btn btn-xs btn-danger', 'onclick' => 'if(confirm("Are you sure to delete?")) M.mod_bigbluebuttonbn.broker_manageRecording("delete", "'.$recording['recordID'].'", "'.$recording['meetingID'].'");') ); |
|
963 | + $actionbar .= $OUTPUT->action_link($url, get_string('delete'), $action, array('title' => get_string('delete'), 'class' => 'btn btn-xs btn-danger', 'onclick' => 'if(confirm("Are you sure to delete?")) M.mod_bigbluebuttonbn.broker_manageRecording("delete", "' . $recording['recordID'] . '", "' . $recording['meetingID'] . '");')); |
|
964 | 964 | } |
965 | 965 | } |
966 | 966 | |
967 | 967 | if ($recording['published'] == 'true') { |
968 | - $recording_types = '<div id="playbacks-'.$recording['recordID'].'">'; |
|
968 | + $recording_types = '<div id="playbacks-' . $recording['recordID'] . '">'; |
|
969 | 969 | } else { |
970 | - $recording_types = '<div id="playbacks-'.$recording['recordID'].'" hidden>'; |
|
970 | + $recording_types = '<div id="playbacks-' . $recording['recordID'] . '" hidden>'; |
|
971 | 971 | } |
972 | - foreach ( $recording['playbacks'] as $playback ) { |
|
973 | - $recording_types .= $OUTPUT->action_link($playback['url'], get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'), null, array('title' => get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'), 'target' => '_new') ).' '; |
|
972 | + foreach ($recording['playbacks'] as $playback) { |
|
973 | + $recording_types .= $OUTPUT->action_link($playback['url'], get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn'), null, array('title' => get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn'), 'target' => '_new')) . ' '; |
|
974 | 974 | } |
975 | 975 | $recording_types .= '</div>'; |
976 | 976 | |
@@ -985,7 +985,7 @@ discard block |
||
985 | 985 | $row->date = floatval($recording['startTime']); |
986 | 986 | $row->date_formatted = $formattedStartDate; |
987 | 987 | $row->duration = $duration; |
988 | - if ( $bbbsession['managerecordings'] ) { |
|
988 | + if ($bbbsession['managerecordings']) { |
|
989 | 989 | $row->actionbar = $actionbar; |
990 | 990 | } |
991 | 991 | } |
@@ -1011,7 +1011,7 @@ discard block |
||
1011 | 1011 | array("key" =>"duration", "label" => $view_recording_duration, "width" => "50px") |
1012 | 1012 | ); |
1013 | 1013 | |
1014 | - if ( $bbbsession['managerecordings'] ) { |
|
1014 | + if ($bbbsession['managerecordings']) { |
|
1015 | 1015 | array_push($recordingsbn_columns, array("key" =>"actionbar", "label" => $view_recording_actionbar, "width" => "75px", "allowHTML" => true)); |
1016 | 1016 | } |
1017 | 1017 | |
@@ -1022,10 +1022,10 @@ discard block |
||
1022 | 1022 | $table_data = array(); |
1023 | 1023 | |
1024 | 1024 | ///Build table content |
1025 | - if ( isset($recordings) && !array_key_exists('messageKey', $recordings)) { // There are recordings for this meeting |
|
1026 | - foreach ( $recordings as $recording ) { |
|
1025 | + if (isset($recordings) && !array_key_exists('messageKey', $recordings)) { // There are recordings for this meeting |
|
1026 | + foreach ($recordings as $recording) { |
|
1027 | 1027 | $row = bigbluebuttonbn_get_recording_data_row($bbbsession, $recording); |
1028 | - if( $row != null ) { |
|
1028 | + if ($row != null) { |
|
1029 | 1029 | array_push($table_data, $row); |
1030 | 1030 | } |
1031 | 1031 | } |
@@ -1053,27 +1053,27 @@ discard block |
||
1053 | 1053 | $table->data = array(); |
1054 | 1054 | |
1055 | 1055 | ///Initialize table headers |
1056 | - if ( $bbbsession['managerecordings'] ) { |
|
1057 | - $table->head = array ($view_recording_recording, $view_recording_activity, $view_recording_description, $view_recording_date, $view_recording_duration, $view_recording_actionbar); |
|
1058 | - $table->align = array ('left', 'left', 'left', 'left', 'center', 'left'); |
|
1056 | + if ($bbbsession['managerecordings']) { |
|
1057 | + $table->head = array($view_recording_recording, $view_recording_activity, $view_recording_description, $view_recording_date, $view_recording_duration, $view_recording_actionbar); |
|
1058 | + $table->align = array('left', 'left', 'left', 'left', 'center', 'left'); |
|
1059 | 1059 | } else { |
1060 | - $table->head = array ($view_recording_recording, $view_recording_activity, $view_recording_description, $view_recording_date, $view_recording_duration); |
|
1061 | - $table->align = array ('left', 'left', 'left', 'left', 'center'); |
|
1060 | + $table->head = array($view_recording_recording, $view_recording_activity, $view_recording_description, $view_recording_date, $view_recording_duration); |
|
1061 | + $table->align = array('left', 'left', 'left', 'left', 'center'); |
|
1062 | 1062 | } |
1063 | 1063 | |
1064 | 1064 | ///Build table content |
1065 | - if ( isset($recordings) && !array_key_exists('messageKey', $recordings)) { // There are recordings for this meeting |
|
1066 | - foreach ( $recordings as $recording ){ |
|
1065 | + if (isset($recordings) && !array_key_exists('messageKey', $recordings)) { // There are recordings for this meeting |
|
1066 | + foreach ($recordings as $recording) { |
|
1067 | 1067 | $row = new html_table_row(); |
1068 | - $row->id = 'recording-td-'.$recording['recordID']; |
|
1068 | + $row->id = 'recording-td-' . $recording['recordID']; |
|
1069 | 1069 | |
1070 | 1070 | $row_data = bigbluebuttonbn_get_recording_data_row($bbbsession, $recording); |
1071 | - if( $row_data != null ) { |
|
1071 | + if ($row_data != null) { |
|
1072 | 1072 | $row_data->date_formatted = str_replace(" ", " ", $row_data->date_formatted); |
1073 | - if ( $bbbsession['managerecordings'] ) { |
|
1074 | - $row->cells = array ($row_data->recording, $row_data->activity, $row_data->description, $row_data->date_formatted, $row_data->duration, $row_data->actionbar ); |
|
1073 | + if ($bbbsession['managerecordings']) { |
|
1074 | + $row->cells = array($row_data->recording, $row_data->activity, $row_data->description, $row_data->date_formatted, $row_data->duration, $row_data->actionbar); |
|
1075 | 1075 | } else { |
1076 | - $row->cells = array ($row_data->recording, $row_data->activity, $row_data->description, $row_data->date_formatted, $row_data->duration ); |
|
1076 | + $row->cells = array($row_data->recording, $row_data->activity, $row_data->description, $row_data->date_formatted, $row_data->duration); |
|
1077 | 1077 | } |
1078 | 1078 | |
1079 | 1079 | array_push($table->data, $row); |
@@ -1092,15 +1092,15 @@ discard block |
||
1092 | 1092 | |
1093 | 1093 | /// Build the message_body |
1094 | 1094 | $msg->activity_type = ""; |
1095 | - if( isset($bigbluebuttonbn->type) && $bigbluebuttonbn->type != 0 ) |
|
1095 | + if (isset($bigbluebuttonbn->type) && $bigbluebuttonbn->type != 0) |
|
1096 | 1096 | $msg->activity_type = bigbluebuttonbn_get_predefinedprofile_name($bigbluebuttonbn->type); |
1097 | 1097 | $msg->activity_title = $bigbluebuttonbn->name; |
1098 | - $message_text = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn').' '.$msg->activity_type.' "'.$msg->activity_title.'" '.get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>'; |
|
1098 | + $message_text = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . ' ' . $msg->activity_type . ' "' . $msg->activity_title . '" ' . get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>'; |
|
1099 | 1099 | |
1100 | 1100 | bigbluebuttonbn_send_notification($sender, $bigbluebuttonbn, $message_text); |
1101 | 1101 | } |
1102 | 1102 | |
1103 | -function bigbluebuttonbn_server_offers($capability_name){ |
|
1103 | +function bigbluebuttonbn_server_offers($capability_name) { |
|
1104 | 1104 | global $CFG; |
1105 | 1105 | |
1106 | 1106 | $capability_offered = null; |
@@ -1114,12 +1114,12 @@ discard block |
||
1114 | 1114 | $host_ends = explode(".", $host); |
1115 | 1115 | $host_ends_length = count($host_ends); |
1116 | 1116 | |
1117 | - if( $host_ends_length > 0 && $host_ends[$host_ends_length -1] == 'com' && $host_ends[$host_ends_length -2] == 'blindsidenetworks' ) { |
|
1117 | + if ($host_ends_length > 0 && $host_ends[$host_ends_length - 1] == 'com' && $host_ends[$host_ends_length - 2] == 'blindsidenetworks') { |
|
1118 | 1118 | //Validate the capabilities offered |
1119 | - $capabilities = bigbluebuttonbn_getCapabilitiesArray( $endpoint, $shared_secret ); |
|
1120 | - if( $capabilities ) { |
|
1119 | + $capabilities = bigbluebuttonbn_getCapabilitiesArray($endpoint, $shared_secret); |
|
1120 | + if ($capabilities) { |
|
1121 | 1121 | foreach ($capabilities as $capability) { |
1122 | - if( $capability["name"] == $capability_name) |
|
1122 | + if ($capability["name"] == $capability_name) |
|
1123 | 1123 | $capability_offered = $capability; |
1124 | 1124 | } |
1125 | 1125 | } |
@@ -1128,14 +1128,14 @@ discard block |
||
1128 | 1128 | return $capability_offered; |
1129 | 1129 | } |
1130 | 1130 | |
1131 | -function bigbluebuttonbn_server_offers_bn_capabilities(){ |
|
1131 | +function bigbluebuttonbn_server_offers_bn_capabilities() { |
|
1132 | 1132 | //Validates if the server may have extended capabilities |
1133 | 1133 | $parsed_url = parse_url(bigbluebuttonbn_get_cfg_server_url()); |
1134 | 1134 | $host = isset($parsed_url['host']) ? $parsed_url['host'] : ''; |
1135 | 1135 | $host_ends = explode(".", $host); |
1136 | 1136 | $host_ends_length = count($host_ends); |
1137 | 1137 | |
1138 | - return ( $host_ends_length > 0 && $host_ends[$host_ends_length -1] == 'com' && $host_ends[$host_ends_length -2] == 'blindsidenetworks' ); |
|
1138 | + return ($host_ends_length > 0 && $host_ends[$host_ends_length - 1] == 'com' && $host_ends[$host_ends_length - 2] == 'blindsidenetworks'); |
|
1139 | 1139 | } |
1140 | 1140 | |
1141 | 1141 | function bigbluebuttonbn_get_locales_for_ui() { |
@@ -1168,79 +1168,79 @@ discard block |
||
1168 | 1168 | |
1169 | 1169 | function bigbluebuttonbn_get_cfg_server_url_default() { |
1170 | 1170 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
1171 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_server_url)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_server_url: (isset($CFG->bigbluebuttonbn_server_url)? $CFG->bigbluebuttonbn_server_url: (isset($CFG->BigBlueButtonBNServerURL)? $CFG->BigBlueButtonBNServerURL: 'http://test-install.blindsidenetworks.com/bigbluebutton/'))); |
|
1171 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_server_url) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_server_url : (isset($CFG->bigbluebuttonbn_server_url) ? $CFG->bigbluebuttonbn_server_url : (isset($CFG->BigBlueButtonBNServerURL) ? $CFG->BigBlueButtonBNServerURL : 'http://test-install.blindsidenetworks.com/bigbluebutton/'))); |
|
1172 | 1172 | } |
1173 | 1173 | |
1174 | 1174 | function bigbluebuttonbn_get_cfg_shared_secret_default() { |
1175 | 1175 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
1176 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_shared_secret)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_shared_secret: (isset($CFG->bigbluebuttonbn_shared_secret)? $CFG->bigbluebuttonbn_shared_secret: (isset($CFG->BigBlueButtonBNSecuritySalt)? $CFG->BigBlueButtonBNSecuritySalt: '8cd8ef52e8e101574e400365b55e11a6'))); |
|
1176 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_shared_secret) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_shared_secret : (isset($CFG->bigbluebuttonbn_shared_secret) ? $CFG->bigbluebuttonbn_shared_secret : (isset($CFG->BigBlueButtonBNSecuritySalt) ? $CFG->BigBlueButtonBNSecuritySalt : '8cd8ef52e8e101574e400365b55e11a6'))); |
|
1177 | 1177 | } |
1178 | 1178 | |
1179 | 1179 | function bigbluebuttonbn_get_cfg_voicebridge_editable() { |
1180 | 1180 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
1181 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_voicebridge_editable)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_voicebridge_editable: (isset($CFG->bigbluebuttonbn_voicebridge_editable)? $CFG->bigbluebuttonbn_voicebridge_editable: false)); |
|
1181 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_voicebridge_editable) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_voicebridge_editable : (isset($CFG->bigbluebuttonbn_voicebridge_editable) ? $CFG->bigbluebuttonbn_voicebridge_editable : false)); |
|
1182 | 1182 | } |
1183 | 1183 | |
1184 | 1184 | function bigbluebuttonbn_get_cfg_recording_default() { |
1185 | 1185 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
1186 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_default)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_default: (isset($CFG->bigbluebuttonbn_recording_default)? $CFG->bigbluebuttonbn_recording_default: true)); |
|
1186 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_default) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_default : (isset($CFG->bigbluebuttonbn_recording_default) ? $CFG->bigbluebuttonbn_recording_default : true)); |
|
1187 | 1187 | } |
1188 | 1188 | |
1189 | 1189 | function bigbluebuttonbn_get_cfg_recording_editable() { |
1190 | 1190 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
1191 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_editable)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_editable: (isset($CFG->bigbluebuttonbn_recording_editable)? $CFG->bigbluebuttonbn_recording_editable: true)); |
|
1191 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_editable) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_editable : (isset($CFG->bigbluebuttonbn_recording_editable) ? $CFG->bigbluebuttonbn_recording_editable : true)); |
|
1192 | 1192 | } |
1193 | 1193 | |
1194 | 1194 | function bigbluebuttonbn_get_cfg_recording_tagging_default() { |
1195 | 1195 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
1196 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_default)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_default: (isset($CFG->bigbluebuttonbn_recordingtagging_default)? $CFG->bigbluebuttonbn_recordingtagging_default: false)); |
|
1196 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_default) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_default : (isset($CFG->bigbluebuttonbn_recordingtagging_default) ? $CFG->bigbluebuttonbn_recordingtagging_default : false)); |
|
1197 | 1197 | } |
1198 | 1198 | |
1199 | 1199 | function bigbluebuttonbn_get_cfg_recording_tagging_editable() { |
1200 | 1200 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
1201 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_editable)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_editable: (isset($CFG->bigbluebuttonbn_recordingtagging_editable)? $CFG->bigbluebuttonbn_recordingtagging_editable: false)); |
|
1201 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_editable) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_editable : (isset($CFG->bigbluebuttonbn_recordingtagging_editable) ? $CFG->bigbluebuttonbn_recordingtagging_editable : false)); |
|
1202 | 1202 | } |
1203 | 1203 | |
1204 | 1204 | function bigbluebuttonbn_get_cfg_recording_icons_enabled() { |
1205 | 1205 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
1206 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_icons_enabled)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_icons_enabled: (isset($CFG->bigbluebuttonbn_recording_icons_enabled)? $CFG->bigbluebuttonbn_recording_icons_enabled: true)); |
|
1206 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_icons_enabled) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_icons_enabled : (isset($CFG->bigbluebuttonbn_recording_icons_enabled) ? $CFG->bigbluebuttonbn_recording_icons_enabled : true)); |
|
1207 | 1207 | } |
1208 | 1208 | |
1209 | 1209 | function bigbluebuttonbn_get_cfg_waitformoderator_default() { |
1210 | 1210 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
1211 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_default)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_default: (isset($CFG->bigbluebuttonbn_waitformoderator_default)? $CFG->bigbluebuttonbn_waitformoderator_default: false)); |
|
1211 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_default) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_default : (isset($CFG->bigbluebuttonbn_waitformoderator_default) ? $CFG->bigbluebuttonbn_waitformoderator_default : false)); |
|
1212 | 1212 | } |
1213 | 1213 | |
1214 | 1214 | function bigbluebuttonbn_get_cfg_waitformoderator_editable() { |
1215 | 1215 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
1216 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_editable)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_editable: (isset($CFG->bigbluebuttonbn_waitformoderator_editable)? $CFG->bigbluebuttonbn_waitformoderator_editable: true)); |
|
1216 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_editable) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_editable : (isset($CFG->bigbluebuttonbn_waitformoderator_editable) ? $CFG->bigbluebuttonbn_waitformoderator_editable : true)); |
|
1217 | 1217 | } |
1218 | 1218 | |
1219 | 1219 | function bigbluebuttonbn_get_cfg_waitformoderator_ping_interval() { |
1220 | 1220 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
1221 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_ping_interval)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_ping_interval: (isset($CFG->bigbluebuttonbn_waitformoderator_ping_interval)? $CFG->bigbluebuttonbn_waitformoderator_ping_interval: 15)); |
|
1221 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_ping_interval) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_ping_interval : (isset($CFG->bigbluebuttonbn_waitformoderator_ping_interval) ? $CFG->bigbluebuttonbn_waitformoderator_ping_interval : 15)); |
|
1222 | 1222 | } |
1223 | 1223 | |
1224 | 1224 | function bigbluebuttonbn_get_cfg_waitformoderator_cache_ttl() { |
1225 | 1225 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
1226 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_cache_ttl)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_cache_ttl: (isset($CFG->bigbluebuttonbn_waitformoderator_cache_ttl)? $CFG->bigbluebuttonbn_waitformoderator_cache_ttl: 60)); |
|
1226 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_cache_ttl) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_cache_ttl : (isset($CFG->bigbluebuttonbn_waitformoderator_cache_ttl) ? $CFG->bigbluebuttonbn_waitformoderator_cache_ttl : 60)); |
|
1227 | 1227 | } |
1228 | 1228 | |
1229 | 1229 | function bigbluebuttonbn_get_cfg_userlimit_default() { |
1230 | 1230 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
1231 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_default)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_default: (isset($CFG->bigbluebuttonbn_userlimit_default)? $CFG->bigbluebuttonbn_userlimit_default: 0)); |
|
1231 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_default) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_default : (isset($CFG->bigbluebuttonbn_userlimit_default) ? $CFG->bigbluebuttonbn_userlimit_default : 0)); |
|
1232 | 1232 | } |
1233 | 1233 | |
1234 | 1234 | function bigbluebuttonbn_get_cfg_userlimit_editable() { |
1235 | 1235 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
1236 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_editable)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_editable: (isset($CFG->bigbluebuttonbn_userlimit_editable)? $CFG->bigbluebuttonbn_userlimit_editable: false)); |
|
1236 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_editable) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_editable : (isset($CFG->bigbluebuttonbn_userlimit_editable) ? $CFG->bigbluebuttonbn_userlimit_editable : false)); |
|
1237 | 1237 | } |
1238 | 1238 | |
1239 | 1239 | function bigbluebuttonbn_get_cfg_preuploadpresentation_enabled() { |
1240 | 1240 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
1241 | 1241 | if (extension_loaded('curl')) { |
1242 | 1242 | // This feature only works if curl is installed |
1243 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_preuploadpresentation_enabled)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_preuploadpresentation_enabled: (isset($CFG->bigbluebuttonbn_preuploadpresentation_enabled)? $CFG->bigbluebuttonbn_preuploadpresentation_enabled: false)); |
|
1243 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_preuploadpresentation_enabled) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_preuploadpresentation_enabled : (isset($CFG->bigbluebuttonbn_preuploadpresentation_enabled) ? $CFG->bigbluebuttonbn_preuploadpresentation_enabled : false)); |
|
1244 | 1244 | } else { |
1245 | 1245 | return false; |
1246 | 1246 | } |
@@ -1248,30 +1248,30 @@ discard block |
||
1248 | 1248 | |
1249 | 1249 | function bigbluebuttonbn_get_cfg_sendnotifications_enabled() { |
1250 | 1250 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
1251 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_sendnotifications_enabled)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_sendnotifications_enabled: (isset($CFG->bigbluebuttonbn_sendnotifications_enabled)? $CFG->bigbluebuttonbn_sendnotifications_enabled: false)); |
|
1251 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_sendnotifications_enabled) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_sendnotifications_enabled : (isset($CFG->bigbluebuttonbn_sendnotifications_enabled) ? $CFG->bigbluebuttonbn_sendnotifications_enabled : false)); |
|
1252 | 1252 | } |
1253 | 1253 | |
1254 | 1254 | function bigbluebuttonbn_get_cfg_recordingready_enabled() { |
1255 | 1255 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
1256 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingready_enabled)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingready_enabled: (isset($CFG->bigbluebuttonbn_recordingready_enabled)? $CFG->bigbluebuttonbn_recordingready_enabled: false)); |
|
1256 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingready_enabled) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingready_enabled : (isset($CFG->bigbluebuttonbn_recordingready_enabled) ? $CFG->bigbluebuttonbn_recordingready_enabled : false)); |
|
1257 | 1257 | } |
1258 | 1258 | |
1259 | 1259 | function bigbluebuttonbn_get_cfg_moderator_default() { |
1260 | 1260 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
1261 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_moderator_default)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_moderator_default: (isset($CFG->bigbluebuttonbn_moderator_default)? $CFG->bigbluebuttonbn_moderator_default: 'owner')); |
|
1261 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_moderator_default) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_moderator_default : (isset($CFG->bigbluebuttonbn_moderator_default) ? $CFG->bigbluebuttonbn_moderator_default : 'owner')); |
|
1262 | 1262 | } |
1263 | 1263 | |
1264 | 1264 | function bigbluebuttonbn_get_cfg_scheduled_duration_enabled() { |
1265 | 1265 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
1266 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_scheduled_duration_enabled)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_scheduled_duration_enabled: (isset($CFG->bigbluebuttonbn_scheduled_duration_enabled)? $CFG->bigbluebuttonbn_scheduled_duration_enabled: false)); |
|
1266 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_scheduled_duration_enabled) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_scheduled_duration_enabled : (isset($CFG->bigbluebuttonbn_scheduled_duration_enabled) ? $CFG->bigbluebuttonbn_scheduled_duration_enabled : false)); |
|
1267 | 1267 | } |
1268 | 1268 | |
1269 | 1269 | function bigbluebuttonbn_get_cfg_scheduled_duration_compensation() { |
1270 | 1270 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
1271 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_scheduled_duration_compensation)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_scheduled_duration_compensation: (isset($CFG->bigbluebuttonbn_scheduled_duration_compensation)? $CFG->bigbluebuttonbn_scheduled_duration_compensation: 10)); |
|
1271 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_scheduled_duration_compensation) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_scheduled_duration_compensation : (isset($CFG->bigbluebuttonbn_scheduled_duration_compensation) ? $CFG->bigbluebuttonbn_scheduled_duration_compensation : 10)); |
|
1272 | 1272 | } |
1273 | 1273 | |
1274 | 1274 | function bigbluebuttonbn_get_cfg_scheduled_pre_opening() { |
1275 | 1275 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
1276 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_scheduled_pre_opening)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_scheduled_pre_opening: (isset($CFG->bigbluebuttonbn_scheduled_pre_opening)? $CFG->bigbluebuttonbn_scheduled_pre_opening: 10)); |
|
1276 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_scheduled_pre_opening) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_scheduled_pre_opening : (isset($CFG->bigbluebuttonbn_scheduled_pre_opening) ? $CFG->bigbluebuttonbn_scheduled_pre_opening : 10)); |
|
1277 | 1277 | } |
@@ -47,8 +47,9 @@ discard block |
||
47 | 47 | $log->userid = $bbbsession['userID']; |
48 | 48 | $log->timecreated = time(); |
49 | 49 | $log->event = $event; |
50 | - if( $event == BIGBLUEBUTTONBN_LOG_EVENT_CREATE) |
|
51 | - $log->meta = '{"record":'.($bbbsession['record']? 'true': 'false').'}'; |
|
50 | + if( $event == BIGBLUEBUTTONBN_LOG_EVENT_CREATE) { |
|
51 | + $log->meta = '{"record":'.($bbbsession['record']? 'true': 'false').'}'; |
|
52 | + } |
|
52 | 53 | |
53 | 54 | $returnid = $DB->insert_record('bigbluebuttonbn_log', $log); |
54 | 55 | } |
@@ -68,15 +69,18 @@ discard block |
||
68 | 69 | $params = 'name='.urlencode($name).'&meetingID='.urlencode($meetingID).'&attendeePW='.urlencode($attendeePW).'&moderatorPW='.urlencode($moderatorPW).'&logoutURL='.urlencode($logoutURL).'&record='.$record; |
69 | 70 | |
70 | 71 | $voiceBridge = intval($voiceBridge); |
71 | - if ( $voiceBridge > 0 && $voiceBridge < 79999) |
|
72 | - $params .= '&voiceBridge='.$voiceBridge; |
|
72 | + if ( $voiceBridge > 0 && $voiceBridge < 79999) { |
|
73 | + $params .= '&voiceBridge='.$voiceBridge; |
|
74 | + } |
|
73 | 75 | |
74 | 76 | $duration = intval($duration); |
75 | - if( $duration > 0 ) |
|
76 | - $params .= '&duration='.$duration; |
|
77 | + if( $duration > 0 ) { |
|
78 | + $params .= '&duration='.$duration; |
|
79 | + } |
|
77 | 80 | |
78 | - if( trim( $welcome ) ) |
|
79 | - $params .= '&welcome='.urlencode($welcome); |
|
81 | + if( trim( $welcome ) ) { |
|
82 | + $params .= '&welcome='.urlencode($welcome); |
|
83 | + } |
|
80 | 84 | |
81 | 85 | foreach ($metadata as $key => $value) { |
82 | 86 | $params .= '&'.$key.'='.urlencode($value); |
@@ -148,10 +152,12 @@ discard block |
||
148 | 152 | } |
149 | 153 | |
150 | 154 | if( $xml ) { |
151 | - if($xml->meetingID) return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey, 'meetingID' => $xml->meetingID, 'attendeePW' => $xml->attendeePW, 'moderatorPW' => $xml->moderatorPW, 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded ); |
|
152 | - else return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey ); |
|
153 | - } |
|
154 | - else { |
|
155 | + if($xml->meetingID) { |
|
156 | + return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey, 'meetingID' => $xml->meetingID, 'attendeePW' => $xml->attendeePW, 'moderatorPW' => $xml->moderatorPW, 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded ); |
|
157 | + } else { |
|
158 | + return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey ); |
|
159 | + } |
|
160 | + } else { |
|
155 | 161 | return null; |
156 | 162 | } |
157 | 163 | } |
@@ -223,7 +229,9 @@ discard block |
||
223 | 229 | $metadataArray = array(); |
224 | 230 | $metadata = get_object_vars($recording->metadata); |
225 | 231 | foreach ($metadata as $key => $value) { |
226 | - if(is_object($value)) $value = ''; |
|
232 | + if(is_object($value)) { |
|
233 | + $value = ''; |
|
234 | + } |
|
227 | 235 | $metadataArray['meta_'.$key] = $value; |
228 | 236 | } |
229 | 237 | |
@@ -261,7 +269,9 @@ discard block |
||
261 | 269 | $metadataArray = array(); |
262 | 270 | $metadata = get_object_vars($recording->metadata); |
263 | 271 | foreach ($metadata as $key => $value) { |
264 | - if(is_object($value)) $value = ''; |
|
272 | + if(is_object($value)) { |
|
273 | + $value = ''; |
|
274 | + } |
|
265 | 275 | $metadataArray['meta_'.$key] = $value; |
266 | 276 | } |
267 | 277 | |
@@ -280,17 +290,22 @@ discard block |
||
280 | 290 | } |
281 | 291 | |
282 | 292 | function bigbluebuttonbn_recordingBuildSorter($a, $b){ |
283 | - if( $a['startTime'] < $b['startTime']) return -1; |
|
284 | - else if( $a['startTime'] == $b['startTime']) return 0; |
|
285 | - else return 1; |
|
286 | -} |
|
293 | + if( $a['startTime'] < $b['startTime']) { |
|
294 | + return -1; |
|
295 | + } else if( $a['startTime'] == $b['startTime']) { |
|
296 | + return 0; |
|
297 | + } else { |
|
298 | + return 1; |
|
299 | + } |
|
300 | + } |
|
287 | 301 | |
288 | 302 | function bigbluebuttonbn_doDeleteRecordings( $recordIDs, $URL, $SALT ) { |
289 | 303 | $ids = explode(",", $recordIDs); |
290 | 304 | foreach( $ids as $id){ |
291 | 305 | $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getDeleteRecordingsURL($id, $URL, $SALT) ); |
292 | - if( $xml && $xml->returncode != 'SUCCESS' ) |
|
293 | - return false; |
|
306 | + if( $xml && $xml->returncode != 'SUCCESS' ) { |
|
307 | + return false; |
|
308 | + } |
|
294 | 309 | } |
295 | 310 | return true; |
296 | 311 | } |
@@ -299,8 +314,9 @@ discard block |
||
299 | 314 | $ids = explode(",", $recordIDs); |
300 | 315 | foreach( $ids as $id){ |
301 | 316 | $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getPublishRecordingsURL($id, $set, $URL, $SALT) ); |
302 | - if( $xml && $xml->returncode != 'SUCCESS' ) |
|
303 | - return false; |
|
317 | + if( $xml && $xml->returncode != 'SUCCESS' ) { |
|
318 | + return false; |
|
319 | + } |
|
304 | 320 | } |
305 | 321 | return true; |
306 | 322 | } |
@@ -310,8 +326,7 @@ discard block |
||
310 | 326 | |
311 | 327 | if( $xml ) { //If the xml packet returned failure it displays the message to the user |
312 | 328 | return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); |
313 | - } |
|
314 | - else { //If the server is unreachable, then prompts the user of the necessary action |
|
329 | + } else { //If the server is unreachable, then prompts the user of the necessary action |
|
315 | 330 | return null; |
316 | 331 | } |
317 | 332 | } |
@@ -531,8 +546,9 @@ discard block |
||
531 | 546 | // Iterate looking for all configuration |
532 | 547 | foreach($participant_list as $participant){ |
533 | 548 | if( $participant->selectiontype == 'all' ) { |
534 | - if ( $participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR ) |
|
535 | - return true; |
|
549 | + if ( $participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR ) { |
|
550 | + return true; |
|
551 | + } |
|
536 | 552 | } |
537 | 553 | } |
538 | 554 | |
@@ -543,8 +559,9 @@ discard block |
||
543 | 559 | foreach( $roles as $role ) { |
544 | 560 | $db_moodle_role = bigbluebuttonbn_moodle_db_role_lookup($db_moodle_roles, $role->roleid); |
545 | 561 | if( $participant->selectionid == $db_moodle_role->shortname ) { |
546 | - if ( $participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR ) |
|
547 | - return true; |
|
562 | + if ( $participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR ) { |
|
563 | + return true; |
|
564 | + } |
|
548 | 565 | } |
549 | 566 | } |
550 | 567 | } |
@@ -554,8 +571,9 @@ discard block |
||
554 | 571 | foreach($participant_list as $participant){ |
555 | 572 | if( $participant->selectiontype == 'user' ) { |
556 | 573 | if( $participant->selectionid == $user ) { |
557 | - if ( $participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR ) |
|
558 | - return true; |
|
574 | + if ( $participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR ) { |
|
575 | + return true; |
|
576 | + } |
|
559 | 577 | } |
560 | 578 | } |
561 | 579 | } |
@@ -588,7 +606,9 @@ discard block |
||
588 | 606 | if( $voicebridge != 0 ) { |
589 | 607 | $table = "bigbluebuttonbn"; |
590 | 608 | $select = "voicebridge = ".$voicebridge; |
591 | - if( $id ) $select .= " AND id <> ".$id; |
|
609 | + if( $id ) { |
|
610 | + $select .= " AND id <> ".$id; |
|
611 | + } |
|
592 | 612 | if ( $rooms = $DB->get_records_select($table, $select) ) { |
593 | 613 | $is_unique = false; |
594 | 614 | } |
@@ -887,7 +907,9 @@ discard block |
||
887 | 907 | $error = $org_msg; |
888 | 908 | |
889 | 909 | if( !empty($new_msg) ) { |
890 | - if( !empty($error) ) $error .= ' '; |
|
910 | + if( !empty($error) ) { |
|
911 | + $error .= ' '; |
|
912 | + } |
|
891 | 913 | $error .= $new_msg; |
892 | 914 | } |
893 | 915 | |
@@ -1092,8 +1114,9 @@ discard block |
||
1092 | 1114 | |
1093 | 1115 | /// Build the message_body |
1094 | 1116 | $msg->activity_type = ""; |
1095 | - if( isset($bigbluebuttonbn->type) && $bigbluebuttonbn->type != 0 ) |
|
1096 | - $msg->activity_type = bigbluebuttonbn_get_predefinedprofile_name($bigbluebuttonbn->type); |
|
1117 | + if( isset($bigbluebuttonbn->type) && $bigbluebuttonbn->type != 0 ) { |
|
1118 | + $msg->activity_type = bigbluebuttonbn_get_predefinedprofile_name($bigbluebuttonbn->type); |
|
1119 | + } |
|
1097 | 1120 | $msg->activity_title = $bigbluebuttonbn->name; |
1098 | 1121 | $message_text = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn').' '.$msg->activity_type.' "'.$msg->activity_title.'" '.get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>'; |
1099 | 1122 | |
@@ -1119,8 +1142,9 @@ discard block |
||
1119 | 1142 | $capabilities = bigbluebuttonbn_getCapabilitiesArray( $endpoint, $shared_secret ); |
1120 | 1143 | if( $capabilities ) { |
1121 | 1144 | foreach ($capabilities as $capability) { |
1122 | - if( $capability["name"] == $capability_name) |
|
1123 | - $capability_offered = $capability; |
|
1145 | + if( $capability["name"] == $capability_name) { |
|
1146 | + $capability_offered = $capability; |
|
1147 | + } |
|
1124 | 1148 | } |
1125 | 1149 | } |
1126 | 1150 | } |
@@ -280,28 +280,28 @@ discard block |
||
280 | 280 | echo $OUTPUT->box_end(); |
281 | 281 | if( $bbbsession['tagging'] && ($bbbsession['administrator'] || $bbbsession['moderator']) ){ |
282 | 282 | echo ''. |
283 | - '<div id="panelContent" class="hidden">'. |
|
284 | - ' <div class="yui3-widget-bd">'. |
|
285 | - ' <form>'. |
|
286 | - ' <fieldset>'. |
|
287 | - ' <input type="hidden" name="join" id="meeting_join_url" value="">'. |
|
288 | - ' <input type="hidden" name="message" id="meeting_message" value="">'. |
|
289 | - ' <div>'. |
|
290 | - ' <label for="name">'.get_string('view_recording_name', 'bigbluebuttonbn').'</label><br/>'. |
|
291 | - ' <input type="text" name="name" id="recording_name" placeholder="">'. |
|
292 | - ' </div><br>'. |
|
293 | - ' <div>'. |
|
294 | - ' <label for="description">'.get_string('view_recording_description', 'bigbluebuttonbn').'</label><br/>'. |
|
295 | - ' <input type="text" name="description" id="recording_description" value="" placeholder="">'. |
|
296 | - ' </div><br>'. |
|
297 | - ' <div>'. |
|
298 | - ' <label for="tags">'.get_string('view_recording_tags', 'bigbluebuttonbn').'</label><br/>'. |
|
299 | - ' <input type="text" name="tags" id="recording_tags" value="" placeholder="">'. |
|
300 | - ' </div>'. |
|
301 | - ' </fieldset>'. |
|
302 | - ' </form>'. |
|
303 | - ' </div>'. |
|
304 | - '</div>'; |
|
283 | + '<div id="panelContent" class="hidden">'. |
|
284 | + ' <div class="yui3-widget-bd">'. |
|
285 | + ' <form>'. |
|
286 | + ' <fieldset>'. |
|
287 | + ' <input type="hidden" name="join" id="meeting_join_url" value="">'. |
|
288 | + ' <input type="hidden" name="message" id="meeting_message" value="">'. |
|
289 | + ' <div>'. |
|
290 | + ' <label for="name">'.get_string('view_recording_name', 'bigbluebuttonbn').'</label><br/>'. |
|
291 | + ' <input type="text" name="name" id="recording_name" placeholder="">'. |
|
292 | + ' </div><br>'. |
|
293 | + ' <div>'. |
|
294 | + ' <label for="description">'.get_string('view_recording_description', 'bigbluebuttonbn').'</label><br/>'. |
|
295 | + ' <input type="text" name="description" id="recording_description" value="" placeholder="">'. |
|
296 | + ' </div><br>'. |
|
297 | + ' <div>'. |
|
298 | + ' <label for="tags">'.get_string('view_recording_tags', 'bigbluebuttonbn').'</label><br/>'. |
|
299 | + ' <input type="text" name="tags" id="recording_tags" value="" placeholder="">'. |
|
300 | + ' </div>'. |
|
301 | + ' </fieldset>'. |
|
302 | + ' </form>'. |
|
303 | + ' </div>'. |
|
304 | + '</div>'; |
|
305 | 305 | } |
306 | 306 | |
307 | 307 | echo $OUTPUT->box_start('generalbox boxaligncenter', 'bigbluebuttonbn_view_action_button_box'); |
@@ -338,8 +338,8 @@ discard block |
||
338 | 338 | $icon = new pix_icon($bbbsession['presentation']['icon'], $bbbsession['presentation']['mimetype_description']); |
339 | 339 | |
340 | 340 | echo '<h4>'.get_string('view_section_title_presentation', 'bigbluebuttonbn').'</h4>'. |
341 | - ''.$OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false).''. |
|
342 | - ''.$OUTPUT->action_link($bbbsession['presentation']['url'], $bbbsession['presentation']['name'], null, $attributes).'<br><br>'; |
|
341 | + ''.$OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false).''. |
|
342 | + ''.$OUTPUT->action_link($bbbsession['presentation']['url'], $bbbsession['presentation']['name'], null, $attributes).'<br><br>'; |
|
343 | 343 | } |
344 | 344 | |
345 | 345 | bigbluebuttonbn_view_recordings($bbbsession); |
@@ -9,12 +9,12 @@ discard block |
||
9 | 9 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v2 or later |
10 | 10 | */ |
11 | 11 | |
12 | -require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); |
|
13 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
12 | +require_once(dirname(dirname(dirname(__FILE__))) . '/config.php'); |
|
13 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
14 | 14 | |
15 | -$id = required_param('id', PARAM_INT); // Course Module ID, or |
|
16 | -$b = optional_param('n', 0, PARAM_INT); // bigbluebuttonbn instance ID |
|
17 | -$group = optional_param('group', 0, PARAM_INT); // group instance ID |
|
15 | +$id = required_param('id', PARAM_INT); // Course Module ID, or |
|
16 | +$b = optional_param('n', 0, PARAM_INT); // bigbluebuttonbn instance ID |
|
17 | +$group = optional_param('group', 0, PARAM_INT); // group instance ID |
|
18 | 18 | |
19 | 19 | if ($id) { |
20 | 20 | $cm = get_coursemodule_from_id('bigbluebuttonbn', $id, 0, false, MUST_EXIST); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | require_login($course, true, $cm); |
32 | 32 | |
33 | 33 | $version_major = bigbluebuttonbn_get_moodle_version_major(); |
34 | -if ( $version_major < '2013111800' ) { |
|
34 | +if ($version_major < '2013111800') { |
|
35 | 35 | //This is valid before v2.6 |
36 | 36 | $module = $DB->get_record('modules', array('name' => 'bigbluebuttonbn')); |
37 | 37 | $module_version = $module->version; |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $bbbsession['roles'] = get_user_roles($context, $USER->id, true); |
58 | 58 | |
59 | 59 | // User roles |
60 | -if( $bigbluebuttonbn->participants == null || $bigbluebuttonbn->participants == "" || $bigbluebuttonbn->participants == "[]" ){ |
|
60 | +if ($bigbluebuttonbn->participants == null || $bigbluebuttonbn->participants == "" || $bigbluebuttonbn->participants == "[]") { |
|
61 | 61 | //The room that is being used comes from a previous version |
62 | 62 | $bbbsession['moderator'] = has_capability('mod/bigbluebuttonbn:moderate', $context); |
63 | 63 | } else { |
@@ -77,16 +77,16 @@ discard block |
||
77 | 77 | // Database info related to the activity |
78 | 78 | $bbbsession['meetingdescription'] = $bigbluebuttonbn->intro; |
79 | 79 | $bbbsession['welcome'] = $bigbluebuttonbn->welcome; |
80 | -if( !isset($bbbsession['welcome']) || $bbbsession['welcome'] == '') { |
|
80 | +if (!isset($bbbsession['welcome']) || $bbbsession['welcome'] == '') { |
|
81 | 81 | $bbbsession['welcome'] = get_string('mod_form_field_welcome_default', 'bigbluebuttonbn'); |
82 | 82 | } |
83 | 83 | |
84 | 84 | $bbbsession['userlimit'] = intval($bigbluebuttonbn->userlimit); |
85 | -$bbbsession['voicebridge'] = ($bigbluebuttonbn->voicebridge > 0)? 70000 + $bigbluebuttonbn->voicebridge: $bigbluebuttonbn->voicebridge; |
|
85 | +$bbbsession['voicebridge'] = ($bigbluebuttonbn->voicebridge > 0) ? 70000 + $bigbluebuttonbn->voicebridge : $bigbluebuttonbn->voicebridge; |
|
86 | 86 | $bbbsession['wait'] = $bigbluebuttonbn->wait; |
87 | 87 | $bbbsession['record'] = $bigbluebuttonbn->record; |
88 | -if( $bigbluebuttonbn->record ) |
|
89 | - $bbbsession['welcome'] .= '<br><br>'.get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
|
88 | +if ($bigbluebuttonbn->record) |
|
89 | + $bbbsession['welcome'] .= '<br><br>' . get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
|
90 | 90 | $bbbsession['tagging'] = $bigbluebuttonbn->tagging; |
91 | 91 | |
92 | 92 | $bbbsession['openingtime'] = $bigbluebuttonbn->openingtime; |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $bbbsession['originServerName'] = $parsedUrl['host']; |
107 | 107 | $bbbsession['originServerUrl'] = $CFG->wwwroot; |
108 | 108 | $bbbsession['originServerCommonName'] = ''; |
109 | -$bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn ('.$module_version.')'; |
|
109 | +$bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn (' . $module_version . ')'; |
|
110 | 110 | // Metadata (context) |
111 | 111 | $bbbsession['contextActivityName'] = ""; |
112 | 112 | $bbbsession['contextActivityDescription'] = ""; |
@@ -117,22 +117,22 @@ discard block |
||
117 | 117 | |
118 | 118 | // Validates if the BigBlueButton server is running |
119 | 119 | $serverVersion = bigbluebuttonbn_getServerVersion($bbbsession['endpoint']); |
120 | -if ( !isset($serverVersion) ) { //Server is not working |
|
121 | - if ( $bbbsession['administrator'] ) |
|
122 | - print_error( 'view_error_unable_join', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
|
123 | - else if ( $bbbsession['moderator'] ) |
|
124 | - print_error( 'view_error_unable_join_teacher', 'bigbluebuttonbn', $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course ); |
|
120 | +if (!isset($serverVersion)) { //Server is not working |
|
121 | + if ($bbbsession['administrator']) |
|
122 | + print_error('view_error_unable_join', 'bigbluebuttonbn', $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
123 | + else if ($bbbsession['moderator']) |
|
124 | + print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course); |
|
125 | 125 | else |
126 | - print_error( 'view_error_unable_join_student', 'bigbluebuttonbn', $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course ); |
|
126 | + print_error('view_error_unable_join_student', 'bigbluebuttonbn', $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course); |
|
127 | 127 | } else { |
128 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getMeetingsURL( $bbbsession['endpoint'], $bbbsession['shared_secret'] ) ); |
|
129 | - if ( !isset($xml) || !isset($xml->returncode) || $xml->returncode == 'FAILED' ){ // The shared secret is wrong |
|
130 | - if ( $bbbsession['administrator'] ) |
|
131 | - print_error( 'view_error_unable_join', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
|
132 | - else if ( $bbbsession['moderator'] ) |
|
133 | - print_error( 'view_error_unable_join_teacher', 'bigbluebuttonbn', $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course ); |
|
128 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getMeetingsURL($bbbsession['endpoint'], $bbbsession['shared_secret'])); |
|
129 | + if (!isset($xml) || !isset($xml->returncode) || $xml->returncode == 'FAILED') { // The shared secret is wrong |
|
130 | + if ($bbbsession['administrator']) |
|
131 | + print_error('view_error_unable_join', 'bigbluebuttonbn', $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
132 | + else if ($bbbsession['moderator']) |
|
133 | + print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course); |
|
134 | 134 | else |
135 | - print_error( 'view_error_unable_join_student', 'bigbluebuttonbn', $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course ); |
|
135 | + print_error('view_error_unable_join_student', 'bigbluebuttonbn', $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course); |
|
136 | 136 | } |
137 | 137 | } |
138 | 138 | |
@@ -142,12 +142,12 @@ discard block |
||
142 | 142 | |
143 | 143 | // Print the page header |
144 | 144 | $PAGE->set_context($context); |
145 | -$PAGE->set_url($CFG->wwwroot.'/mod/bigbluebuttonbn/view.php', array('id' => $cm->id)); |
|
145 | +$PAGE->set_url($CFG->wwwroot . '/mod/bigbluebuttonbn/view.php', array('id' => $cm->id)); |
|
146 | 146 | $PAGE->set_title(format_string($bigbluebuttonbn->name)); |
147 | 147 | $PAGE->set_cacheable(false); |
148 | 148 | $PAGE->set_heading($course->shortname); |
149 | 149 | |
150 | -if( $bigbluebuttonbn->newwindow == 1 ) { |
|
150 | +if ($bigbluebuttonbn->newwindow == 1) { |
|
151 | 151 | $PAGE->blocks->show_only_fake_blocks(); |
152 | 152 | |
153 | 153 | } else { |
@@ -155,14 +155,14 @@ discard block |
||
155 | 155 | } |
156 | 156 | |
157 | 157 | // Validate if the user is in a role allowed to join |
158 | -if ( !has_capability('moodle/category:manage', $context) && !has_capability('mod/bigbluebuttonbn:join', $context) ) { |
|
158 | +if (!has_capability('moodle/category:manage', $context) && !has_capability('mod/bigbluebuttonbn:join', $context)) { |
|
159 | 159 | echo $OUTPUT->header(); |
160 | 160 | if (isguestuser()) { |
161 | - echo $OUTPUT->confirm('<p>'.get_string('view_noguests', 'bigbluebuttonbn').'</p>'.get_string('liketologin'), |
|
162 | - get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id); |
|
161 | + echo $OUTPUT->confirm('<p>' . get_string('view_noguests', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'), |
|
162 | + get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id); |
|
163 | 163 | } else { |
164 | - echo $OUTPUT->confirm('<p>'.get_string('view_nojoin', 'bigbluebuttonbn').'</p>'.get_string('liketologin'), |
|
165 | - get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id); |
|
164 | + echo $OUTPUT->confirm('<p>' . get_string('view_nojoin', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'), |
|
165 | + get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id); |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | echo $OUTPUT->footer(); |
@@ -170,10 +170,10 @@ discard block |
||
170 | 170 | } |
171 | 171 | |
172 | 172 | // Operation URLs |
173 | -$bbbsession['courseURL'] = $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course; |
|
174 | -$bbbsession['logoutURL'] = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=logout&id='.$id.'&bn='.$bbbsession['bigbluebuttonbnid']; |
|
175 | -$bbbsession['recordingReadyURL'] = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_broker.php?action=recording_ready'; |
|
176 | -$bbbsession['joinURL'] = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=join&id='.$id.'&bigbluebuttonbn='.$bbbsession['bigbluebuttonbnid']; |
|
173 | +$bbbsession['courseURL'] = $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course; |
|
174 | +$bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id=' . $id . '&bn=' . $bbbsession['bigbluebuttonbnid']; |
|
175 | +$bbbsession['recordingReadyURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_broker.php?action=recording_ready'; |
|
176 | +$bbbsession['joinURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=join&id=' . $id . '&bigbluebuttonbn=' . $bbbsession['bigbluebuttonbnid']; |
|
177 | 177 | |
178 | 178 | $bigbluebuttonbn_view = ''; |
179 | 179 | |
@@ -182,20 +182,20 @@ discard block |
||
182 | 182 | |
183 | 183 | /// find out current groups mode |
184 | 184 | $groupmode = groups_get_activity_groupmode($bbbsession['cm']); |
185 | -if ($groupmode == NOGROUPS ) { //No groups mode |
|
186 | - $bbbsession['meetingid'] = $bigbluebuttonbn->meetingid.'-'.$bbbsession['course']->id.'-'.$bbbsession['bigbluebuttonbnid']; |
|
185 | +if ($groupmode == NOGROUPS) { //No groups mode |
|
186 | + $bbbsession['meetingid'] = $bigbluebuttonbn->meetingid . '-' . $bbbsession['course']->id . '-' . $bbbsession['bigbluebuttonbnid']; |
|
187 | 187 | $bbbsession['meetingname'] = $bigbluebuttonbn->name; |
188 | 188 | |
189 | 189 | } else { // Separate or visible groups mode |
190 | 190 | echo $OUTPUT->box_start('generalbox boxaligncenter'); |
191 | - echo '<br><div class="alert alert-warning">'.get_string('view_groups_selection_warning', 'bigbluebuttonbn').'</div>'; |
|
191 | + echo '<br><div class="alert alert-warning">' . get_string('view_groups_selection_warning', 'bigbluebuttonbn') . '</div>'; |
|
192 | 192 | echo $OUTPUT->box_end(); |
193 | 193 | |
194 | 194 | $bbbsession['group'] = groups_get_activity_group($bbbsession['cm'], true); |
195 | - if ($groupmode == SEPARATEGROUPS ) { |
|
196 | - groups_print_activity_menu($cm, $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bbbsession['cm']->id, false, true); |
|
197 | - if( $bbbsession['group'] == 0 ) { |
|
198 | - if ( $bbbsession['administrator'] ) { |
|
195 | + if ($groupmode == SEPARATEGROUPS) { |
|
196 | + groups_print_activity_menu($cm, $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id, false, true); |
|
197 | + if ($bbbsession['group'] == 0) { |
|
198 | + if ($bbbsession['administrator']) { |
|
199 | 199 | $my_groups = groups_get_all_groups($bbbsession['course']->id); |
200 | 200 | } else { |
201 | 201 | $my_groups = groups_get_activity_allowed_groups($bbbsession['cm']); |
@@ -205,21 +205,21 @@ discard block |
||
205 | 205 | } |
206 | 206 | |
207 | 207 | } else { |
208 | - groups_print_activity_menu($cm, $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bbbsession['cm']->id); |
|
208 | + groups_print_activity_menu($cm, $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id); |
|
209 | 209 | } |
210 | 210 | |
211 | - $bbbsession['meetingid'] = $bigbluebuttonbn->meetingid.'-'.$bbbsession['course']->id.'-'.$bbbsession['bigbluebuttonbnid'].'['.$bbbsession['group'].']'; |
|
212 | - if( $bbbsession['group'] > 0 ) |
|
211 | + $bbbsession['meetingid'] = $bigbluebuttonbn->meetingid . '-' . $bbbsession['course']->id . '-' . $bbbsession['bigbluebuttonbnid'] . '[' . $bbbsession['group'] . ']'; |
|
212 | + if ($bbbsession['group'] > 0) |
|
213 | 213 | $group_name = groups_get_group_name($bbbsession['group']); |
214 | 214 | else |
215 | 215 | $group_name = get_string('allparticipants'); |
216 | - $bbbsession['meetingname'] = $bigbluebuttonbn->name.' ('.$group_name.')'; |
|
216 | + $bbbsession['meetingname'] = $bigbluebuttonbn->name . ' (' . $group_name . ')'; |
|
217 | 217 | } |
218 | 218 | // Metadata (contextActivityName updated after meeting name is assigned) |
219 | 219 | $bbbsession['contextActivityName'] = $bbbsession['meetingname']; |
220 | 220 | |
221 | 221 | $now = time(); |
222 | -if (!empty($bigbluebuttonbn->openingtime) && $now < $bigbluebuttonbn->openingtime ) { |
|
222 | +if (!empty($bigbluebuttonbn->openingtime) && $now < $bigbluebuttonbn->openingtime) { |
|
223 | 223 | //CALLING BEFORE |
224 | 224 | $bigbluebuttonbn_view = 'before'; |
225 | 225 | |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | 'meetingid' => $bbbsession['meetingid'], |
253 | 253 | 'bigbluebuttonbnid' => $bbbsession['bigbluebuttonbnid'], |
254 | 254 | 'bigbluebuttonbntype' => $bbbsession['bigbluebuttonbntype'], |
255 | - 'ping_interval' => ($waitformoderator_ping_interval > 0? $waitformoderator_ping_interval * 1000: 15000), |
|
255 | + 'ping_interval' => ($waitformoderator_ping_interval > 0 ? $waitformoderator_ping_interval * 1000 : 15000), |
|
256 | 256 | 'userlimit' => $bbbsession['userlimit'], |
257 | 257 | 'locales' => bigbluebuttonbn_get_locales_for_ui() |
258 | 258 | ); |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | // Finish the page |
270 | 270 | echo $OUTPUT->footer(); |
271 | 271 | |
272 | -function bigbluebuttonbn_view_joining($bbbsession){ |
|
272 | +function bigbluebuttonbn_view_joining($bbbsession) { |
|
273 | 273 | global $CFG, $DB, $OUTPUT; |
274 | 274 | |
275 | 275 | echo $OUTPUT->heading($bbbsession['meetingname'], 3); |
@@ -278,29 +278,29 @@ discard block |
||
278 | 278 | echo '<br><span id="status_bar"></span><br>'; |
279 | 279 | echo '<span id="control_panel"></span>'; |
280 | 280 | echo $OUTPUT->box_end(); |
281 | - if( $bbbsession['tagging'] && ($bbbsession['administrator'] || $bbbsession['moderator']) ){ |
|
282 | - echo ''. |
|
283 | - '<div id="panelContent" class="hidden">'. |
|
284 | - ' <div class="yui3-widget-bd">'. |
|
285 | - ' <form>'. |
|
286 | - ' <fieldset>'. |
|
287 | - ' <input type="hidden" name="join" id="meeting_join_url" value="">'. |
|
288 | - ' <input type="hidden" name="message" id="meeting_message" value="">'. |
|
289 | - ' <div>'. |
|
290 | - ' <label for="name">'.get_string('view_recording_name', 'bigbluebuttonbn').'</label><br/>'. |
|
291 | - ' <input type="text" name="name" id="recording_name" placeholder="">'. |
|
292 | - ' </div><br>'. |
|
293 | - ' <div>'. |
|
294 | - ' <label for="description">'.get_string('view_recording_description', 'bigbluebuttonbn').'</label><br/>'. |
|
295 | - ' <input type="text" name="description" id="recording_description" value="" placeholder="">'. |
|
296 | - ' </div><br>'. |
|
297 | - ' <div>'. |
|
298 | - ' <label for="tags">'.get_string('view_recording_tags', 'bigbluebuttonbn').'</label><br/>'. |
|
299 | - ' <input type="text" name="tags" id="recording_tags" value="" placeholder="">'. |
|
300 | - ' </div>'. |
|
301 | - ' </fieldset>'. |
|
302 | - ' </form>'. |
|
303 | - ' </div>'. |
|
281 | + if ($bbbsession['tagging'] && ($bbbsession['administrator'] || $bbbsession['moderator'])) { |
|
282 | + echo '' . |
|
283 | + '<div id="panelContent" class="hidden">' . |
|
284 | + ' <div class="yui3-widget-bd">' . |
|
285 | + ' <form>' . |
|
286 | + ' <fieldset>' . |
|
287 | + ' <input type="hidden" name="join" id="meeting_join_url" value="">' . |
|
288 | + ' <input type="hidden" name="message" id="meeting_message" value="">' . |
|
289 | + ' <div>' . |
|
290 | + ' <label for="name">' . get_string('view_recording_name', 'bigbluebuttonbn') . '</label><br/>' . |
|
291 | + ' <input type="text" name="name" id="recording_name" placeholder="">' . |
|
292 | + ' </div><br>' . |
|
293 | + ' <div>' . |
|
294 | + ' <label for="description">' . get_string('view_recording_description', 'bigbluebuttonbn') . '</label><br/>' . |
|
295 | + ' <input type="text" name="description" id="recording_description" value="" placeholder="">' . |
|
296 | + ' </div><br>' . |
|
297 | + ' <div>' . |
|
298 | + ' <label for="tags">' . get_string('view_recording_tags', 'bigbluebuttonbn') . '</label><br/>' . |
|
299 | + ' <input type="text" name="tags" id="recording_tags" value="" placeholder="">' . |
|
300 | + ' </div>' . |
|
301 | + ' </fieldset>' . |
|
302 | + ' </form>' . |
|
303 | + ' </div>' . |
|
304 | 304 | '</div>'; |
305 | 305 | } |
306 | 306 | |
@@ -311,19 +311,19 @@ discard block |
||
311 | 311 | bigbluebuttonbn_view_recordings($bbbsession); |
312 | 312 | } |
313 | 313 | |
314 | -function bigbluebuttonbn_view_before( $bbbsession ){ |
|
314 | +function bigbluebuttonbn_view_before($bbbsession) { |
|
315 | 315 | global $CFG, $DB, $OUTPUT; |
316 | 316 | |
317 | 317 | echo $OUTPUT->heading(get_string('view_message_conference_not_started', 'bigbluebuttonbn'), 3); |
318 | 318 | |
319 | 319 | echo '<table>'; |
320 | 320 | if ($bbbsession['openingtime']) { |
321 | - echo '<tr><td class="c0">'.get_string('mod_form_field_openingtime','bigbluebuttonbn').':</td>'; |
|
322 | - echo ' <td class="c1">'.userdate($bbbsession['openingtime']).'</td></tr>'; |
|
321 | + echo '<tr><td class="c0">' . get_string('mod_form_field_openingtime', 'bigbluebuttonbn') . ':</td>'; |
|
322 | + echo ' <td class="c1">' . userdate($bbbsession['openingtime']) . '</td></tr>'; |
|
323 | 323 | } |
324 | 324 | if ($bbbsession['closingtime']) { |
325 | - echo '<tr><td class="c0">'.get_string('mod_form_field_closingtime','bigbluebuttonbn').':</td>'; |
|
326 | - echo ' <td class="c1">'.userdate($bbbsession['closingtime']).'</td></tr>'; |
|
325 | + echo '<tr><td class="c0">' . get_string('mod_form_field_closingtime', 'bigbluebuttonbn') . ':</td>'; |
|
326 | + echo ' <td class="c1">' . userdate($bbbsession['closingtime']) . '</td></tr>'; |
|
327 | 327 | } |
328 | 328 | echo '</table>'; |
329 | 329 | } |
@@ -333,32 +333,32 @@ discard block |
||
333 | 333 | |
334 | 334 | echo $OUTPUT->heading(get_string('view_message_conference_has_ended', 'bigbluebuttonbn'), 3); |
335 | 335 | |
336 | - if( !is_null($bbbsession['presentation']['url']) ) { |
|
336 | + if (!is_null($bbbsession['presentation']['url'])) { |
|
337 | 337 | $attributes = array('title' => $bbbsession['presentation']['name']); |
338 | 338 | $icon = new pix_icon($bbbsession['presentation']['icon'], $bbbsession['presentation']['mimetype_description']); |
339 | 339 | |
340 | - echo '<h4>'.get_string('view_section_title_presentation', 'bigbluebuttonbn').'</h4>'. |
|
341 | - ''.$OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false).''. |
|
342 | - ''.$OUTPUT->action_link($bbbsession['presentation']['url'], $bbbsession['presentation']['name'], null, $attributes).'<br><br>'; |
|
340 | + echo '<h4>' . get_string('view_section_title_presentation', 'bigbluebuttonbn') . '</h4>' . |
|
341 | + '' . $OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false) . '' . |
|
342 | + '' . $OUTPUT->action_link($bbbsession['presentation']['url'], $bbbsession['presentation']['name'], null, $attributes) . '<br><br>'; |
|
343 | 343 | } |
344 | 344 | |
345 | 345 | bigbluebuttonbn_view_recordings($bbbsession); |
346 | 346 | } |
347 | 347 | |
348 | 348 | function bigbluebuttonbn_view_recordings($bbbsession) { |
349 | - if( isset($bbbsession['record']) && $bbbsession['record'] ) { |
|
350 | - echo '<h4>'.get_string('view_section_title_recordings', 'bigbluebuttonbn').'</h4>'; |
|
349 | + if (isset($bbbsession['record']) && $bbbsession['record']) { |
|
350 | + echo '<h4>' . get_string('view_section_title_recordings', 'bigbluebuttonbn') . '</h4>'; |
|
351 | 351 | |
352 | 352 | $recordings = bigbluebuttonbn_getRecordingsArray($bbbsession['meetingid'], $bbbsession['endpoint'], $bbbsession['shared_secret']); |
353 | - if ( isset($recordings) && !array_key_exists('messageKey', $recordings)) { // There are recordings for this meeting |
|
353 | + if (isset($recordings) && !array_key_exists('messageKey', $recordings)) { // There are recordings for this meeting |
|
354 | 354 | $table = bigbluebuttonbn_get_recording_table($bbbsession, $recordings); |
355 | 355 | } |
356 | 356 | |
357 | - if( isset($table->data) ) { |
|
357 | + if (isset($table->data)) { |
|
358 | 358 | //Print the table |
359 | - echo '<div id="bigbluebuttonbn_html_table">'."\n"; |
|
360 | - echo html_writer::table($table)."\n"; |
|
361 | - echo '</div>'."\n"; |
|
359 | + echo '<div id="bigbluebuttonbn_html_table">' . "\n"; |
|
360 | + echo html_writer::table($table) . "\n"; |
|
361 | + echo '</div>' . "\n"; |
|
362 | 362 | |
363 | 363 | } else { |
364 | 364 | print_string('view_message_norecordings', 'bigbluebuttonbn'); |
@@ -85,8 +85,9 @@ discard block |
||
85 | 85 | $bbbsession['voicebridge'] = ($bigbluebuttonbn->voicebridge > 0)? 70000 + $bigbluebuttonbn->voicebridge: $bigbluebuttonbn->voicebridge; |
86 | 86 | $bbbsession['wait'] = $bigbluebuttonbn->wait; |
87 | 87 | $bbbsession['record'] = $bigbluebuttonbn->record; |
88 | -if( $bigbluebuttonbn->record ) |
|
88 | +if( $bigbluebuttonbn->record ) { |
|
89 | 89 | $bbbsession['welcome'] .= '<br><br>'.get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
90 | +} |
|
90 | 91 | $bbbsession['tagging'] = $bigbluebuttonbn->tagging; |
91 | 92 | |
92 | 93 | $bbbsession['openingtime'] = $bigbluebuttonbn->openingtime; |
@@ -118,22 +119,24 @@ discard block |
||
118 | 119 | // Validates if the BigBlueButton server is running |
119 | 120 | $serverVersion = bigbluebuttonbn_getServerVersion($bbbsession['endpoint']); |
120 | 121 | if ( !isset($serverVersion) ) { //Server is not working |
121 | - if ( $bbbsession['administrator'] ) |
|
122 | - print_error( 'view_error_unable_join', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
|
123 | - else if ( $bbbsession['moderator'] ) |
|
124 | - print_error( 'view_error_unable_join_teacher', 'bigbluebuttonbn', $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course ); |
|
125 | - else |
|
126 | - print_error( 'view_error_unable_join_student', 'bigbluebuttonbn', $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course ); |
|
127 | -} else { |
|
128 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getMeetingsURL( $bbbsession['endpoint'], $bbbsession['shared_secret'] ) ); |
|
129 | - if ( !isset($xml) || !isset($xml->returncode) || $xml->returncode == 'FAILED' ){ // The shared secret is wrong |
|
130 | - if ( $bbbsession['administrator'] ) |
|
122 | + if ( $bbbsession['administrator'] ) { |
|
131 | 123 | print_error( 'view_error_unable_join', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
132 | - else if ( $bbbsession['moderator'] ) |
|
124 | + } else if ( $bbbsession['moderator'] ) { |
|
133 | 125 | print_error( 'view_error_unable_join_teacher', 'bigbluebuttonbn', $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course ); |
134 | - else |
|
126 | + } else { |
|
135 | 127 | print_error( 'view_error_unable_join_student', 'bigbluebuttonbn', $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course ); |
136 | 128 | } |
129 | + } else { |
|
130 | + $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getMeetingsURL( $bbbsession['endpoint'], $bbbsession['shared_secret'] ) ); |
|
131 | + if ( !isset($xml) || !isset($xml->returncode) || $xml->returncode == 'FAILED' ){ // The shared secret is wrong |
|
132 | + if ( $bbbsession['administrator'] ) { |
|
133 | + print_error( 'view_error_unable_join', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
|
134 | + } else if ( $bbbsession['moderator'] ) { |
|
135 | + print_error( 'view_error_unable_join_teacher', 'bigbluebuttonbn', $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course ); |
|
136 | + } else { |
|
137 | + print_error( 'view_error_unable_join_student', 'bigbluebuttonbn', $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course ); |
|
138 | + } |
|
139 | + } |
|
137 | 140 | } |
138 | 141 | |
139 | 142 | // Mark viewed by user (if required) |
@@ -209,10 +212,11 @@ discard block |
||
209 | 212 | } |
210 | 213 | |
211 | 214 | $bbbsession['meetingid'] = $bigbluebuttonbn->meetingid.'-'.$bbbsession['course']->id.'-'.$bbbsession['bigbluebuttonbnid'].'['.$bbbsession['group'].']'; |
212 | - if( $bbbsession['group'] > 0 ) |
|
213 | - $group_name = groups_get_group_name($bbbsession['group']); |
|
214 | - else |
|
215 | - $group_name = get_string('allparticipants'); |
|
215 | + if( $bbbsession['group'] > 0 ) { |
|
216 | + $group_name = groups_get_group_name($bbbsession['group']); |
|
217 | + } else { |
|
218 | + $group_name = get_string('allparticipants'); |
|
219 | + } |
|
216 | 220 | $bbbsession['meetingname'] = $bigbluebuttonbn->name.' ('.$group_name.')'; |
217 | 221 | } |
218 | 222 | // Metadata (contextActivityName updated after meeting name is assigned) |
@@ -44,115 +44,115 @@ |
||
44 | 44 | $bbbsession = $SESSION->bigbluebuttonbn_bbbsession; |
45 | 45 | } |
46 | 46 | switch (strtolower($action)) { |
47 | - case 'logout': |
|
48 | - if ( isset($bbbsession) && !is_null($bbbsession) ) { |
|
49 | - /// Moodle event logger: Create an event for meeting left |
|
50 | - bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_LEFT, $bigbluebuttonbn, $context, $cm); |
|
47 | + case 'logout': |
|
48 | + if ( isset($bbbsession) && !is_null($bbbsession) ) { |
|
49 | + /// Moodle event logger: Create an event for meeting left |
|
50 | + bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_LEFT, $bigbluebuttonbn, $context, $cm); |
|
51 | 51 | |
52 | - /// Update the cache |
|
53 | - $meeting_info = bigbluebuttonbn_bbb_broker_get_meeting_info($bbbsession['meetingid'], $bbbsession['modPW'], BIGBLUEBUTTONBN_FORCED); |
|
52 | + /// Update the cache |
|
53 | + $meeting_info = bigbluebuttonbn_bbb_broker_get_meeting_info($bbbsession['meetingid'], $bbbsession['modPW'], BIGBLUEBUTTONBN_FORCED); |
|
54 | 54 | |
55 | - /// Close the tab or window where BBB was opened |
|
56 | - bigbluebutton_bbb_view_close_window(); |
|
57 | - |
|
58 | - } else { |
|
59 | - bigbluebutton_bbb_view_close_window_manually(); |
|
60 | - } |
|
61 | - break; |
|
62 | - case 'join': |
|
63 | - if ( isset($bbbsession) && !is_null($bbbsession) ) { |
|
64 | - //See if the session is in progress |
|
65 | - if( bigbluebuttonbn_isMeetingRunning( $bbbsession['meetingid'], $bbbsession['endpoint'], $bbbsession['shared_secret'] ) ) { |
|
66 | - /// Since the meeting is already running, we just join the session |
|
67 | - bigbluebutton_bbb_view_execute_join($bbbsession, $cm, $context, $bigbluebuttonbn); |
|
55 | + /// Close the tab or window where BBB was opened |
|
56 | + bigbluebutton_bbb_view_close_window(); |
|
68 | 57 | |
69 | 58 | } else { |
70 | - // If user is administrator, moderator or if is viewer and no waiting is required |
|
71 | - if( $bbbsession['administrator'] || $bbbsession['moderator'] || !$bbbsession['wait'] ) { |
|
72 | - /// Prepare the metadata |
|
73 | - $metadata = array("meta_bn-origin" => $bbbsession['origin'], |
|
74 | - "meta_bbb-origin-version" => $bbbsession['originVersion'], |
|
75 | - "meta_bbb-origin-server-name" => $bbbsession['originServerName'], |
|
76 | - "meta_bbb-origin-server-common-name" => $bbbsession['originServerCommonName'], |
|
77 | - "meta_bbb-origin-tag" => $bbbsession['originTag'], |
|
78 | - "meta_bbb-context" => $bbbsession['course']->fullname, |
|
79 | - "meta_bbb-recording-name" => (isset($name) && $name != '')? $name: $bbbsession['contextActivityName'], |
|
80 | - "meta_bbb-recording-description" => (isset($description) && $description != '')? $description: $bbbsession['contextActivityDescription'], |
|
81 | - "meta_bbb-recording-tags" => (isset($tags) && $tags != '')? $tags: $bbbsession['contextActivityTags'], |
|
82 | - ); |
|
83 | - |
|
84 | - if ( bigbluebuttonbn_server_offers_bn_capabilities() && bigbluebuttonbn_get_cfg_recordingready_enabled() ) { |
|
85 | - $metadata["meta_bn-recording-ready-url"] = $bbbsession['recordingReadyURL']; |
|
86 | - } |
|
59 | + bigbluebutton_bbb_view_close_window_manually(); |
|
60 | + } |
|
61 | + break; |
|
62 | + case 'join': |
|
63 | + if ( isset($bbbsession) && !is_null($bbbsession) ) { |
|
64 | + //See if the session is in progress |
|
65 | + if( bigbluebuttonbn_isMeetingRunning( $bbbsession['meetingid'], $bbbsession['endpoint'], $bbbsession['shared_secret'] ) ) { |
|
66 | + /// Since the meeting is already running, we just join the session |
|
67 | + bigbluebutton_bbb_view_execute_join($bbbsession, $cm, $context, $bigbluebuttonbn); |
|
87 | 68 | |
88 | - /// Set the duration for the meeting |
|
89 | - if ( bigbluebuttonbn_get_cfg_scheduled_duration_enabled() ) { |
|
90 | - $durationtime = bigbluebuttonbn_get_duration($bigbluebuttonbn->openingtime, $bigbluebuttonbn->closingtime); |
|
91 | - if( $durationtime > 0 ) |
|
92 | - $bbbsession['welcome'] .= '<br><br>'.str_replace("%duration%", ''.$durationtime, get_string('bbbdurationwarning', 'bigbluebuttonbn')); |
|
93 | - } else { |
|
94 | - $durationtime = 0; |
|
95 | - } |
|
96 | - /// Execute the create command |
|
97 | - $response = bigbluebuttonbn_getCreateMeetingArray( |
|
98 | - $bbbsession['meetingname'], |
|
99 | - $bbbsession['meetingid'], |
|
100 | - $bbbsession['welcome'], |
|
101 | - $bbbsession['modPW'], |
|
102 | - $bbbsession['viewerPW'], |
|
103 | - $bbbsession['shared_secret'], |
|
104 | - $bbbsession['endpoint'], |
|
105 | - $bbbsession['logoutURL'], |
|
106 | - $bbbsession['record']? 'true': 'false', |
|
107 | - $durationtime, |
|
108 | - $bbbsession['voicebridge'], |
|
109 | - $metadata, |
|
110 | - $bbbsession['presentation']['name'], |
|
111 | - $bbbsession['presentation']['url'] |
|
112 | - ); |
|
113 | - |
|
114 | - if (!$response) { |
|
115 | - // If the server is unreachable, then prompts the user of the necessary action |
|
116 | - if ( $bbbsession['administrator'] ) { |
|
117 | - print_error( 'view_error_unable_join', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
|
118 | - } else if ( $bbbsession['moderator'] ) { |
|
119 | - print_error( 'view_error_unable_join_teacher', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
|
120 | - } else { |
|
121 | - print_error( 'view_error_unable_join_student', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
|
69 | + } else { |
|
70 | + // If user is administrator, moderator or if is viewer and no waiting is required |
|
71 | + if( $bbbsession['administrator'] || $bbbsession['moderator'] || !$bbbsession['wait'] ) { |
|
72 | + /// Prepare the metadata |
|
73 | + $metadata = array("meta_bn-origin" => $bbbsession['origin'], |
|
74 | + "meta_bbb-origin-version" => $bbbsession['originVersion'], |
|
75 | + "meta_bbb-origin-server-name" => $bbbsession['originServerName'], |
|
76 | + "meta_bbb-origin-server-common-name" => $bbbsession['originServerCommonName'], |
|
77 | + "meta_bbb-origin-tag" => $bbbsession['originTag'], |
|
78 | + "meta_bbb-context" => $bbbsession['course']->fullname, |
|
79 | + "meta_bbb-recording-name" => (isset($name) && $name != '')? $name: $bbbsession['contextActivityName'], |
|
80 | + "meta_bbb-recording-description" => (isset($description) && $description != '')? $description: $bbbsession['contextActivityDescription'], |
|
81 | + "meta_bbb-recording-tags" => (isset($tags) && $tags != '')? $tags: $bbbsession['contextActivityTags'], |
|
82 | + ); |
|
83 | + |
|
84 | + if ( bigbluebuttonbn_server_offers_bn_capabilities() && bigbluebuttonbn_get_cfg_recordingready_enabled() ) { |
|
85 | + $metadata["meta_bn-recording-ready-url"] = $bbbsession['recordingReadyURL']; |
|
122 | 86 | } |
123 | 87 | |
124 | - } else if( $response['returncode'] == "FAILED" ) { |
|
125 | - // The meeting was not created |
|
126 | - $error_key = bigbluebuttonbn_get_error_key( $response['messageKey'], 'view_error_create' ); |
|
127 | - if( !$error_key ) { |
|
128 | - print_error( $response['message'], 'bigbluebuttonbn' ); |
|
88 | + /// Set the duration for the meeting |
|
89 | + if ( bigbluebuttonbn_get_cfg_scheduled_duration_enabled() ) { |
|
90 | + $durationtime = bigbluebuttonbn_get_duration($bigbluebuttonbn->openingtime, $bigbluebuttonbn->closingtime); |
|
91 | + if( $durationtime > 0 ) |
|
92 | + $bbbsession['welcome'] .= '<br><br>'.str_replace("%duration%", ''.$durationtime, get_string('bbbdurationwarning', 'bigbluebuttonbn')); |
|
129 | 93 | } else { |
130 | - print_error( $error_key, 'bigbluebuttonbn' ); |
|
94 | + $durationtime = 0; |
|
95 | + } |
|
96 | + /// Execute the create command |
|
97 | + $response = bigbluebuttonbn_getCreateMeetingArray( |
|
98 | + $bbbsession['meetingname'], |
|
99 | + $bbbsession['meetingid'], |
|
100 | + $bbbsession['welcome'], |
|
101 | + $bbbsession['modPW'], |
|
102 | + $bbbsession['viewerPW'], |
|
103 | + $bbbsession['shared_secret'], |
|
104 | + $bbbsession['endpoint'], |
|
105 | + $bbbsession['logoutURL'], |
|
106 | + $bbbsession['record']? 'true': 'false', |
|
107 | + $durationtime, |
|
108 | + $bbbsession['voicebridge'], |
|
109 | + $metadata, |
|
110 | + $bbbsession['presentation']['name'], |
|
111 | + $bbbsession['presentation']['url'] |
|
112 | + ); |
|
113 | + |
|
114 | + if (!$response) { |
|
115 | + // If the server is unreachable, then prompts the user of the necessary action |
|
116 | + if ( $bbbsession['administrator'] ) { |
|
117 | + print_error( 'view_error_unable_join', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
|
118 | + } else if ( $bbbsession['moderator'] ) { |
|
119 | + print_error( 'view_error_unable_join_teacher', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
|
120 | + } else { |
|
121 | + print_error( 'view_error_unable_join_student', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
|
122 | + } |
|
123 | + |
|
124 | + } else if( $response['returncode'] == "FAILED" ) { |
|
125 | + // The meeting was not created |
|
126 | + $error_key = bigbluebuttonbn_get_error_key( $response['messageKey'], 'view_error_create' ); |
|
127 | + if( !$error_key ) { |
|
128 | + print_error( $response['message'], 'bigbluebuttonbn' ); |
|
129 | + } else { |
|
130 | + print_error( $error_key, 'bigbluebuttonbn' ); |
|
131 | + } |
|
132 | + |
|
133 | + } else if ($response['hasBeenForciblyEnded'] == "true"){ |
|
134 | + print_error( get_string( 'index_error_forciblyended', 'bigbluebuttonbn' )); |
|
135 | + |
|
136 | + } else { ///////////////Everything is ok ///////////////////// |
|
137 | + /// Moodle event logger: Create an event for meeting created |
|
138 | + bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_CREATED, $bigbluebuttonbn, $context, $cm); |
|
139 | + /// Internal logger: Instert a record with the meeting created |
|
140 | + bigbluebuttonbn_log($bbbsession, 'Create'); |
|
141 | + /// Since the meeting is already running, we just join the session |
|
142 | + bigbluebutton_bbb_view_execute_join($bbbsession, $cm, $context, $bigbluebuttonbn); |
|
131 | 143 | } |
132 | 144 | |
133 | - } else if ($response['hasBeenForciblyEnded'] == "true"){ |
|
134 | - print_error( get_string( 'index_error_forciblyended', 'bigbluebuttonbn' )); |
|
135 | - |
|
136 | - } else { ///////////////Everything is ok ///////////////////// |
|
137 | - /// Moodle event logger: Create an event for meeting created |
|
138 | - bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_CREATED, $bigbluebuttonbn, $context, $cm); |
|
139 | - /// Internal logger: Instert a record with the meeting created |
|
140 | - bigbluebuttonbn_log($bbbsession, 'Create'); |
|
141 | - /// Since the meeting is already running, we just join the session |
|
142 | - bigbluebutton_bbb_view_execute_join($bbbsession, $cm, $context, $bigbluebuttonbn); |
|
145 | + } else { |
|
146 | + header('Location: '.$bbbsession['logoutURL'] ); |
|
143 | 147 | } |
144 | - |
|
145 | - } else { |
|
146 | - header('Location: '.$bbbsession['logoutURL'] ); |
|
147 | 148 | } |
148 | - } |
|
149 | 149 | |
150 | - } else { |
|
151 | - print_error( 'view_error_unable_join', 'bigbluebuttonbn' ); |
|
152 | - } |
|
153 | - break; |
|
154 | - default: |
|
155 | - bigbluebutton_bbb_view_close_window(); |
|
150 | + } else { |
|
151 | + print_error( 'view_error_unable_join', 'bigbluebuttonbn' ); |
|
152 | + } |
|
153 | + break; |
|
154 | + default: |
|
155 | + bigbluebutton_bbb_view_close_window(); |
|
156 | 156 | } |
157 | 157 | |
158 | 158 |
@@ -8,11 +8,11 @@ discard block |
||
8 | 8 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v2 or later |
9 | 9 | */ |
10 | 10 | |
11 | -require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); |
|
12 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
11 | +require_once(dirname(dirname(dirname(__FILE__))) . '/config.php'); |
|
12 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
13 | 13 | |
14 | -$id = optional_param('id', 0, PARAM_INT); // course_module ID, or |
|
15 | -$bn = optional_param('bn', 0, PARAM_INT); // bigbluebuttonbn instance ID |
|
14 | +$id = optional_param('id', 0, PARAM_INT); // course_module ID, or |
|
15 | +$bn = optional_param('bn', 0, PARAM_INT); // bigbluebuttonbn instance ID |
|
16 | 16 | $action = required_param('action', PARAM_TEXT); |
17 | 17 | $name = optional_param('name', '', PARAM_TEXT); |
18 | 18 | $description = optional_param('description', '', PARAM_TEXT); |
@@ -39,13 +39,13 @@ discard block |
||
39 | 39 | $PAGE->set_cacheable(false); |
40 | 40 | $PAGE->blocks->show_only_fake_blocks(); |
41 | 41 | |
42 | -if ( isset($SESSION) && isset($SESSION->bigbluebuttonbn_bbbsession)) { |
|
42 | +if (isset($SESSION) && isset($SESSION->bigbluebuttonbn_bbbsession)) { |
|
43 | 43 | require_login($course, true, $cm); |
44 | 44 | $bbbsession = $SESSION->bigbluebuttonbn_bbbsession; |
45 | 45 | } |
46 | 46 | switch (strtolower($action)) { |
47 | 47 | case 'logout': |
48 | - if ( isset($bbbsession) && !is_null($bbbsession) ) { |
|
48 | + if (isset($bbbsession) && !is_null($bbbsession)) { |
|
49 | 49 | /// Moodle event logger: Create an event for meeting left |
50 | 50 | bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_LEFT, $bigbluebuttonbn, $context, $cm); |
51 | 51 | |
@@ -60,15 +60,15 @@ discard block |
||
60 | 60 | } |
61 | 61 | break; |
62 | 62 | case 'join': |
63 | - if ( isset($bbbsession) && !is_null($bbbsession) ) { |
|
63 | + if (isset($bbbsession) && !is_null($bbbsession)) { |
|
64 | 64 | //See if the session is in progress |
65 | - if( bigbluebuttonbn_isMeetingRunning( $bbbsession['meetingid'], $bbbsession['endpoint'], $bbbsession['shared_secret'] ) ) { |
|
65 | + if (bigbluebuttonbn_isMeetingRunning($bbbsession['meetingid'], $bbbsession['endpoint'], $bbbsession['shared_secret'])) { |
|
66 | 66 | /// Since the meeting is already running, we just join the session |
67 | 67 | bigbluebutton_bbb_view_execute_join($bbbsession, $cm, $context, $bigbluebuttonbn); |
68 | 68 | |
69 | 69 | } else { |
70 | 70 | // If user is administrator, moderator or if is viewer and no waiting is required |
71 | - if( $bbbsession['administrator'] || $bbbsession['moderator'] || !$bbbsession['wait'] ) { |
|
71 | + if ($bbbsession['administrator'] || $bbbsession['moderator'] || !$bbbsession['wait']) { |
|
72 | 72 | /// Prepare the metadata |
73 | 73 | $metadata = array("meta_bn-origin" => $bbbsession['origin'], |
74 | 74 | "meta_bbb-origin-version" => $bbbsession['originVersion'], |
@@ -76,20 +76,20 @@ discard block |
||
76 | 76 | "meta_bbb-origin-server-common-name" => $bbbsession['originServerCommonName'], |
77 | 77 | "meta_bbb-origin-tag" => $bbbsession['originTag'], |
78 | 78 | "meta_bbb-context" => $bbbsession['course']->fullname, |
79 | - "meta_bbb-recording-name" => (isset($name) && $name != '')? $name: $bbbsession['contextActivityName'], |
|
80 | - "meta_bbb-recording-description" => (isset($description) && $description != '')? $description: $bbbsession['contextActivityDescription'], |
|
81 | - "meta_bbb-recording-tags" => (isset($tags) && $tags != '')? $tags: $bbbsession['contextActivityTags'], |
|
79 | + "meta_bbb-recording-name" => (isset($name) && $name != '') ? $name : $bbbsession['contextActivityName'], |
|
80 | + "meta_bbb-recording-description" => (isset($description) && $description != '') ? $description : $bbbsession['contextActivityDescription'], |
|
81 | + "meta_bbb-recording-tags" => (isset($tags) && $tags != '') ? $tags : $bbbsession['contextActivityTags'], |
|
82 | 82 | ); |
83 | 83 | |
84 | - if ( bigbluebuttonbn_server_offers_bn_capabilities() && bigbluebuttonbn_get_cfg_recordingready_enabled() ) { |
|
84 | + if (bigbluebuttonbn_server_offers_bn_capabilities() && bigbluebuttonbn_get_cfg_recordingready_enabled()) { |
|
85 | 85 | $metadata["meta_bn-recording-ready-url"] = $bbbsession['recordingReadyURL']; |
86 | 86 | } |
87 | 87 | |
88 | 88 | /// Set the duration for the meeting |
89 | - if ( bigbluebuttonbn_get_cfg_scheduled_duration_enabled() ) { |
|
89 | + if (bigbluebuttonbn_get_cfg_scheduled_duration_enabled()) { |
|
90 | 90 | $durationtime = bigbluebuttonbn_get_duration($bigbluebuttonbn->openingtime, $bigbluebuttonbn->closingtime); |
91 | - if( $durationtime > 0 ) |
|
92 | - $bbbsession['welcome'] .= '<br><br>'.str_replace("%duration%", ''.$durationtime, get_string('bbbdurationwarning', 'bigbluebuttonbn')); |
|
91 | + if ($durationtime > 0) |
|
92 | + $bbbsession['welcome'] .= '<br><br>' . str_replace("%duration%", '' . $durationtime, get_string('bbbdurationwarning', 'bigbluebuttonbn')); |
|
93 | 93 | } else { |
94 | 94 | $durationtime = 0; |
95 | 95 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | $bbbsession['shared_secret'], |
104 | 104 | $bbbsession['endpoint'], |
105 | 105 | $bbbsession['logoutURL'], |
106 | - $bbbsession['record']? 'true': 'false', |
|
106 | + $bbbsession['record'] ? 'true' : 'false', |
|
107 | 107 | $durationtime, |
108 | 108 | $bbbsession['voicebridge'], |
109 | 109 | $metadata, |
@@ -113,25 +113,25 @@ discard block |
||
113 | 113 | |
114 | 114 | if (!$response) { |
115 | 115 | // If the server is unreachable, then prompts the user of the necessary action |
116 | - if ( $bbbsession['administrator'] ) { |
|
117 | - print_error( 'view_error_unable_join', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
|
118 | - } else if ( $bbbsession['moderator'] ) { |
|
119 | - print_error( 'view_error_unable_join_teacher', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
|
116 | + if ($bbbsession['administrator']) { |
|
117 | + print_error('view_error_unable_join', 'bigbluebuttonbn', $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
118 | + } else if ($bbbsession['moderator']) { |
|
119 | + print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
120 | 120 | } else { |
121 | - print_error( 'view_error_unable_join_student', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
|
121 | + print_error('view_error_unable_join_student', 'bigbluebuttonbn', $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
122 | 122 | } |
123 | 123 | |
124 | - } else if( $response['returncode'] == "FAILED" ) { |
|
124 | + } else if ($response['returncode'] == "FAILED") { |
|
125 | 125 | // The meeting was not created |
126 | - $error_key = bigbluebuttonbn_get_error_key( $response['messageKey'], 'view_error_create' ); |
|
127 | - if( !$error_key ) { |
|
128 | - print_error( $response['message'], 'bigbluebuttonbn' ); |
|
126 | + $error_key = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create'); |
|
127 | + if (!$error_key) { |
|
128 | + print_error($response['message'], 'bigbluebuttonbn'); |
|
129 | 129 | } else { |
130 | - print_error( $error_key, 'bigbluebuttonbn' ); |
|
130 | + print_error($error_key, 'bigbluebuttonbn'); |
|
131 | 131 | } |
132 | 132 | |
133 | - } else if ($response['hasBeenForciblyEnded'] == "true"){ |
|
134 | - print_error( get_string( 'index_error_forciblyended', 'bigbluebuttonbn' )); |
|
133 | + } else if ($response['hasBeenForciblyEnded'] == "true") { |
|
134 | + print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn')); |
|
135 | 135 | |
136 | 136 | } else { ///////////////Everything is ok ///////////////////// |
137 | 137 | /// Moodle event logger: Create an event for meeting created |
@@ -143,12 +143,12 @@ discard block |
||
143 | 143 | } |
144 | 144 | |
145 | 145 | } else { |
146 | - header('Location: '.$bbbsession['logoutURL'] ); |
|
146 | + header('Location: ' . $bbbsession['logoutURL']); |
|
147 | 147 | } |
148 | 148 | } |
149 | 149 | |
150 | 150 | } else { |
151 | - print_error( 'view_error_unable_join', 'bigbluebuttonbn' ); |
|
151 | + print_error('view_error_unable_join', 'bigbluebuttonbn'); |
|
152 | 152 | } |
153 | 153 | break; |
154 | 154 | default: |
@@ -172,9 +172,9 @@ discard block |
||
172 | 172 | function bigbluebutton_bbb_view_execute_join($bbbsession, $cm, $context, $bigbluebuttonbn) { |
173 | 173 | //// Update the cache |
174 | 174 | $meeting_info = bigbluebuttonbn_bbb_broker_get_meeting_info($bbbsession['meetingid'], $bbbsession['modPW'], true); |
175 | - if( $bbbsession['userlimit'] == 0 || intval($meeting_info['participantCount']) < $bbbsession['userlimit'] ) { |
|
175 | + if ($bbbsession['userlimit'] == 0 || intval($meeting_info['participantCount']) < $bbbsession['userlimit']) { |
|
176 | 176 | //// Build the URL |
177 | - if( $bbbsession['administrator'] || $bbbsession['moderator'] ) { |
|
177 | + if ($bbbsession['administrator'] || $bbbsession['moderator']) { |
|
178 | 178 | $password = $bbbsession['modPW']; |
179 | 179 | } else { |
180 | 180 | $password = $bbbsession['viewerPW']; |
@@ -185,11 +185,11 @@ discard block |
||
185 | 185 | /// Internal logger: Instert a record with the meeting created |
186 | 186 | bigbluebuttonbn_log($bbbsession, 'Join'); |
187 | 187 | //// Before executing the redirect, increment the number of participants |
188 | - bigbluebuttonbn_bbb_broker_participant_joined($bbbsession['meetingid'], ($bbbsession['administrator'] || $bbbsession['moderator']) ); |
|
188 | + bigbluebuttonbn_bbb_broker_participant_joined($bbbsession['meetingid'], ($bbbsession['administrator'] || $bbbsession['moderator'])); |
|
189 | 189 | //// Execute the redirect |
190 | - header('Location: '.$join_url ); |
|
190 | + header('Location: ' . $join_url); |
|
191 | 191 | |
192 | 192 | } else { |
193 | - header('Location: '.$bbbsession['logoutURL'] ); |
|
193 | + header('Location: ' . $bbbsession['logoutURL']); |
|
194 | 194 | } |
195 | 195 | } |
196 | 196 | \ No newline at end of file |
@@ -88,8 +88,9 @@ |
||
88 | 88 | /// Set the duration for the meeting |
89 | 89 | if ( bigbluebuttonbn_get_cfg_scheduled_duration_enabled() ) { |
90 | 90 | $durationtime = bigbluebuttonbn_get_duration($bigbluebuttonbn->openingtime, $bigbluebuttonbn->closingtime); |
91 | - if( $durationtime > 0 ) |
|
92 | - $bbbsession['welcome'] .= '<br><br>'.str_replace("%duration%", ''.$durationtime, get_string('bbbdurationwarning', 'bigbluebuttonbn')); |
|
91 | + if( $durationtime > 0 ) { |
|
92 | + $bbbsession['welcome'] .= '<br><br>'.str_replace("%duration%", ''.$durationtime, get_string('bbbdurationwarning', 'bigbluebuttonbn')); |
|
93 | + } |
|
93 | 94 | } else { |
94 | 95 | $durationtime = 0; |
95 | 96 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v2 or later |
11 | 11 | */ |
12 | 12 | |
13 | -function xmldb_bigbluebuttonbn_upgrade($oldversion=0) { |
|
13 | +function xmldb_bigbluebuttonbn_upgrade($oldversion = 0) { |
|
14 | 14 | |
15 | 15 | global $CFG, $THEME, $DB; |
16 | 16 | $dbman = $DB->get_manager(); // loads ddl manager and xmldb classes |
@@ -20,11 +20,11 @@ discard block |
||
20 | 20 | if ($result && $oldversion < 2012040200) { |
21 | 21 | // Define field intro to be droped from bigbluebuttonbn |
22 | 22 | $table = new xmldb_table('bigbluebuttonbn'); |
23 | - $field = new xmldb_field('intro', XMLDB_TYPE_TEXT, 'medium', null, null, null, null,'name'); |
|
23 | + $field = new xmldb_field('intro', XMLDB_TYPE_TEXT, 'medium', null, null, null, null, 'name'); |
|
24 | 24 | |
25 | 25 | // Drop field intro |
26 | 26 | if ($dbman->field_exists($table, $field)) { |
27 | - $dbman->drop_field($table, $field, $continue=true, $feedback=true); |
|
27 | + $dbman->drop_field($table, $field, $continue = true, $feedback = true); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | // Define field introformat to be droped from bigbluebuttonbn |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | |
34 | 34 | // Drop field introformat |
35 | 35 | if ($dbman->field_exists($table, $field)) { |
36 | - $dbman->drop_field($table, $field, $continue=true, $feedback=true); |
|
36 | + $dbman->drop_field($table, $field, $continue = true, $feedback = true); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | // Once we reach this point, we can store the new version and consider the module |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $field = new xmldb_field('welcome'); |
74 | 74 | $field->set_attributes(XMLDB_TYPE_TEXT, null, null, XMLDB_NOTNULL, null, null, null, null, 'type'); |
75 | 75 | |
76 | - $dbman->change_field_type($table, $field, $continue=true, $feedback=true); |
|
76 | + $dbman->change_field_type($table, $field, $continue = true, $feedback = true); |
|
77 | 77 | |
78 | 78 | upgrade_mod_savepoint(true, 2012100100, 'bigbluebuttonbn'); |
79 | 79 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $field->set_attributes(XMLDB_TYPE_INTEGER, '1', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, 0); |
86 | 86 | |
87 | 87 | if (!$dbman->field_exists($table, $field)) { |
88 | - $dbman->add_field($table, $field, $continue=true, $feedback=true); |
|
88 | + $dbman->add_field($table, $field, $continue = true, $feedback = true); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | upgrade_mod_savepoint(true, 2014050100, 'bigbluebuttonbn'); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $field = new xmldb_field('participants', XMLDB_TYPE_TEXT, 'medium', null, null, null, null); |
98 | 98 | |
99 | 99 | if (!$dbman->field_exists($table, $field)) { |
100 | - $dbman->add_field($table, $field, $continue=true, $feedback=true); |
|
100 | + $dbman->add_field($table, $field, $continue = true, $feedback = true); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | upgrade_mod_savepoint(true, 2014070420, 'bigbluebuttonbn'); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | $field = new xmldb_field('participants'); |
110 | 110 | $field->set_attributes(XMLDB_TYPE_TEXT, 'medium', null, null, null, null); |
111 | 111 | |
112 | - $dbman->change_field_type($table, $field, $continue=true, $feedback=true); |
|
112 | + $dbman->change_field_type($table, $field, $continue = true, $feedback = true); |
|
113 | 113 | |
114 | 114 | upgrade_mod_savepoint(true, 2014101004, 'bigbluebuttonbn'); |
115 | 115 | } |
@@ -119,67 +119,67 @@ discard block |
||
119 | 119 | $table = new xmldb_table('bigbluebuttonbn'); |
120 | 120 | //// Drop field timeduration |
121 | 121 | $field = new xmldb_field('timeduration'); |
122 | - if( $dbman->field_exists($table, $field) ) { |
|
123 | - $dbman->drop_field($table, $field, $continue=true, $feedback=true); |
|
122 | + if ($dbman->field_exists($table, $field)) { |
|
123 | + $dbman->drop_field($table, $field, $continue = true, $feedback = true); |
|
124 | 124 | } |
125 | 125 | //// Drop field allmoderators |
126 | 126 | $field = new xmldb_field('allmoderators'); |
127 | - if( $dbman->field_exists($table, $field) ) { |
|
128 | - $dbman->drop_field($table, $field, $continue=true, $feedback=true); |
|
127 | + if ($dbman->field_exists($table, $field)) { |
|
128 | + $dbman->drop_field($table, $field, $continue = true, $feedback = true); |
|
129 | 129 | } |
130 | 130 | //// Add field intro |
131 | 131 | $field = new xmldb_field('intro'); |
132 | 132 | $field->set_attributes(XMLDB_TYPE_TEXT, 'medium', null, null, null, null, 'name'); |
133 | - if( !$dbman->field_exists($table, $field) ) { |
|
134 | - $dbman->add_field($table, $field, $continue=true, $feedback=true); |
|
133 | + if (!$dbman->field_exists($table, $field)) { |
|
134 | + $dbman->add_field($table, $field, $continue = true, $feedback = true); |
|
135 | 135 | } |
136 | 136 | //// Add field introformat |
137 | 137 | $field = new xmldb_field('introformat'); |
138 | 138 | $field->set_attributes(XMLDB_TYPE_INTEGER, '4', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, 1, 'intro'); |
139 | - if( !$dbman->field_exists($table, $field) ) { |
|
140 | - $dbman->add_field($table, $field, $continue=true, $feedback=true); |
|
139 | + if (!$dbman->field_exists($table, $field)) { |
|
140 | + $dbman->add_field($table, $field, $continue = true, $feedback = true); |
|
141 | 141 | } |
142 | 142 | //// Add field tagging |
143 | 143 | $field = new xmldb_field('tagging'); |
144 | 144 | $field->set_attributes(XMLDB_TYPE_INTEGER, '1', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, 0, 'record'); |
145 | - if( !$dbman->field_exists($table, $field) ) { |
|
146 | - $dbman->add_field($table, $field, $continue=true, $feedback=true); |
|
145 | + if (!$dbman->field_exists($table, $field)) { |
|
146 | + $dbman->add_field($table, $field, $continue = true, $feedback = true); |
|
147 | 147 | } |
148 | 148 | //// Add field presentation |
149 | 149 | $field = new xmldb_field('presentation'); |
150 | 150 | $field->set_attributes(XMLDB_TYPE_TEXT, 'medium', null, null, null, null, 'timemodified'); |
151 | - if( !$dbman->field_exists($table, $field) ) { |
|
152 | - $dbman->add_field($table, $field, $continue=true, $feedback=true); |
|
151 | + if (!$dbman->field_exists($table, $field)) { |
|
152 | + $dbman->add_field($table, $field, $continue = true, $feedback = true); |
|
153 | 153 | } |
154 | 154 | //// Add field type |
155 | 155 | $field = new xmldb_field('type'); |
156 | 156 | $field->set_attributes(XMLDB_TYPE_INTEGER, '2', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, 0, 'course'); |
157 | - if( !$dbman->field_exists($table, $field) ) { |
|
158 | - $dbman->add_field($table, $field, $continue=true, $feedback=true); |
|
157 | + if (!$dbman->field_exists($table, $field)) { |
|
158 | + $dbman->add_field($table, $field, $continue = true, $feedback = true); |
|
159 | 159 | } |
160 | 160 | //// Rename field timeavailable |
161 | 161 | $field = new xmldb_field('timeavailable'); |
162 | 162 | $field->set_attributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, 0); |
163 | - if( $dbman->field_exists($table, $field) ) { |
|
164 | - $dbman->rename_field($table, $field, 'openingtime', $continue=true, $feedback=true); |
|
163 | + if ($dbman->field_exists($table, $field)) { |
|
164 | + $dbman->rename_field($table, $field, 'openingtime', $continue = true, $feedback = true); |
|
165 | 165 | } |
166 | 166 | //// Rename field timedue |
167 | 167 | $field = new xmldb_field('timedue'); |
168 | 168 | $field->set_attributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, 0); |
169 | - if( $dbman->field_exists($table, $field) ) { |
|
170 | - $dbman->rename_field($table, $field, 'closingtime', $continue=true, $feedback=true); |
|
169 | + if ($dbman->field_exists($table, $field)) { |
|
170 | + $dbman->rename_field($table, $field, 'closingtime', $continue = true, $feedback = true); |
|
171 | 171 | } |
172 | 172 | //// Add field timecreated |
173 | 173 | $field = new xmldb_field('timecreated'); |
174 | 174 | $field->set_attributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, 0, 'closingtime'); |
175 | - if( !$dbman->field_exists($table, $field) ) { |
|
176 | - $dbman->add_field($table, $field, $continue=true, $feedback=true); |
|
175 | + if (!$dbman->field_exists($table, $field)) { |
|
176 | + $dbman->add_field($table, $field, $continue = true, $feedback = true); |
|
177 | 177 | } |
178 | 178 | //// Add field userlimit |
179 | 179 | $field = new xmldb_field('userlimit'); |
180 | 180 | $field->set_attributes(XMLDB_TYPE_INTEGER, '3', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, 0); |
181 | 181 | if (!$dbman->field_exists($table, $field)) { |
182 | - $dbman->add_field($table, $field, $continue=true, $feedback=true); |
|
182 | + $dbman->add_field($table, $field, $continue = true, $feedback = true); |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | // Update the bigbluebuttonbn_log table |
@@ -187,18 +187,18 @@ discard block |
||
187 | 187 | //// Add field userid |
188 | 188 | $field = new xmldb_field('userid'); |
189 | 189 | $field->set_attributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, 0, 'bigbluebuttonbnid'); |
190 | - if( !$dbman->field_exists($table, $field) ) { |
|
191 | - $dbman->add_field($table, $field, $continue=true, $feedback=true); |
|
190 | + if (!$dbman->field_exists($table, $field)) { |
|
191 | + $dbman->add_field($table, $field, $continue = true, $feedback = true); |
|
192 | 192 | } |
193 | 193 | //// Add field meta |
194 | 194 | $field = new xmldb_field('meta'); |
195 | 195 | $field->set_attributes(XMLDB_TYPE_TEXT, 'medium', null, null, null, null, 'event'); |
196 | - if( !$dbman->field_exists($table, $field) ) { |
|
197 | - $dbman->add_field($table, $field, $continue=true, $feedback=true); |
|
196 | + if (!$dbman->field_exists($table, $field)) { |
|
197 | + $dbman->add_field($table, $field, $continue = true, $feedback = true); |
|
198 | 198 | } |
199 | 199 | //// Drop field recording |
200 | 200 | $field = new xmldb_field('record'); |
201 | - if( $dbman->field_exists($table, $field) ) { |
|
201 | + if ($dbman->field_exists($table, $field)) { |
|
202 | 202 | //// Migrate data in field recording to new format in meta |
203 | 203 | $meta = new \stdClass(); |
204 | 204 | |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | $DB->set_field('bigbluebuttonbn_log', 'meta', json_encode($meta), array('event' => 'Create', 'record' => 0)); |
212 | 212 | |
213 | 213 | // Drop field recording |
214 | - $dbman->drop_field($table, $field, $continue=true, $feedback=true); |
|
214 | + $dbman->drop_field($table, $field, $continue = true, $feedback = true); |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | upgrade_mod_savepoint(true, 2015063000, 'bigbluebuttonbn'); |
@@ -222,14 +222,14 @@ discard block |
||
222 | 222 | $table = new xmldb_table('bigbluebuttonbn'); |
223 | 223 | //// Drop field description |
224 | 224 | $field = new xmldb_field('description'); |
225 | - if( $dbman->field_exists($table, $field) ) { |
|
226 | - $dbman->drop_field($table, $field, $continue=true, $feedback=true); |
|
225 | + if ($dbman->field_exists($table, $field)) { |
|
226 | + $dbman->drop_field($table, $field, $continue = true, $feedback = true); |
|
227 | 227 | } |
228 | 228 | //// Change welcome, allow null |
229 | 229 | $field = new xmldb_field('welcome'); |
230 | 230 | $field->set_attributes(XMLDB_TYPE_TEXT, null, null, null, null, null, null, null, 'type'); |
231 | - if( $dbman->field_exists($table, $field) ) { |
|
232 | - $dbman->change_field_notnull($table, $field, $continue=true, $feedback=true); |
|
231 | + if ($dbman->field_exists($table, $field)) { |
|
232 | + $dbman->change_field_notnull($table, $field, $continue = true, $feedback = true); |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | // Update the bigbluebuttonbn_log table |
@@ -238,8 +238,8 @@ discard block |
||
238 | 238 | $field = new xmldb_field('userid'); |
239 | 239 | //$field->set_attributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, 0, 'bigbluebuttonbnid'); |
240 | 240 | $field->set_attributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, null, null, null, 'bigbluebuttonbnid'); |
241 | - if( $dbman->field_exists($table, $field) ) { |
|
242 | - $dbman->change_field_notnull($table, $field, $continue=true, $feedback=true); |
|
241 | + if ($dbman->field_exists($table, $field)) { |
|
242 | + $dbman->change_field_notnull($table, $field, $continue = true, $feedback = true); |
|
243 | 243 | } |
244 | 244 | |
245 | 245 | upgrade_mod_savepoint(true, 2015080605, 'bigbluebuttonbn'); |
@@ -93,7 +93,7 @@ |
||
93 | 93 | } else { |
94 | 94 | $getArray = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getEndMeetingURL( $meetingID, $modPW, $endpoint, $shared_secret )); |
95 | 95 | } |
96 | - redirect('index.php?id='.$id); |
|
96 | + redirect('index.php?id='.$id); |
|
97 | 97 | } |
98 | 98 | } |
99 | 99 |
@@ -8,12 +8,12 @@ discard block |
||
8 | 8 | * @copyright 2010-2015 Blindside Networks Inc. |
9 | 9 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v2 or later |
10 | 10 | */ |
11 | -require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); |
|
12 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
11 | +require_once(dirname(dirname(dirname(__FILE__))) . '/config.php'); |
|
12 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
13 | 13 | |
14 | -$id = required_param('id', PARAM_INT); // Course Module ID, or |
|
15 | -$a = optional_param('a', 0, PARAM_INT); // bigbluebuttonbn instance ID |
|
16 | -$g = optional_param('g', 0, PARAM_INT); // group instance ID |
|
14 | +$id = required_param('id', PARAM_INT); // Course Module ID, or |
|
15 | +$a = optional_param('a', 0, PARAM_INT); // bigbluebuttonbn instance ID |
|
16 | +$g = optional_param('g', 0, PARAM_INT); // group instance ID |
|
17 | 17 | |
18 | 18 | if ($id) { |
19 | 19 | $course = $DB->get_record('course', array('id'=>$id), '*', MUST_EXIST); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $PAGE->navbar->add(get_string('modulename', 'bigbluebuttonbn'), "index.php?id=$course->id"); |
37 | 37 | |
38 | 38 | /// Get all the appropriate data |
39 | -if (! $bigbluebuttonbns = get_all_instances_in_course('bigbluebuttonbn', $course)) { |
|
39 | +if (!$bigbluebuttonbns = get_all_instances_in_course('bigbluebuttonbn', $course)) { |
|
40 | 40 | notice('There are no instances of bigbluebuttonbn', "../../course/view.php?id=$course->id"); |
41 | 41 | } |
42 | 42 | |
@@ -44,18 +44,18 @@ discard block |
||
44 | 44 | $timenow = time(); |
45 | 45 | $strweek = get_string('week'); |
46 | 46 | $strtopic = get_string('topic'); |
47 | -$heading_name = get_string('index_heading_name', 'bigbluebuttonbn' ); |
|
48 | -$heading_group = get_string('index_heading_group', 'bigbluebuttonbn' ); |
|
47 | +$heading_name = get_string('index_heading_name', 'bigbluebuttonbn'); |
|
48 | +$heading_group = get_string('index_heading_group', 'bigbluebuttonbn'); |
|
49 | 49 | $heading_users = get_string('index_heading_users', 'bigbluebuttonbn'); |
50 | 50 | $heading_viewer = get_string('index_heading_viewer', 'bigbluebuttonbn'); |
51 | -$heading_moderator = get_string('index_heading_moderator', 'bigbluebuttonbn' ); |
|
52 | -$heading_actions = get_string('index_heading_actions', 'bigbluebuttonbn' ); |
|
53 | -$heading_recording = get_string('index_heading_recording', 'bigbluebuttonbn' ); |
|
51 | +$heading_moderator = get_string('index_heading_moderator', 'bigbluebuttonbn'); |
|
52 | +$heading_actions = get_string('index_heading_actions', 'bigbluebuttonbn'); |
|
53 | +$heading_recording = get_string('index_heading_recording', 'bigbluebuttonbn'); |
|
54 | 54 | |
55 | 55 | $table = new html_table(); |
56 | 56 | |
57 | -$table->head = array ($strweek, $heading_name, $heading_group, $heading_users, $heading_viewer, $heading_moderator, $heading_recording, $heading_actions ); |
|
58 | -$table->align = array ('center', 'left', 'center', 'center', 'center', 'center', 'center' ); |
|
57 | +$table->head = array($strweek, $heading_name, $heading_group, $heading_users, $heading_viewer, $heading_moderator, $heading_recording, $heading_actions); |
|
58 | +$table->align = array('center', 'left', 'center', 'center', 'center', 'center', 'center'); |
|
59 | 59 | |
60 | 60 | $endpoint = bigbluebuttonbn_get_cfg_server_url(); |
61 | 61 | $shared_secret = bigbluebuttonbn_get_cfg_shared_secret(); |
@@ -66,14 +66,14 @@ discard block |
||
66 | 66 | // |
67 | 67 | // A request to end the meeting |
68 | 68 | // |
69 | - if (! $bigbluebuttonbn = $DB->get_record('bigbluebuttonbn', array('id' => $a), '*', MUST_EXIST) ) { |
|
69 | + if (!$bigbluebuttonbn = $DB->get_record('bigbluebuttonbn', array('id' => $a), '*', MUST_EXIST)) { |
|
70 | 70 | print_error("BigBlueButton ID $a is incorrect"); |
71 | 71 | } |
72 | 72 | $course = $DB->get_record('course', array('id' => $bigbluebuttonbn->course), '*', MUST_EXIST); |
73 | 73 | $cm = get_coursemodule_from_instance('bigbluebuttonbn', $bigbluebuttonbn->id, $course->id, false, MUST_EXIST); |
74 | 74 | |
75 | 75 | //User roles |
76 | - if( $bigbluebuttonbn->participants == null || $bigbluebuttonbn->participants == "" || $bigbluebuttonbn->participants == "[]" ){ |
|
76 | + if ($bigbluebuttonbn->participants == null || $bigbluebuttonbn->participants == "" || $bigbluebuttonbn->participants == "[]") { |
|
77 | 77 | //The room that is being used comes from a previous version |
78 | 78 | $moderator = has_capability('mod/bigbluebuttonbn:moderate', $context); |
79 | 79 | } else { |
@@ -81,19 +81,19 @@ discard block |
||
81 | 81 | } |
82 | 82 | $administrator = has_capability('moodle/category:manage', $context); |
83 | 83 | |
84 | - if( $moderator || $administrator ) { |
|
84 | + if ($moderator || $administrator) { |
|
85 | 85 | bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_ENDED, $bigbluebuttonbn, $context, $cm); |
86 | 86 | |
87 | 87 | echo get_string('index_ending', 'bigbluebuttonbn'); |
88 | 88 | |
89 | - $meetingID = $bigbluebuttonbn->meetingid.'-'.$course->id.'-'.$bigbluebuttonbn->id; |
|
89 | + $meetingID = $bigbluebuttonbn->meetingid . '-' . $course->id . '-' . $bigbluebuttonbn->id; |
|
90 | 90 | $modPW = $bigbluebuttonbn->moderatorpass; |
91 | - if( $g != '0' ) { |
|
92 | - $getArray = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getEndMeetingURL( $meetingID.'['.$g.']', $modPW, $endpoint, $shared_secret ) ); |
|
91 | + if ($g != '0') { |
|
92 | + $getArray = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getEndMeetingURL($meetingID . '[' . $g . ']', $modPW, $endpoint, $shared_secret)); |
|
93 | 93 | } else { |
94 | - $getArray = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getEndMeetingURL( $meetingID, $modPW, $endpoint, $shared_secret )); |
|
94 | + $getArray = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getEndMeetingURL($meetingID, $modPW, $endpoint, $shared_secret)); |
|
95 | 95 | } |
96 | - redirect('index.php?id='.$id); |
|
96 | + redirect('index.php?id=' . $id); |
|
97 | 97 | } |
98 | 98 | } |
99 | 99 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | $cm = get_coursemodule_from_id('bigbluebuttonbn', $bigbluebuttonbn->coursemodule, 0, false, MUST_EXIST); |
102 | 102 | |
103 | 103 | //User roles |
104 | - if( $bigbluebuttonbn->participants == null || $bigbluebuttonbn->participants == "" || $bigbluebuttonbn->participants == "[]" ){ |
|
104 | + if ($bigbluebuttonbn->participants == null || $bigbluebuttonbn->participants == "" || $bigbluebuttonbn->participants == "[]") { |
|
105 | 105 | //The room that is being used comes from a previous version |
106 | 106 | $moderator = has_capability('mod/bigbluebuttonbn:moderate', $context); |
107 | 107 | } else { |
@@ -109,11 +109,11 @@ discard block |
||
109 | 109 | } |
110 | 110 | $administrator = has_capability('moodle/category:manage', $context); |
111 | 111 | |
112 | - if ( groups_get_activity_groupmode($cm) > 0 ){ |
|
113 | - $table->data[] = displayBigBlueButtonRooms($endpoint, $shared_secret, ($administrator || $moderator), $course, $bigbluebuttonbn, (object) array('id'=>0, 'name'=>get_string('allparticipants'))); |
|
112 | + if (groups_get_activity_groupmode($cm) > 0) { |
|
113 | + $table->data[] = displayBigBlueButtonRooms($endpoint, $shared_secret, ($administrator || $moderator), $course, $bigbluebuttonbn, (object)array('id'=>0, 'name'=>get_string('allparticipants'))); |
|
114 | 114 | $groups = groups_get_activity_allowed_groups($cm); |
115 | - if( isset($groups)) { |
|
116 | - foreach( $groups as $group){ |
|
115 | + if (isset($groups)) { |
|
116 | + foreach ($groups as $group) { |
|
117 | 117 | $table->data[] = displayBigBlueButtonRooms($endpoint, $shared_secret, ($administrator || $moderator), $course, $bigbluebuttonbn, $group); |
118 | 118 | } |
119 | 119 | } |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | echo $OUTPUT->footer(); |
131 | 131 | |
132 | 132 | /// Functions |
133 | -function displayBigBlueButtonRooms($endpoint, $shared_secret, $moderator, $course, $bigbluebuttonbn, $groupObj = null ){ |
|
133 | +function displayBigBlueButtonRooms($endpoint, $shared_secret, $moderator, $course, $bigbluebuttonbn, $groupObj = null) { |
|
134 | 134 | $joinURL = null; |
135 | 135 | $group = "-"; |
136 | 136 | $users = "-"; |
@@ -140,22 +140,22 @@ discard block |
||
140 | 140 | $moderatorList = "-"; |
141 | 141 | $recording = "-"; |
142 | 142 | |
143 | - if ( !$bigbluebuttonbn->visible ) { |
|
143 | + if (!$bigbluebuttonbn->visible) { |
|
144 | 144 | // Nothing to do |
145 | 145 | } else { |
146 | 146 | $modPW = $bigbluebuttonbn->moderatorpass; |
147 | 147 | $attPW = $bigbluebuttonbn->viewerpass; |
148 | 148 | |
149 | - $meetingID = $bigbluebuttonbn->meetingid.'-'.$course->id.'-'.$bigbluebuttonbn->id; |
|
149 | + $meetingID = $bigbluebuttonbn->meetingid . '-' . $course->id . '-' . $bigbluebuttonbn->id; |
|
150 | 150 | // |
151 | 151 | // Output Users in the meeting |
152 | 152 | // |
153 | - if( $groupObj == null ){ |
|
154 | - $meetingInfo = bigbluebuttonbn_getMeetingInfoArray( $meetingID, $modPW, $endpoint, $shared_secret ); |
|
155 | - $joinURL = '<a href="view.php?id='.$bigbluebuttonbn->coursemodule.'">'.format_string($bigbluebuttonbn->name).'</a>'; |
|
153 | + if ($groupObj == null) { |
|
154 | + $meetingInfo = bigbluebuttonbn_getMeetingInfoArray($meetingID, $modPW, $endpoint, $shared_secret); |
|
155 | + $joinURL = '<a href="view.php?id=' . $bigbluebuttonbn->coursemodule . '">' . format_string($bigbluebuttonbn->name) . '</a>'; |
|
156 | 156 | } else { |
157 | - $meetingInfo = bigbluebuttonbn_getMeetingInfoArray( $meetingID.'['.$groupObj->id.']', $modPW, $endpoint, $shared_secret ); |
|
158 | - $joinURL = '<a href="view.php?id='.$bigbluebuttonbn->coursemodule.'&group='.$groupObj->id.'">'.format_string($bigbluebuttonbn->name).'</a>'; |
|
157 | + $meetingInfo = bigbluebuttonbn_getMeetingInfoArray($meetingID . '[' . $groupObj->id . ']', $modPW, $endpoint, $shared_secret); |
|
158 | + $joinURL = '<a href="view.php?id=' . $bigbluebuttonbn->coursemodule . '&group=' . $groupObj->id . '">' . format_string($bigbluebuttonbn->name) . '</a>'; |
|
159 | 159 | $group = $groupObj->name; |
160 | 160 | } |
161 | 161 | |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | // |
164 | 164 | // The server was unreachable |
165 | 165 | // |
166 | - print_error( get_string( 'index_error_unable_display', 'bigbluebuttonbn' )); |
|
166 | + print_error(get_string('index_error_unable_display', 'bigbluebuttonbn')); |
|
167 | 167 | return; |
168 | 168 | } |
169 | 169 | |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | // There was an error returned |
173 | 173 | // |
174 | 174 | if ($meetingInfo['messageKey'] == "checksumError") { |
175 | - print_error( get_string( 'index_error_checksum', 'bigbluebuttonbn' )); |
|
175 | + print_error(get_string('index_error_checksum', 'bigbluebuttonbn')); |
|
176 | 176 | return; |
177 | 177 | } |
178 | 178 | |
@@ -184,39 +184,39 @@ discard block |
||
184 | 184 | // |
185 | 185 | // There was an error |
186 | 186 | // |
187 | - $users = $meetingInfo['messageKey'].": ".$meetingInfo['message']; |
|
187 | + $users = $meetingInfo['messageKey'] . ": " . $meetingInfo['message']; |
|
188 | 188 | } |
189 | 189 | } else { |
190 | 190 | // |
191 | 191 | // The meeting info was returned |
192 | 192 | // |
193 | 193 | if ($meetingInfo['running'] == 'true') { |
194 | - if ( $moderator ) { |
|
195 | - if( $groupObj == null ) { |
|
196 | - $actions = '<form name="form1" method="post" action=""><INPUT type="hidden" name="id" value="'.$course->id.'"><INPUT type="hidden" name="a" value="'.$bigbluebuttonbn->id.'"><INPUT type="submit" name="submit" value="end" onclick="return confirm(\''. get_string('index_confirm_end', 'bigbluebuttonbn' ).'\')"></form>'; |
|
194 | + if ($moderator) { |
|
195 | + if ($groupObj == null) { |
|
196 | + $actions = '<form name="form1" method="post" action=""><INPUT type="hidden" name="id" value="' . $course->id . '"><INPUT type="hidden" name="a" value="' . $bigbluebuttonbn->id . '"><INPUT type="submit" name="submit" value="end" onclick="return confirm(\'' . get_string('index_confirm_end', 'bigbluebuttonbn') . '\')"></form>'; |
|
197 | 197 | } else { |
198 | - $actions = '<form name="form1" method="post" action=""><INPUT type="hidden" name="id" value="'.$course->id.'"><INPUT type="hidden" name="a" value="'.$bigbluebuttonbn->id.'"><INPUT type="hidden" name="g" value="'.$groupObj->id.'"><INPUT type="submit" name="submit" value="end" onclick="return confirm(\''. get_string('index_confirm_end', 'bigbluebuttonbn' ).'\')"></form>'; |
|
198 | + $actions = '<form name="form1" method="post" action=""><INPUT type="hidden" name="id" value="' . $course->id . '"><INPUT type="hidden" name="a" value="' . $bigbluebuttonbn->id . '"><INPUT type="hidden" name="g" value="' . $groupObj->id . '"><INPUT type="submit" name="submit" value="end" onclick="return confirm(\'' . get_string('index_confirm_end', 'bigbluebuttonbn') . '\')"></form>'; |
|
199 | 199 | } |
200 | 200 | } |
201 | - if ( isset($meetingInfo['recording']) && $meetingInfo['recording'] == 'true' ){ // if it has been set when meeting created, set the variable on/off |
|
202 | - $recording = get_string('index_enabled', 'bigbluebuttonbn' ); |
|
201 | + if (isset($meetingInfo['recording']) && $meetingInfo['recording'] == 'true') { // if it has been set when meeting created, set the variable on/off |
|
202 | + $recording = get_string('index_enabled', 'bigbluebuttonbn'); |
|
203 | 203 | } |
204 | 204 | |
205 | 205 | $xml = $meetingInfo['attendees']; |
206 | - if (count( $xml ) && count( $xml->attendee ) ) { |
|
207 | - $users = count( $xml->attendee ); |
|
206 | + if (count($xml) && count($xml->attendee)) { |
|
207 | + $users = count($xml->attendee); |
|
208 | 208 | $viewer_count = 0; |
209 | 209 | $moderator_count = 0; |
210 | - foreach ( $xml->attendee as $attendee ) { |
|
211 | - if ($attendee->role == "MODERATOR" ) { |
|
212 | - if ( $viewer_count++ > 0 ) { |
|
210 | + foreach ($xml->attendee as $attendee) { |
|
211 | + if ($attendee->role == "MODERATOR") { |
|
212 | + if ($viewer_count++ > 0) { |
|
213 | 213 | $moderatorList .= ", "; |
214 | 214 | } else { |
215 | 215 | $moderatorList = ""; |
216 | 216 | } |
217 | 217 | $moderatorList .= $attendee->fullName; |
218 | 218 | } else { |
219 | - if ( $moderator_count++ > 0 ) { |
|
219 | + if ($moderator_count++ > 0) { |
|
220 | 220 | $viewerList .= ", "; |
221 | 221 | } else { |
222 | 222 | $viewerList = ""; |
@@ -228,6 +228,6 @@ discard block |
||
228 | 228 | } |
229 | 229 | } |
230 | 230 | |
231 | - return array ($bigbluebuttonbn->section, $joinURL, $group, $users, $viewerList, $moderatorList, $recording, $actions ); |
|
231 | + return array($bigbluebuttonbn->section, $joinURL, $group, $users, $viewerList, $moderatorList, $recording, $actions); |
|
232 | 232 | } |
233 | 233 | } |
234 | 234 | \ No newline at end of file |
@@ -15,5 +15,5 @@ |
||
15 | 15 | $plugin->requires = 2013111800; |
16 | 16 | $plugin->cron = 0; |
17 | 17 | $plugin->component = 'mod_bigbluebuttonbn'; |
18 | -$plugin->maturity = MATURITY_STABLE; // [MATURITY_STABLE | MATURITY_RC | MATURITY_BETA | MATURITY_ALPHA] |
|
18 | +$plugin->maturity = MATURITY_STABLE; // [MATURITY_STABLE | MATURITY_RC | MATURITY_BETA | MATURITY_ALPHA] |
|
19 | 19 | $plugin->release = '2.0.4'; |
@@ -38,7 +38,7 @@ |
||
38 | 38 | * @return string |
39 | 39 | */ |
40 | 40 | public function get_description() { |
41 | - $rid = isset($this->other['rid'])? $this->other['rid']: ''; |
|
41 | + $rid = isset($this->other['rid']) ? $this->other['rid'] : ''; |
|
42 | 42 | return "The user with id '$this->userid' has published a recording with id '$rid' for " . |
43 | 43 | "the course id '$this->contextinstanceid'."; |
44 | 44 | } |