@@ -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,23 +13,23 @@ 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.'/mod/lti/OAuth.php'); |
|
| 19 | -require_once($CFG->libdir.'/accesslib.php'); |
|
| 20 | -require_once($CFG->libdir.'/completionlib.php'); |
|
| 21 | -require_once($CFG->libdir.'/datalib.php'); |
|
| 22 | -require_once($CFG->libdir.'/coursecatlib.php'); |
|
| 23 | -require_once($CFG->libdir.'/enrollib.php'); |
|
| 24 | -require_once($CFG->libdir.'/filelib.php'); |
|
| 25 | -require_once($CFG->libdir.'/formslib.php'); |
|
| 26 | - |
|
| 27 | -require_once(dirname(__FILE__).'/JWT.php'); |
|
| 28 | - |
|
| 29 | -if( file_exists(dirname(__FILE__).'/config.php') ) { |
|
| 30 | - require_once(dirname(__FILE__).'/config.php'); |
|
| 31 | - if( isset($BIGBLUEBUTTONBN_CFG) ) { |
|
| 32 | - $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 . '/mod/lti/OAuth.php'); |
|
| 19 | +require_once($CFG->libdir . '/accesslib.php'); |
|
| 20 | +require_once($CFG->libdir . '/completionlib.php'); |
|
| 21 | +require_once($CFG->libdir . '/datalib.php'); |
|
| 22 | +require_once($CFG->libdir . '/coursecatlib.php'); |
|
| 23 | +require_once($CFG->libdir . '/enrollib.php'); |
|
| 24 | +require_once($CFG->libdir . '/filelib.php'); |
|
| 25 | +require_once($CFG->libdir . '/formslib.php'); |
|
| 26 | + |
|
| 27 | +require_once(dirname(__FILE__) . '/JWT.php'); |
|
| 28 | + |
|
| 29 | +if (file_exists(dirname(__FILE__) . '/config.php')) { |
|
| 30 | + require_once(dirname(__FILE__) . '/config.php'); |
|
| 31 | + if (isset($BIGBLUEBUTTONBN_CFG)) { |
|
| 32 | + $CFG = (object)array_merge((array)$CFG, (array)$BIGBLUEBUTTONBN_CFG); |
|
| 33 | 33 | } |
| 34 | 34 | } else { |
| 35 | 35 | $BIGBLUEBUTTONBN_CFG = new stdClass(); |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | const BIGBLUEBUTTONBN_LOG_EVENT_DELETE = "Delete"; |
| 51 | 51 | |
| 52 | 52 | function bigbluebuttonbn_supports($feature) { |
| 53 | - switch($feature) { |
|
| 53 | + switch ($feature) { |
|
| 54 | 54 | case FEATURE_IDNUMBER: return true; |
| 55 | 55 | case FEATURE_GROUPS: return true; |
| 56 | 56 | case FEATURE_GROUPINGS: return true; |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | function bigbluebuttonbn_add_instance($data, $mform) { |
| 80 | 80 | global $DB, $CFG; |
| 81 | 81 | |
| 82 | - $draftitemid = isset($data->presentation)? $data->presentation: null; |
|
| 82 | + $draftitemid = isset($data->presentation) ? $data->presentation : null; |
|
| 83 | 83 | $context = bigbluebuttonbn_get_context_module($data->coursemodule); |
| 84 | 84 | |
| 85 | 85 | bigbluebuttonbn_process_pre_save($data); |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | global $DB, $CFG; |
| 108 | 108 | |
| 109 | 109 | $data->id = $data->instance; |
| 110 | - $draftitemid = isset($data->presentation)? $data->presentation: null; |
|
| 110 | + $draftitemid = isset($data->presentation) ? $data->presentation : null; |
|
| 111 | 111 | $context = bigbluebuttonbn_get_context_module($data->coursemodule); |
| 112 | 112 | |
| 113 | 113 | bigbluebuttonbn_process_pre_save($data); |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | function bigbluebuttonbn_delete_instance($id) { |
| 134 | 134 | global $CFG, $DB, $USER; |
| 135 | 135 | |
| 136 | - if (! $bigbluebuttonbn = $DB->get_record('bigbluebuttonbn', array('id' => $id))) { |
|
| 136 | + if (!$bigbluebuttonbn = $DB->get_record('bigbluebuttonbn', array('id' => $id))) { |
|
| 137 | 137 | return false; |
| 138 | 138 | } |
| 139 | 139 | |
@@ -151,11 +151,11 @@ discard block |
||
| 151 | 151 | //if( bigbluebuttonbn_isMeetingRunning($meetingID, $url, $shared_secret) ) |
| 152 | 152 | // $getArray = bigbluebuttonbn_doEndMeeting( $meetingID, $modPW, $url, $shared_secret ); |
| 153 | 153 | |
| 154 | - if (! $DB->delete_records('bigbluebuttonbn', array('id' => $bigbluebuttonbn->id))) { |
|
| 154 | + if (!$DB->delete_records('bigbluebuttonbn', array('id' => $bigbluebuttonbn->id))) { |
|
| 155 | 155 | $result = false; |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | - if (! $DB->delete_records('event', array('modulename'=>'bigbluebuttonbn', 'instance'=>$bigbluebuttonbn->id))) { |
|
| 158 | + if (!$DB->delete_records('event', array('modulename'=>'bigbluebuttonbn', 'instance'=>$bigbluebuttonbn->id))) { |
|
| 159 | 159 | $result = false; |
| 160 | 160 | } |
| 161 | 161 | |
@@ -171,19 +171,19 @@ discard block |
||
| 171 | 171 | $logs = $DB->get_records('bigbluebuttonbn_logs', array('bigbluebuttonbnid' => $bigbluebuttonbn->id, 'log' => BIGBLUEBUTTONBN_LOG_EVENT_CREATE)); |
| 172 | 172 | error_log(json_encode($logs)); |
| 173 | 173 | $has_recordings = 'false'; |
| 174 | - if (! empty($logs) ) { |
|
| 174 | + if (!empty($logs)) { |
|
| 175 | 175 | error_log("IS not empty"); |
| 176 | - foreach ( $logs as $l ) { |
|
| 176 | + foreach ($logs as $l) { |
|
| 177 | 177 | error_log(json_encode($l)); |
| 178 | 178 | $meta = json_decode($l->meta); |
| 179 | - if ( $meta->record ) { |
|
| 179 | + if ($meta->record) { |
|
| 180 | 180 | $has_recordings = 'true'; |
| 181 | 181 | } |
| 182 | 182 | } |
| 183 | 183 | } |
| 184 | 184 | $log->meta = "{\"has_recordings\":{$has_recordings}}"; |
| 185 | 185 | |
| 186 | - if (! $returnid = $DB->insert_record('bigbluebuttonbn_logs', $log)) { |
|
| 186 | + if (!$returnid = $DB->insert_record('bigbluebuttonbn_logs', $log)) { |
|
| 187 | 187 | $result = false; |
| 188 | 188 | } |
| 189 | 189 | |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | * @return boolean |
| 222 | 222 | */ |
| 223 | 223 | function bigbluebuttonbn_print_recent_activity($course, $isteacher, $timestart) { |
| 224 | - return false; // True if anything was printed, otherwise false |
|
| 224 | + return false; // True if anything was printed, otherwise false |
|
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | /** |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | * @param int $groupid defaults to 0 |
| 237 | 237 | * @return void adds items into $activities and increases $index |
| 238 | 238 | */ |
| 239 | -function bigbluebuttonbn_get_recent_mod_activity(&$activities, &$index, $timestart, $courseid, $cmid, $userid=0, $groupid=0) { |
|
| 239 | +function bigbluebuttonbn_get_recent_mod_activity(&$activities, &$index, $timestart, $courseid, $cmid, $userid = 0, $groupid = 0) { |
|
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | /** |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | * |
| 255 | 255 | * @return boolean |
| 256 | 256 | **/ |
| 257 | -function bigbluebuttonbn_cron () { |
|
| 257 | +function bigbluebuttonbn_cron() { |
|
| 258 | 258 | return true; |
| 259 | 259 | } |
| 260 | 260 | |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | function bigbluebuttonbn_get_coursemodule_info($coursemodule) { |
| 351 | 351 | global $CFG, $DB; |
| 352 | 352 | |
| 353 | - if ( !$bigbluebuttonbn = $DB->get_record('bigbluebuttonbn', array('id'=>$coursemodule->instance), 'id, name, intro, introformat, newwindow')) { |
|
| 353 | + if (!$bigbluebuttonbn = $DB->get_record('bigbluebuttonbn', array('id'=>$coursemodule->instance), 'id, name, intro, introformat, newwindow')) { |
|
| 354 | 354 | return NULL; |
| 355 | 355 | } |
| 356 | 356 | |
@@ -376,10 +376,10 @@ discard block |
||
| 376 | 376 | function bigbluebuttonbn_process_pre_save(&$bigbluebuttonbn) { |
| 377 | 377 | global $DB, $CFG; |
| 378 | 378 | |
| 379 | - if ( !isset($bigbluebuttonbn->timecreated) || !$bigbluebuttonbn->timecreated ) { |
|
| 379 | + if (!isset($bigbluebuttonbn->timecreated) || !$bigbluebuttonbn->timecreated) { |
|
| 380 | 380 | $bigbluebuttonbn->timecreated = time(); |
| 381 | 381 | //Assign password only if it is a new activity |
| 382 | - if( isset($bigbluebuttonbn->add) && !empty($bigbluebuttonbn->add) ) { |
|
| 382 | + if (isset($bigbluebuttonbn->add) && !empty($bigbluebuttonbn->add)) { |
|
| 383 | 383 | $bigbluebuttonbn->moderatorpass = bigbluebuttonbn_random_password(12); |
| 384 | 384 | $bigbluebuttonbn->viewerpass = bigbluebuttonbn_random_password(12); |
| 385 | 385 | } |
@@ -388,13 +388,13 @@ discard block |
||
| 388 | 388 | $bigbluebuttonbn->timemodified = time(); |
| 389 | 389 | } |
| 390 | 390 | |
| 391 | - if (! isset($bigbluebuttonbn->newwindow)) |
|
| 391 | + if (!isset($bigbluebuttonbn->newwindow)) |
|
| 392 | 392 | $bigbluebuttonbn->newwindow = 0; |
| 393 | - if (! isset($bigbluebuttonbn->wait)) |
|
| 393 | + if (!isset($bigbluebuttonbn->wait)) |
|
| 394 | 394 | $bigbluebuttonbn->wait = 0; |
| 395 | - if (! isset($bigbluebuttonbn->record)) |
|
| 395 | + if (!isset($bigbluebuttonbn->record)) |
|
| 396 | 396 | $bigbluebuttonbn->record = 0; |
| 397 | - if (! isset($bigbluebuttonbn->tagging)) |
|
| 397 | + if (!isset($bigbluebuttonbn->tagging)) |
|
| 398 | 398 | $bigbluebuttonbn->tagging = 0; |
| 399 | 399 | |
| 400 | 400 | $bigbluebuttonbn->participants = htmlspecialchars_decode($bigbluebuttonbn->participants); |
@@ -413,8 +413,8 @@ discard block |
||
| 413 | 413 | |
| 414 | 414 | // Now that an id was assigned, generate and set the meetingid property based on |
| 415 | 415 | // [Moodle Instance + Activity ID + BBB Secret] (but only for new activities) |
| 416 | - if( isset($bigbluebuttonbn->add) && !empty($bigbluebuttonbn->add) ) { |
|
| 417 | - $bigbluebuttonbn_meetingid = sha1($CFG->wwwroot.$bigbluebuttonbn->id.bigbluebuttonbn_get_cfg_shared_secret()); |
|
| 416 | + if (isset($bigbluebuttonbn->add) && !empty($bigbluebuttonbn->add)) { |
|
| 417 | + $bigbluebuttonbn_meetingid = sha1($CFG->wwwroot . $bigbluebuttonbn->id . bigbluebuttonbn_get_cfg_shared_secret()); |
|
| 418 | 418 | $DB->set_field('bigbluebuttonbn', 'meetingid', $bigbluebuttonbn_meetingid, array('id' => $bigbluebuttonbn->id)); |
| 419 | 419 | $action = get_string('mod_form_field_notification_msg_created', 'bigbluebuttonbn'); |
| 420 | 420 | } else { |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | $at = get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn'); |
| 424 | 424 | |
| 425 | 425 | // Add evento to the calendar when if openingtime is set |
| 426 | - if ( isset($bigbluebuttonbn->openingtime) && $bigbluebuttonbn->openingtime ){ |
|
| 426 | + if (isset($bigbluebuttonbn->openingtime) && $bigbluebuttonbn->openingtime) { |
|
| 427 | 427 | $event = new stdClass(); |
| 428 | 428 | $event->name = $bigbluebuttonbn->name; |
| 429 | 429 | $event->courseid = $bigbluebuttonbn->course; |
@@ -433,13 +433,13 @@ discard block |
||
| 433 | 433 | $event->instance = $bigbluebuttonbn->id; |
| 434 | 434 | $event->timestart = $bigbluebuttonbn->openingtime; |
| 435 | 435 | |
| 436 | - if ( $bigbluebuttonbn->closingtime ){ |
|
| 436 | + if ($bigbluebuttonbn->closingtime) { |
|
| 437 | 437 | $event->durationtime = $bigbluebuttonbn->closingtime - $bigbluebuttonbn->openingtime; |
| 438 | 438 | } else { |
| 439 | 439 | $event->durationtime = 0; |
| 440 | 440 | } |
| 441 | 441 | |
| 442 | - if ( $event->id = $DB->get_field('event', 'id', array('modulename'=>'bigbluebuttonbn', 'instance'=>$bigbluebuttonbn->id)) ) { |
|
| 442 | + if ($event->id = $DB->get_field('event', 'id', array('modulename'=>'bigbluebuttonbn', 'instance'=>$bigbluebuttonbn->id))) { |
|
| 443 | 443 | $calendarevent = calendar_event::load($event->id); |
| 444 | 444 | $calendarevent->update($event); |
| 445 | 445 | } else { |
@@ -450,7 +450,7 @@ discard block |
||
| 450 | 450 | $DB->delete_records('event', array('modulename'=>'bigbluebuttonbn', 'instance'=>$bigbluebuttonbn->id)); |
| 451 | 451 | } |
| 452 | 452 | |
| 453 | - if( isset($bigbluebuttonbn->notification) && $bigbluebuttonbn->notification ) { |
|
| 453 | + if (isset($bigbluebuttonbn->notification) && $bigbluebuttonbn->notification) { |
|
| 454 | 454 | // Prepare message |
| 455 | 455 | $msg = new stdClass(); |
| 456 | 456 | |
@@ -458,35 +458,35 @@ discard block |
||
| 458 | 458 | $msg->action = $action; |
| 459 | 459 | $msg->activity_type = ""; |
| 460 | 460 | $msg->activity_title = $bigbluebuttonbn->name; |
| 461 | - $message_text = '<p>'.$msg->activity_type.' "'.$msg->activity_title.'" '.get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn').' '.$msg->action.'.</p>'; |
|
| 461 | + $message_text = '<p>' . $msg->activity_type . ' "' . $msg->activity_title . '" ' . get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn') . ' ' . $msg->action . '.</p>'; |
|
| 462 | 462 | |
| 463 | 463 | /// Add the meeting details to the message_body |
| 464 | 464 | $msg->action = ucfirst($action); |
| 465 | 465 | $msg->activity_description = ""; |
| 466 | - if( !empty($bigbluebuttonbn->intro) ) |
|
| 466 | + if (!empty($bigbluebuttonbn->intro)) |
|
| 467 | 467 | $msg->activity_description = trim($bigbluebuttonbn->intro); |
| 468 | 468 | $msg->activity_openingtime = ""; |
| 469 | 469 | if ($bigbluebuttonbn->openingtime) { |
| 470 | - $msg->activity_openingtime = calendar_day_representation($bigbluebuttonbn->openingtime).' '.$at.' '.calendar_time_representation($bigbluebuttonbn->openingtime); |
|
| 470 | + $msg->activity_openingtime = calendar_day_representation($bigbluebuttonbn->openingtime) . ' ' . $at . ' ' . calendar_time_representation($bigbluebuttonbn->openingtime); |
|
| 471 | 471 | } |
| 472 | 472 | $msg->activity_closingtime = ""; |
| 473 | - if ($bigbluebuttonbn->closingtime ) { |
|
| 474 | - $msg->activity_closingtime = calendar_day_representation($bigbluebuttonbn->closingtime).' '.$at.' '.calendar_time_representation($bigbluebuttonbn->closingtime); |
|
| 473 | + if ($bigbluebuttonbn->closingtime) { |
|
| 474 | + $msg->activity_closingtime = calendar_day_representation($bigbluebuttonbn->closingtime) . ' ' . $at . ' ' . calendar_time_representation($bigbluebuttonbn->closingtime); |
|
| 475 | 475 | } |
| 476 | - $msg->activity_owner = $USER->firstname.' '.$USER->lastname; |
|
| 476 | + $msg->activity_owner = $USER->firstname . ' ' . $USER->lastname; |
|
| 477 | 477 | |
| 478 | - $message_text .= '<p><b>'.$msg->activity_title.'</b> '.get_string('email_body_notification_meeting_details', 'bigbluebuttonbn').':'; |
|
| 478 | + $message_text .= '<p><b>' . $msg->activity_title . '</b> ' . get_string('email_body_notification_meeting_details', 'bigbluebuttonbn') . ':'; |
|
| 479 | 479 | $message_text .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>'; |
| 480 | - $message_text .= '<tr><td style="font-weight:bold;color:#555;">'.get_string('email_body_notification_meeting_title', 'bigbluebuttonbn').': </td><td>'; |
|
| 481 | - $message_text .= $msg->activity_title.'</td></tr>'; |
|
| 482 | - $message_text .= '<tr><td style="font-weight:bold;color:#555;">'.get_string('email_body_notification_meeting_description', 'bigbluebuttonbn').': </td><td>'; |
|
| 483 | - $message_text .= $msg->activity_description.'</td></tr>'; |
|
| 484 | - $message_text .= '<tr><td style="font-weight:bold;color:#555;">'.get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn').': </td><td>'; |
|
| 485 | - $message_text .= $msg->activity_openingtime.'</td></tr>'; |
|
| 486 | - $message_text .= '<tr><td style="font-weight:bold;color:#555;">'.get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn').': </td><td>'; |
|
| 487 | - $message_text .= $msg->activity_closingtime.'</td></tr>'; |
|
| 488 | - $message_text .= '<tr><td style="font-weight:bold;color:#555;">'.$msg->action.' '.get_string('email_body_notification_meeting_by', 'bigbluebuttonbn').': </td><td>'; |
|
| 489 | - $message_text .= $msg->activity_owner.'</td></tr></tbody></table></p>'; |
|
| 480 | + $message_text .= '<tr><td style="font-weight:bold;color:#555;">' . get_string('email_body_notification_meeting_title', 'bigbluebuttonbn') . ': </td><td>'; |
|
| 481 | + $message_text .= $msg->activity_title . '</td></tr>'; |
|
| 482 | + $message_text .= '<tr><td style="font-weight:bold;color:#555;">' . get_string('email_body_notification_meeting_description', 'bigbluebuttonbn') . ': </td><td>'; |
|
| 483 | + $message_text .= $msg->activity_description . '</td></tr>'; |
|
| 484 | + $message_text .= '<tr><td style="font-weight:bold;color:#555;">' . get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn') . ': </td><td>'; |
|
| 485 | + $message_text .= $msg->activity_openingtime . '</td></tr>'; |
|
| 486 | + $message_text .= '<tr><td style="font-weight:bold;color:#555;">' . get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn') . ': </td><td>'; |
|
| 487 | + $message_text .= $msg->activity_closingtime . '</td></tr>'; |
|
| 488 | + $message_text .= '<tr><td style="font-weight:bold;color:#555;">' . $msg->action . ' ' . get_string('email_body_notification_meeting_by', 'bigbluebuttonbn') . ': </td><td>'; |
|
| 489 | + $message_text .= $msg->activity_owner . '</td></tr></tbody></table></p>'; |
|
| 490 | 490 | |
| 491 | 491 | // Send notification to all users enrolled |
| 492 | 492 | bigbluebuttonbn_send_notification($USER, $bigbluebuttonbn, $message_text); |
@@ -537,7 +537,7 @@ discard block |
||
| 537 | 537 | * @param array $options additional options affecting the file serving |
| 538 | 538 | * @return bool false if file not found, does not return if found - justsend the file |
| 539 | 539 | */ |
| 540 | -function bigbluebuttonbn_pluginfile($course, $cm, $context, $filearea, $args, $forcedownload, array $options=array()) { |
|
| 540 | +function bigbluebuttonbn_pluginfile($course, $cm, $context, $filearea, $args, $forcedownload, array $options = array()) { |
|
| 541 | 541 | global $CFG, $DB; |
| 542 | 542 | |
| 543 | 543 | if ($context->contextlevel != CONTEXT_MODULE) { |
@@ -553,21 +553,21 @@ discard block |
||
| 553 | 553 | return false; |
| 554 | 554 | } |
| 555 | 555 | |
| 556 | - if( sizeof($args) > 1 ) { |
|
| 556 | + if (sizeof($args) > 1) { |
|
| 557 | 557 | $cache = cache::make_from_params(cache_store::MODE_APPLICATION, 'mod_bigbluebuttonbn', 'presentation_cache'); |
| 558 | 558 | $presentation_nonce_key = sha1($bigbluebuttonbn->id); |
| 559 | 559 | $presentation_nonce = $cache->get($presentation_nonce_key); |
| 560 | 560 | $presentation_nonce_value = $presentation_nonce['value']; |
| 561 | 561 | $presentation_nonce_counter = $presentation_nonce['counter']; |
| 562 | 562 | |
| 563 | - if( $args["0"] != $presentation_nonce_value ) { |
|
| 563 | + if ($args["0"] != $presentation_nonce_value) { |
|
| 564 | 564 | return false; |
| 565 | 565 | } |
| 566 | 566 | |
| 567 | 567 | //The nonce value is actually used twice because BigBlueButton reads the file two times |
| 568 | 568 | $presentation_nonce_counter += 1; |
| 569 | - if( $presentation_nonce_counter < 2 ) { |
|
| 570 | - $cache->set($presentation_nonce_key, array( "value" => $presentation_nonce_value, "counter" => $presentation_nonce_counter )); |
|
| 569 | + if ($presentation_nonce_counter < 2) { |
|
| 570 | + $cache->set($presentation_nonce_key, array("value" => $presentation_nonce_value, "counter" => $presentation_nonce_counter)); |
|
| 571 | 571 | } else { |
| 572 | 572 | $cache->delete($presentation_nonce_key); |
| 573 | 573 | } |
@@ -585,7 +585,7 @@ discard block |
||
| 585 | 585 | } |
| 586 | 586 | |
| 587 | 587 | if ($filearea === 'presentation') { |
| 588 | - $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename; |
|
| 588 | + $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename; |
|
| 589 | 589 | } else { |
| 590 | 590 | return false; |
| 591 | 591 | } |
@@ -619,10 +619,10 @@ discard block |
||
| 619 | 619 | * @package mod_bigbluebuttonbn |
| 620 | 620 | * @return array a list of available roles |
| 621 | 621 | */ |
| 622 | -function bigbluebuttonbn_get_db_moodle_roles($rolename='all') { |
|
| 622 | +function bigbluebuttonbn_get_db_moodle_roles($rolename = 'all') { |
|
| 623 | 623 | global $DB; |
| 624 | 624 | |
| 625 | - if( $rolename != 'all') |
|
| 625 | + if ($rolename != 'all') |
|
| 626 | 626 | $roles = $DB->get_record('role', array('shortname' => $rolename)); |
| 627 | 627 | else |
| 628 | 628 | $roles = $DB->get_records('role', array()); |
@@ -641,22 +641,22 @@ discard block |
||
| 641 | 641 | |
| 642 | 642 | $roles = bigbluebuttonbn_get_db_moodle_roles(); |
| 643 | 643 | $sqluserids = array(); |
| 644 | - foreach($roles as $role){ |
|
| 644 | + foreach ($roles as $role) { |
|
| 645 | 645 | $users = get_role_users($role->id, $context); |
| 646 | - foreach($users as $user) { |
|
| 646 | + foreach ($users as $user) { |
|
| 647 | 647 | array_push($sqluserids, $user->id); |
| 648 | 648 | } |
| 649 | 649 | } |
| 650 | 650 | |
| 651 | 651 | $users_array = array(); |
| 652 | - if( !empty($sqluserids) ) { |
|
| 652 | + if (!empty($sqluserids)) { |
|
| 653 | 653 | $users_array = $DB->get_records_select("user", "id IN (" . implode(', ', $sqluserids) . ") AND deleted = 0"); |
| 654 | 654 | } |
| 655 | 655 | |
| 656 | 656 | return $users_array; |
| 657 | 657 | } |
| 658 | 658 | |
| 659 | -function bigbluebuttonbn_send_notification($sender, $bigbluebuttonbn, $message="") { |
|
| 659 | +function bigbluebuttonbn_send_notification($sender, $bigbluebuttonbn, $message = "") { |
|
| 660 | 660 | global $CFG, $DB; |
| 661 | 661 | |
| 662 | 662 | $context = bigbluebuttonbn_get_context_course($bigbluebuttonbn->course); |
@@ -664,19 +664,19 @@ discard block |
||
| 664 | 664 | |
| 665 | 665 | //Complete message |
| 666 | 666 | $msg = new stdClass(); |
| 667 | - $msg->user_name = $sender->firstname.' '.$sender->lastname; |
|
| 667 | + $msg->user_name = $sender->firstname . ' ' . $sender->lastname; |
|
| 668 | 668 | $msg->user_email = $sender->email; |
| 669 | 669 | $msg->course_name = "$course->fullname"; |
| 670 | - $message .= '<p><hr/><br/>'.get_string('email_footer_sent_by', 'bigbluebuttonbn').' '.$msg->user_name.'('.$msg->user_email.') '; |
|
| 671 | - $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn').' '.$msg->course_name.'.</p>'; |
|
| 670 | + $message .= '<p><hr/><br/>' . get_string('email_footer_sent_by', 'bigbluebuttonbn') . ' ' . $msg->user_name . '(' . $msg->user_email . ') '; |
|
| 671 | + $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn') . ' ' . $msg->course_name . '.</p>'; |
|
| 672 | 672 | |
| 673 | 673 | $users = bigbluebuttonbn_get_users($context); |
| 674 | - foreach( $users as $user ) { |
|
| 675 | - if( $user->id != $sender->id ){ |
|
| 676 | - error_log("Sending msg to ".$user->firstname." ".$user->lastname."."); |
|
| 674 | + foreach ($users as $user) { |
|
| 675 | + if ($user->id != $sender->id) { |
|
| 676 | + error_log("Sending msg to " . $user->firstname . " " . $user->lastname . "."); |
|
| 677 | 677 | $messageid = message_post_message($sender, $user, $message, FORMAT_HTML); |
| 678 | 678 | if (!empty($messageid)) { |
| 679 | - error_log("Msg sent to ".$user->firstname." ".$user->lastname."."); |
|
| 679 | + error_log("Msg sent to " . $user->firstname . " " . $user->lastname . "."); |
|
| 680 | 680 | } else { |
| 681 | 681 | error_log("Msg was NOT sent."); |
| 682 | 682 | } |
@@ -688,7 +688,7 @@ discard block |
||
| 688 | 688 | global $CFG; |
| 689 | 689 | |
| 690 | 690 | $version_major = bigbluebuttonbn_get_moodle_version_major(); |
| 691 | - if ( $version_major < '2013111800' ) { |
|
| 691 | + if ($version_major < '2013111800') { |
|
| 692 | 692 | //This is valid before v2.6 |
| 693 | 693 | $context = get_context_instance(CONTEXT_MODULE, $id); |
| 694 | 694 | } else { |
@@ -703,7 +703,7 @@ discard block |
||
| 703 | 703 | global $CFG; |
| 704 | 704 | |
| 705 | 705 | $version_major = bigbluebuttonbn_get_moodle_version_major(); |
| 706 | - if ( $version_major < '2013111800' ) { |
|
| 706 | + if ($version_major < '2013111800') { |
|
| 707 | 707 | //This is valid before v2.6 |
| 708 | 708 | $context = get_context_instance(CONTEXT_COURSE, $id); |
| 709 | 709 | } else { |
@@ -716,11 +716,11 @@ discard block |
||
| 716 | 716 | |
| 717 | 717 | function bigbluebuttonbn_get_cfg_server_url() { |
| 718 | 718 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 719 | - 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/')); |
|
| 719 | + 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/')); |
|
| 720 | 720 | } |
| 721 | 721 | |
| 722 | 722 | function bigbluebuttonbn_get_cfg_shared_secret() { |
| 723 | 723 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 724 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_shared_secret)? trim($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_shared_secret): (isset($CFG->bigbluebuttonbn_shared_secret)? trim($CFG->bigbluebuttonbn_shared_secret): '8cd8ef52e8e101574e400365b55e11a6')); |
|
| 724 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_shared_secret) ? trim($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_shared_secret) : (isset($CFG->bigbluebuttonbn_shared_secret) ? trim($CFG->bigbluebuttonbn_shared_secret) : '8cd8ef52e8e101574e400365b55e11a6')); |
|
| 725 | 725 | } |
| 726 | 726 | |
@@ -388,14 +388,18 @@ discard block |
||
| 388 | 388 | $bigbluebuttonbn->timemodified = time(); |
| 389 | 389 | } |
| 390 | 390 | |
| 391 | - if (! isset($bigbluebuttonbn->newwindow)) |
|
| 392 | - $bigbluebuttonbn->newwindow = 0; |
|
| 393 | - if (! isset($bigbluebuttonbn->wait)) |
|
| 394 | - $bigbluebuttonbn->wait = 0; |
|
| 395 | - if (! isset($bigbluebuttonbn->record)) |
|
| 396 | - $bigbluebuttonbn->record = 0; |
|
| 397 | - if (! isset($bigbluebuttonbn->tagging)) |
|
| 398 | - $bigbluebuttonbn->tagging = 0; |
|
| 391 | + if (! isset($bigbluebuttonbn->newwindow)) { |
|
| 392 | + $bigbluebuttonbn->newwindow = 0; |
|
| 393 | + } |
|
| 394 | + if (! isset($bigbluebuttonbn->wait)) { |
|
| 395 | + $bigbluebuttonbn->wait = 0; |
|
| 396 | + } |
|
| 397 | + if (! isset($bigbluebuttonbn->record)) { |
|
| 398 | + $bigbluebuttonbn->record = 0; |
|
| 399 | + } |
|
| 400 | + if (! isset($bigbluebuttonbn->tagging)) { |
|
| 401 | + $bigbluebuttonbn->tagging = 0; |
|
| 402 | + } |
|
| 399 | 403 | |
| 400 | 404 | $bigbluebuttonbn->participants = htmlspecialchars_decode($bigbluebuttonbn->participants); |
| 401 | 405 | } |
@@ -463,8 +467,9 @@ discard block |
||
| 463 | 467 | /// Add the meeting details to the message_body |
| 464 | 468 | $msg->action = ucfirst($action); |
| 465 | 469 | $msg->activity_description = ""; |
| 466 | - if( !empty($bigbluebuttonbn->intro) ) |
|
| 467 | - $msg->activity_description = trim($bigbluebuttonbn->intro); |
|
| 470 | + if( !empty($bigbluebuttonbn->intro) ) { |
|
| 471 | + $msg->activity_description = trim($bigbluebuttonbn->intro); |
|
| 472 | + } |
|
| 468 | 473 | $msg->activity_openingtime = ""; |
| 469 | 474 | if ($bigbluebuttonbn->openingtime) { |
| 470 | 475 | $msg->activity_openingtime = calendar_day_representation($bigbluebuttonbn->openingtime).' '.$at.' '.calendar_time_representation($bigbluebuttonbn->openingtime); |
@@ -622,10 +627,11 @@ discard block |
||
| 622 | 627 | function bigbluebuttonbn_get_db_moodle_roles($rolename='all') { |
| 623 | 628 | global $DB; |
| 624 | 629 | |
| 625 | - if( $rolename != 'all') |
|
| 626 | - $roles = $DB->get_record('role', array('shortname' => $rolename)); |
|
| 627 | - else |
|
| 628 | - $roles = $DB->get_records('role', array()); |
|
| 630 | + if( $rolename != 'all') { |
|
| 631 | + $roles = $DB->get_record('role', array('shortname' => $rolename)); |
|
| 632 | + } else { |
|
| 633 | + $roles = $DB->get_records('role', array()); |
|
| 634 | + } |
|
| 629 | 635 | |
| 630 | 636 | return $roles; |
| 631 | 637 | } |
@@ -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); |
@@ -84,8 +84,9 @@ discard block |
||
| 84 | 84 | $bbbsession['voicebridge'] = ($bigbluebuttonbn->voicebridge > 0)? 70000 + $bigbluebuttonbn->voicebridge: $bigbluebuttonbn->voicebridge; |
| 85 | 85 | $bbbsession['wait'] = $bigbluebuttonbn->wait; |
| 86 | 86 | $bbbsession['record'] = $bigbluebuttonbn->record; |
| 87 | -if( $bigbluebuttonbn->record ) |
|
| 87 | +if( $bigbluebuttonbn->record ) { |
|
| 88 | 88 | $bbbsession['welcome'] .= '<br><br>'.get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
| 89 | +} |
|
| 89 | 90 | $bbbsession['tagging'] = $bigbluebuttonbn->tagging; |
| 90 | 91 | |
| 91 | 92 | $bbbsession['openingtime'] = $bigbluebuttonbn->openingtime; |
@@ -112,22 +113,24 @@ discard block |
||
| 112 | 113 | // Validates if the BigBlueButton server is running |
| 113 | 114 | $serverVersion = bigbluebuttonbn_getServerVersion($bbbsession['endpoint']); |
| 114 | 115 | if ( !isset($serverVersion) ) { //Server is not working |
| 115 | - if ( $bbbsession['administrator'] ) |
|
| 116 | - print_error( 'view_error_unable_join', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
|
| 117 | - else if ( $bbbsession['moderator'] ) |
|
| 118 | - print_error( 'view_error_unable_join_teacher', 'bigbluebuttonbn', $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course ); |
|
| 119 | - else |
|
| 120 | - print_error( 'view_error_unable_join_student', 'bigbluebuttonbn', $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course ); |
|
| 121 | -} else { |
|
| 122 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getMeetingsURL( $bbbsession['endpoint'], $bbbsession['shared_secret'] ) ); |
|
| 123 | - if ( !isset($xml) || !isset($xml->returncode) || $xml->returncode == 'FAILED' ){ // The shared secret is wrong |
|
| 124 | - if ( $bbbsession['administrator'] ) |
|
| 116 | + if ( $bbbsession['administrator'] ) { |
|
| 125 | 117 | print_error( 'view_error_unable_join', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
| 126 | - else if ( $bbbsession['moderator'] ) |
|
| 118 | + } else if ( $bbbsession['moderator'] ) { |
|
| 127 | 119 | print_error( 'view_error_unable_join_teacher', 'bigbluebuttonbn', $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course ); |
| 128 | - else |
|
| 120 | + } else { |
|
| 129 | 121 | print_error( 'view_error_unable_join_student', 'bigbluebuttonbn', $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course ); |
| 130 | 122 | } |
| 123 | + } else { |
|
| 124 | + $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getMeetingsURL( $bbbsession['endpoint'], $bbbsession['shared_secret'] ) ); |
|
| 125 | + if ( !isset($xml) || !isset($xml->returncode) || $xml->returncode == 'FAILED' ){ // The shared secret is wrong |
|
| 126 | + if ( $bbbsession['administrator'] ) { |
|
| 127 | + print_error( 'view_error_unable_join', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
|
| 128 | + } else if ( $bbbsession['moderator'] ) { |
|
| 129 | + print_error( 'view_error_unable_join_teacher', 'bigbluebuttonbn', $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course ); |
|
| 130 | + } else { |
|
| 131 | + print_error( 'view_error_unable_join_student', 'bigbluebuttonbn', $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course ); |
|
| 132 | + } |
|
| 133 | + } |
|
| 131 | 134 | } |
| 132 | 135 | |
| 133 | 136 | // Mark viewed by user (if required) |
@@ -203,10 +206,11 @@ discard block |
||
| 203 | 206 | } |
| 204 | 207 | |
| 205 | 208 | $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'.$bbbsession['bigbluebuttonbn']->id.'['.$bbbsession['group'].']'; |
| 206 | - if( $bbbsession['group'] > 0 ) |
|
| 207 | - $group_name = groups_get_group_name($bbbsession['group']); |
|
| 208 | - else |
|
| 209 | - $group_name = get_string('allparticipants'); |
|
| 209 | + if( $bbbsession['group'] > 0 ) { |
|
| 210 | + $group_name = groups_get_group_name($bbbsession['group']); |
|
| 211 | + } else { |
|
| 212 | + $group_name = get_string('allparticipants'); |
|
| 213 | + } |
|
| 210 | 214 | $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name.' ('.$group_name.')'; |
| 211 | 215 | } |
| 212 | 216 | // Metadata (context) |
@@ -362,7 +366,9 @@ discard block |
||
| 362 | 366 | } |
| 363 | 367 | //Generates the meetingID string |
| 364 | 368 | foreach ($mIDs as $mID) { |
| 365 | - if (strlen($meetingID) > 0) $meetingID .= ','; |
|
| 369 | + if (strlen($meetingID) > 0) { |
|
| 370 | + $meetingID .= ','; |
|
| 371 | + } |
|
| 366 | 372 | $meetingID .= $mID; |
| 367 | 373 | } |
| 368 | 374 | } |
@@ -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; |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | $bbbsession['roles'] = get_user_roles($context, $USER->id, true); |
| 57 | 57 | |
| 58 | 58 | // User roles |
| 59 | -if( $bigbluebuttonbn->participants == null || $bigbluebuttonbn->participants == "" || $bigbluebuttonbn->participants == "[]" ){ |
|
| 59 | +if ($bigbluebuttonbn->participants == null || $bigbluebuttonbn->participants == "" || $bigbluebuttonbn->participants == "[]") { |
|
| 60 | 60 | //The room that is being used comes from a previous version |
| 61 | 61 | $bbbsession['moderator'] = has_capability('mod/bigbluebuttonbn:moderate', $context); |
| 62 | 62 | } else { |
@@ -76,16 +76,16 @@ discard block |
||
| 76 | 76 | // Database info related to the activity |
| 77 | 77 | $bbbsession['meetingdescription'] = $bigbluebuttonbn->intro; |
| 78 | 78 | $bbbsession['welcome'] = $bigbluebuttonbn->welcome; |
| 79 | -if( !isset($bbbsession['welcome']) || $bbbsession['welcome'] == '') { |
|
| 79 | +if (!isset($bbbsession['welcome']) || $bbbsession['welcome'] == '') { |
|
| 80 | 80 | $bbbsession['welcome'] = get_string('mod_form_field_welcome_default', 'bigbluebuttonbn'); |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | -$bbbsession['userlimit'] = bigbluebuttonbn_get_cfg_userlimit_editable()? intval($bigbluebuttonbn->userlimit): intval(bigbluebuttonbn_get_cfg_userlimit_default()); |
|
| 84 | -$bbbsession['voicebridge'] = ($bigbluebuttonbn->voicebridge > 0)? 70000 + $bigbluebuttonbn->voicebridge: $bigbluebuttonbn->voicebridge; |
|
| 83 | +$bbbsession['userlimit'] = bigbluebuttonbn_get_cfg_userlimit_editable() ? intval($bigbluebuttonbn->userlimit) : intval(bigbluebuttonbn_get_cfg_userlimit_default()); |
|
| 84 | +$bbbsession['voicebridge'] = ($bigbluebuttonbn->voicebridge > 0) ? 70000 + $bigbluebuttonbn->voicebridge : $bigbluebuttonbn->voicebridge; |
|
| 85 | 85 | $bbbsession['wait'] = $bigbluebuttonbn->wait; |
| 86 | 86 | $bbbsession['record'] = $bigbluebuttonbn->record; |
| 87 | -if( $bigbluebuttonbn->record ) |
|
| 88 | - $bbbsession['welcome'] .= '<br><br>'.get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
|
| 87 | +if ($bigbluebuttonbn->record) |
|
| 88 | + $bbbsession['welcome'] .= '<br><br>' . get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
|
| 89 | 89 | $bbbsession['tagging'] = $bigbluebuttonbn->tagging; |
| 90 | 90 | |
| 91 | 91 | $bbbsession['openingtime'] = $bigbluebuttonbn->openingtime; |
@@ -104,29 +104,29 @@ discard block |
||
| 104 | 104 | $bbbsession['originServerName'] = $parsedUrl['host']; |
| 105 | 105 | $bbbsession['originServerUrl'] = $CFG->wwwroot; |
| 106 | 106 | $bbbsession['originServerCommonName'] = ''; |
| 107 | -$bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn ('.$module_version.')'; |
|
| 107 | +$bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn (' . $module_version . ')'; |
|
| 108 | 108 | //////////////////////////////////////////////// |
| 109 | 109 | ///// BigBlueButton Session Setup Ends ///// |
| 110 | 110 | //////////////////////////////////////////////// |
| 111 | 111 | |
| 112 | 112 | // Validates if the BigBlueButton server is running |
| 113 | 113 | $serverVersion = bigbluebuttonbn_getServerVersion($bbbsession['endpoint']); |
| 114 | -if ( !isset($serverVersion) ) { //Server is not working |
|
| 115 | - if ( $bbbsession['administrator'] ) |
|
| 116 | - print_error( 'view_error_unable_join', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
|
| 117 | - else if ( $bbbsession['moderator'] ) |
|
| 118 | - print_error( 'view_error_unable_join_teacher', 'bigbluebuttonbn', $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course ); |
|
| 114 | +if (!isset($serverVersion)) { //Server is not working |
|
| 115 | + if ($bbbsession['administrator']) |
|
| 116 | + print_error('view_error_unable_join', 'bigbluebuttonbn', $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 117 | + else if ($bbbsession['moderator']) |
|
| 118 | + print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course); |
|
| 119 | 119 | else |
| 120 | - print_error( 'view_error_unable_join_student', 'bigbluebuttonbn', $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course ); |
|
| 120 | + print_error('view_error_unable_join_student', 'bigbluebuttonbn', $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course); |
|
| 121 | 121 | } else { |
| 122 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getMeetingsURL( $bbbsession['endpoint'], $bbbsession['shared_secret'] ) ); |
|
| 123 | - if ( !isset($xml) || !isset($xml->returncode) || $xml->returncode == 'FAILED' ){ // The shared secret is wrong |
|
| 124 | - if ( $bbbsession['administrator'] ) |
|
| 125 | - print_error( 'view_error_unable_join', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
|
| 126 | - else if ( $bbbsession['moderator'] ) |
|
| 127 | - print_error( 'view_error_unable_join_teacher', 'bigbluebuttonbn', $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course ); |
|
| 122 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getMeetingsURL($bbbsession['endpoint'], $bbbsession['shared_secret'])); |
|
| 123 | + if (!isset($xml) || !isset($xml->returncode) || $xml->returncode == 'FAILED') { // The shared secret is wrong |
|
| 124 | + if ($bbbsession['administrator']) |
|
| 125 | + print_error('view_error_unable_join', 'bigbluebuttonbn', $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 126 | + else if ($bbbsession['moderator']) |
|
| 127 | + print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course); |
|
| 128 | 128 | else |
| 129 | - print_error( 'view_error_unable_join_student', 'bigbluebuttonbn', $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course ); |
|
| 129 | + print_error('view_error_unable_join_student', 'bigbluebuttonbn', $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course); |
|
| 130 | 130 | } |
| 131 | 131 | } |
| 132 | 132 | |
@@ -136,12 +136,12 @@ discard block |
||
| 136 | 136 | |
| 137 | 137 | // Print the page header |
| 138 | 138 | $PAGE->set_context($context); |
| 139 | -$PAGE->set_url($CFG->wwwroot.'/mod/bigbluebuttonbn/view.php', array('id' => $cm->id)); |
|
| 139 | +$PAGE->set_url($CFG->wwwroot . '/mod/bigbluebuttonbn/view.php', array('id' => $cm->id)); |
|
| 140 | 140 | $PAGE->set_title(format_string($bigbluebuttonbn->name)); |
| 141 | 141 | $PAGE->set_cacheable(false); |
| 142 | 142 | $PAGE->set_heading($course->fullname); |
| 143 | 143 | |
| 144 | -if( $bigbluebuttonbn->newwindow == 1 ) { |
|
| 144 | +if ($bigbluebuttonbn->newwindow == 1) { |
|
| 145 | 145 | $PAGE->blocks->show_only_fake_blocks(); |
| 146 | 146 | |
| 147 | 147 | } else { |
@@ -149,14 +149,14 @@ discard block |
||
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | // Validate if the user is in a role allowed to join |
| 152 | -if ( !has_capability('moodle/category:manage', $context) && !has_capability('mod/bigbluebuttonbn:join', $context) ) { |
|
| 152 | +if (!has_capability('moodle/category:manage', $context) && !has_capability('mod/bigbluebuttonbn:join', $context)) { |
|
| 153 | 153 | echo $OUTPUT->header(); |
| 154 | 154 | if (isguestuser()) { |
| 155 | - echo $OUTPUT->confirm('<p>'.get_string('view_noguests', 'bigbluebuttonbn').'</p>'.get_string('liketologin'), |
|
| 156 | - get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id); |
|
| 155 | + echo $OUTPUT->confirm('<p>' . get_string('view_noguests', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'), |
|
| 156 | + get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id); |
|
| 157 | 157 | } else { |
| 158 | - echo $OUTPUT->confirm('<p>'.get_string('view_nojoin', 'bigbluebuttonbn').'</p>'.get_string('liketologin'), |
|
| 159 | - get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id); |
|
| 158 | + echo $OUTPUT->confirm('<p>' . get_string('view_nojoin', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'), |
|
| 159 | + get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id); |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | echo $OUTPUT->footer(); |
@@ -164,10 +164,10 @@ discard block |
||
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | // Operation URLs |
| 167 | -$bbbsession['courseURL'] = $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course; |
|
| 168 | -$bbbsession['logoutURL'] = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=logout&id='.$id.'&bn='.$bbbsession['bigbluebuttonbn']->id; |
|
| 169 | -$bbbsession['recordingReadyURL'] = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_broker.php?action=recording_ready'; |
|
| 170 | -$bbbsession['joinURL'] = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=join&id='.$id.'&bigbluebuttonbn='.$bbbsession['bigbluebuttonbn']->id; |
|
| 167 | +$bbbsession['courseURL'] = $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course; |
|
| 168 | +$bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id=' . $id . '&bn=' . $bbbsession['bigbluebuttonbn']->id; |
|
| 169 | +$bbbsession['recordingReadyURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_broker.php?action=recording_ready'; |
|
| 170 | +$bbbsession['joinURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=join&id=' . $id . '&bigbluebuttonbn=' . $bbbsession['bigbluebuttonbn']->id; |
|
| 171 | 171 | |
| 172 | 172 | $bigbluebuttonbn_view = ''; |
| 173 | 173 | |
@@ -176,20 +176,20 @@ discard block |
||
| 176 | 176 | |
| 177 | 177 | /// find out current groups mode |
| 178 | 178 | $groupmode = groups_get_activity_groupmode($bbbsession['cm']); |
| 179 | -if ($groupmode == NOGROUPS ) { //No groups mode |
|
| 180 | - $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'.$bbbsession['bigbluebuttonbn']->id; |
|
| 179 | +if ($groupmode == NOGROUPS) { //No groups mode |
|
| 180 | + $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' . $bbbsession['bigbluebuttonbn']->id; |
|
| 181 | 181 | $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name; |
| 182 | 182 | |
| 183 | 183 | } else { // Separate or visible groups mode |
| 184 | 184 | echo $OUTPUT->box_start('generalbox boxaligncenter'); |
| 185 | - echo '<br><div class="alert alert-warning">'.get_string('view_groups_selection_warning', 'bigbluebuttonbn').'</div>'; |
|
| 185 | + echo '<br><div class="alert alert-warning">' . get_string('view_groups_selection_warning', 'bigbluebuttonbn') . '</div>'; |
|
| 186 | 186 | echo $OUTPUT->box_end(); |
| 187 | 187 | |
| 188 | 188 | $bbbsession['group'] = groups_get_activity_group($bbbsession['cm'], true); |
| 189 | - if ($groupmode == SEPARATEGROUPS ) { |
|
| 190 | - groups_print_activity_menu($cm, $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bbbsession['cm']->id, false, true); |
|
| 191 | - if( $bbbsession['group'] == 0 ) { |
|
| 192 | - if ( $bbbsession['administrator'] ) { |
|
| 189 | + if ($groupmode == SEPARATEGROUPS) { |
|
| 190 | + groups_print_activity_menu($cm, $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id, false, true); |
|
| 191 | + if ($bbbsession['group'] == 0) { |
|
| 192 | + if ($bbbsession['administrator']) { |
|
| 193 | 193 | $my_groups = groups_get_all_groups($bbbsession['course']->id); |
| 194 | 194 | } else { |
| 195 | 195 | $my_groups = groups_get_activity_allowed_groups($bbbsession['cm']); |
@@ -199,15 +199,15 @@ discard block |
||
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | } else { |
| 202 | - groups_print_activity_menu($cm, $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bbbsession['cm']->id); |
|
| 202 | + groups_print_activity_menu($cm, $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id); |
|
| 203 | 203 | } |
| 204 | 204 | |
| 205 | - $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'.$bbbsession['bigbluebuttonbn']->id.'['.$bbbsession['group'].']'; |
|
| 206 | - if( $bbbsession['group'] > 0 ) |
|
| 205 | + $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' . $bbbsession['bigbluebuttonbn']->id . '[' . $bbbsession['group'] . ']'; |
|
| 206 | + if ($bbbsession['group'] > 0) |
|
| 207 | 207 | $group_name = groups_get_group_name($bbbsession['group']); |
| 208 | 208 | else |
| 209 | 209 | $group_name = get_string('allparticipants'); |
| 210 | - $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name.' ('.$group_name.')'; |
|
| 210 | + $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name . ' (' . $group_name . ')'; |
|
| 211 | 211 | } |
| 212 | 212 | // Metadata (context) |
| 213 | 213 | $bbbsession['contextActivityName'] = $bbbsession['meetingname']; |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | $bbbsession['contextActivityTags'] = ""; |
| 216 | 216 | |
| 217 | 217 | $now = time(); |
| 218 | -if (!empty($bigbluebuttonbn->openingtime) && $now < $bigbluebuttonbn->openingtime ) { |
|
| 218 | +if (!empty($bigbluebuttonbn->openingtime) && $now < $bigbluebuttonbn->openingtime) { |
|
| 219 | 219 | //CALLING BEFORE |
| 220 | 220 | $bigbluebuttonbn_view = 'before'; |
| 221 | 221 | |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | 'action' => $bigbluebuttonbn_view, |
| 248 | 248 | 'meetingid' => $bbbsession['meetingid'], |
| 249 | 249 | 'bigbluebuttonbnid' => $bbbsession['bigbluebuttonbn']->id, |
| 250 | - 'ping_interval' => ($waitformoderator_ping_interval > 0? $waitformoderator_ping_interval * 1000: 15000), |
|
| 250 | + 'ping_interval' => ($waitformoderator_ping_interval > 0 ? $waitformoderator_ping_interval * 1000 : 15000), |
|
| 251 | 251 | 'userlimit' => $bbbsession['userlimit'], |
| 252 | 252 | 'locales' => bigbluebuttonbn_get_locales_for_ui() |
| 253 | 253 | ); |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | // Finish the page |
| 265 | 265 | echo $OUTPUT->footer(); |
| 266 | 266 | |
| 267 | -function bigbluebuttonbn_view_joining($bbbsession){ |
|
| 267 | +function bigbluebuttonbn_view_joining($bbbsession) { |
|
| 268 | 268 | global $CFG, $DB, $OUTPUT; |
| 269 | 269 | |
| 270 | 270 | echo $OUTPUT->heading($bbbsession['meetingname'], 3); |
@@ -273,29 +273,29 @@ discard block |
||
| 273 | 273 | echo '<br><span id="status_bar"></span><br>'; |
| 274 | 274 | echo '<span id="control_panel"></span>'; |
| 275 | 275 | echo $OUTPUT->box_end(); |
| 276 | - if( $bbbsession['tagging'] && ($bbbsession['administrator'] || $bbbsession['moderator']) ){ |
|
| 277 | - echo ''. |
|
| 278 | - '<div id="panelContent" class="hidden">'. |
|
| 279 | - ' <div class="yui3-widget-bd">'. |
|
| 280 | - ' <form>'. |
|
| 281 | - ' <fieldset>'. |
|
| 282 | - ' <input type="hidden" name="join" id="meeting_join_url" value="">'. |
|
| 283 | - ' <input type="hidden" name="message" id="meeting_message" value="">'. |
|
| 284 | - ' <div>'. |
|
| 285 | - ' <label for="name">'.get_string('view_recording_name', 'bigbluebuttonbn').'</label><br/>'. |
|
| 286 | - ' <input type="text" name="name" id="recording_name" placeholder="">'. |
|
| 287 | - ' </div><br>'. |
|
| 288 | - ' <div>'. |
|
| 289 | - ' <label for="description">'.get_string('view_recording_description', 'bigbluebuttonbn').'</label><br/>'. |
|
| 290 | - ' <input type="text" name="description" id="recording_description" value="" placeholder="">'. |
|
| 291 | - ' </div><br>'. |
|
| 292 | - ' <div>'. |
|
| 293 | - ' <label for="tags">'.get_string('view_recording_tags', 'bigbluebuttonbn').'</label><br/>'. |
|
| 294 | - ' <input type="text" name="tags" id="recording_tags" value="" placeholder="">'. |
|
| 295 | - ' </div>'. |
|
| 296 | - ' </fieldset>'. |
|
| 297 | - ' </form>'. |
|
| 298 | - ' </div>'. |
|
| 276 | + if ($bbbsession['tagging'] && ($bbbsession['administrator'] || $bbbsession['moderator'])) { |
|
| 277 | + echo '' . |
|
| 278 | + '<div id="panelContent" class="hidden">' . |
|
| 279 | + ' <div class="yui3-widget-bd">' . |
|
| 280 | + ' <form>' . |
|
| 281 | + ' <fieldset>' . |
|
| 282 | + ' <input type="hidden" name="join" id="meeting_join_url" value="">' . |
|
| 283 | + ' <input type="hidden" name="message" id="meeting_message" value="">' . |
|
| 284 | + ' <div>' . |
|
| 285 | + ' <label for="name">' . get_string('view_recording_name', 'bigbluebuttonbn') . '</label><br/>' . |
|
| 286 | + ' <input type="text" name="name" id="recording_name" placeholder="">' . |
|
| 287 | + ' </div><br>' . |
|
| 288 | + ' <div>' . |
|
| 289 | + ' <label for="description">' . get_string('view_recording_description', 'bigbluebuttonbn') . '</label><br/>' . |
|
| 290 | + ' <input type="text" name="description" id="recording_description" value="" placeholder="">' . |
|
| 291 | + ' </div><br>' . |
|
| 292 | + ' <div>' . |
|
| 293 | + ' <label for="tags">' . get_string('view_recording_tags', 'bigbluebuttonbn') . '</label><br/>' . |
|
| 294 | + ' <input type="text" name="tags" id="recording_tags" value="" placeholder="">' . |
|
| 295 | + ' </div>' . |
|
| 296 | + ' </fieldset>' . |
|
| 297 | + ' </form>' . |
|
| 298 | + ' </div>' . |
|
| 299 | 299 | '</div>'; |
| 300 | 300 | } |
| 301 | 301 | |
@@ -306,19 +306,19 @@ discard block |
||
| 306 | 306 | bigbluebuttonbn_view_recordings($bbbsession); |
| 307 | 307 | } |
| 308 | 308 | |
| 309 | -function bigbluebuttonbn_view_before( $bbbsession ){ |
|
| 309 | +function bigbluebuttonbn_view_before($bbbsession) { |
|
| 310 | 310 | global $CFG, $DB, $OUTPUT; |
| 311 | 311 | |
| 312 | 312 | echo $OUTPUT->heading(get_string('view_message_conference_not_started', 'bigbluebuttonbn'), 3); |
| 313 | 313 | |
| 314 | 314 | echo '<table>'; |
| 315 | 315 | if ($bbbsession['openingtime']) { |
| 316 | - echo '<tr><td class="c0">'.get_string('mod_form_field_openingtime','bigbluebuttonbn').':</td>'; |
|
| 317 | - echo ' <td class="c1">'.userdate($bbbsession['openingtime']).'</td></tr>'; |
|
| 316 | + echo '<tr><td class="c0">' . get_string('mod_form_field_openingtime', 'bigbluebuttonbn') . ':</td>'; |
|
| 317 | + echo ' <td class="c1">' . userdate($bbbsession['openingtime']) . '</td></tr>'; |
|
| 318 | 318 | } |
| 319 | 319 | if ($bbbsession['closingtime']) { |
| 320 | - echo '<tr><td class="c0">'.get_string('mod_form_field_closingtime','bigbluebuttonbn').':</td>'; |
|
| 321 | - echo ' <td class="c1">'.userdate($bbbsession['closingtime']).'</td></tr>'; |
|
| 320 | + echo '<tr><td class="c0">' . get_string('mod_form_field_closingtime', 'bigbluebuttonbn') . ':</td>'; |
|
| 321 | + echo ' <td class="c1">' . userdate($bbbsession['closingtime']) . '</td></tr>'; |
|
| 322 | 322 | } |
| 323 | 323 | echo '</table>'; |
| 324 | 324 | } |
@@ -328,13 +328,13 @@ discard block |
||
| 328 | 328 | |
| 329 | 329 | echo $OUTPUT->heading(get_string('view_message_conference_has_ended', 'bigbluebuttonbn'), 3); |
| 330 | 330 | |
| 331 | - if( !is_null($bbbsession['presentation']['url']) ) { |
|
| 331 | + if (!is_null($bbbsession['presentation']['url'])) { |
|
| 332 | 332 | $attributes = array('title' => $bbbsession['presentation']['name']); |
| 333 | 333 | $icon = new pix_icon($bbbsession['presentation']['icon'], $bbbsession['presentation']['mimetype_description']); |
| 334 | 334 | |
| 335 | - echo '<h4>'.get_string('view_section_title_presentation', 'bigbluebuttonbn').'</h4>'. |
|
| 336 | - ''.$OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false).''. |
|
| 337 | - ''.$OUTPUT->action_link($bbbsession['presentation']['url'], $bbbsession['presentation']['name'], null, $attributes).'<br><br>'; |
|
| 335 | + echo '<h4>' . get_string('view_section_title_presentation', 'bigbluebuttonbn') . '</h4>' . |
|
| 336 | + '' . $OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false) . '' . |
|
| 337 | + '' . $OUTPUT->action_link($bbbsession['presentation']['url'], $bbbsession['presentation']['name'], null, $attributes) . '<br><br>'; |
|
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | bigbluebuttonbn_view_recordings($bbbsession); |
@@ -343,10 +343,10 @@ discard block |
||
| 343 | 343 | function bigbluebuttonbn_view_recordings($bbbsession) { |
| 344 | 344 | global $CFG; |
| 345 | 345 | |
| 346 | - if( isset($bbbsession['record']) && $bbbsession['record'] ) { |
|
| 347 | - $output = html_writer::tag('h4', get_string('view_section_title_recordings', 'bigbluebuttonbn') ); |
|
| 346 | + if (isset($bbbsession['record']) && $bbbsession['record']) { |
|
| 347 | + $output = html_writer::tag('h4', get_string('view_section_title_recordings', 'bigbluebuttonbn')); |
|
| 348 | 348 | |
| 349 | - $meetingID=''; |
|
| 349 | + $meetingID = ''; |
|
| 350 | 350 | $results = bigbluebuttonbn_getRecordedMeetings($bbbsession['course']->id, $bbbsession['bigbluebuttonbn']->id); |
| 351 | 351 | |
| 352 | 352 | //if( $recordingsbn->include_deleted_activities ) { |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | // $results = array_merge($results, $results_deleted); |
| 355 | 355 | //} |
| 356 | 356 | |
| 357 | - if( $results ){ |
|
| 357 | + if ($results) { |
|
| 358 | 358 | //Eliminates duplicates |
| 359 | 359 | $mIDs = array(); |
| 360 | 360 | foreach ($results as $result) { |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | |
| 370 | 370 | // Get actual recordings |
| 371 | 371 | //$recordings = bigbluebuttonbn_getRecordingsArray($bbbsession['meetingid'], $bbbsession['endpoint'], $bbbsession['shared_secret']); |
| 372 | - if ( $meetingID != '' ) { |
|
| 372 | + if ($meetingID != '') { |
|
| 373 | 373 | $recordings = bigbluebuttonbn_getRecordingsArray($meetingID, $bbbsession['endpoint'], $bbbsession['shared_secret']); |
| 374 | 374 | } else { |
| 375 | 375 | $recordings = Array(); |
@@ -377,12 +377,12 @@ discard block |
||
| 377 | 377 | // Get recording links |
| 378 | 378 | $recordings_imported = bigbluebuttonbn_getRecordingsImportedArray($bbbsession['course']->id, $bbbsession['bigbluebuttonbn']->id); |
| 379 | 379 | // Merge the recordings |
| 380 | - $recordings = array_merge( $recordings, $recordings_imported ); |
|
| 380 | + $recordings = array_merge($recordings, $recordings_imported); |
|
| 381 | 381 | // Render the table |
| 382 | - $output .= bigbluebutton_output_recording_table($bbbsession, $recordings)."\n"; |
|
| 382 | + $output .= bigbluebutton_output_recording_table($bbbsession, $recordings) . "\n"; |
|
| 383 | 383 | |
| 384 | - if ( $bbbsession['managerecordings'] && bigbluebuttonbn_get_cfg_importrecordings_enabled() ) { |
|
| 385 | - $button_import_recordings = html_writer::tag( 'input', '', array('type' => 'button', 'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'), 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='.$bbbsession['bigbluebuttonbn']->id.'\'') ); |
|
| 384 | + if ($bbbsession['managerecordings'] && bigbluebuttonbn_get_cfg_importrecordings_enabled()) { |
|
| 385 | + $button_import_recordings = html_writer::tag('input', '', array('type' => 'button', 'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'), 'onclick' => 'window.location=\'' . $CFG->wwwroot . '/mod/bigbluebuttonbn/import_view.php?bn=' . $bbbsession['bigbluebuttonbn']->id . '\'')); |
|
| 386 | 386 | $output .= html_writer::start_tag('br'); |
| 387 | 387 | $output .= html_writer::tag('span', $button_import_recordings, ['id'=>"import_recording_links_button"]); |
| 388 | 388 | $output .= html_writer::tag('span', '', ['id'=>"import_recording_links_table"]); |
@@ -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 | } |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | switch (strtolower($action)) { |
| 50 | 50 | case 'logout': |
| 51 | 51 | if (isset($errors) && $errors != '') { |
| 52 | - bigbluebutton_bbb_view_errors($errors, $id); |
|
| 52 | + bigbluebutton_bbb_view_errors($errors, $id); |
|
| 53 | 53 | |
| 54 | 54 | } else if ( isset($bbbsession) && !is_null($bbbsession) ) { |
| 55 | 55 | /// Moodle event logger: Create an event for meeting left |
@@ -47,119 +47,119 @@ |
||
| 47 | 47 | $bbbsession = $SESSION->bigbluebuttonbn_bbbsession; |
| 48 | 48 | } |
| 49 | 49 | switch (strtolower($action)) { |
| 50 | - case 'logout': |
|
| 51 | - if (isset($errors) && $errors != '') { |
|
| 52 | - bigbluebutton_bbb_view_errors($errors, $id); |
|
| 50 | + case 'logout': |
|
| 51 | + if (isset($errors) && $errors != '') { |
|
| 52 | + bigbluebutton_bbb_view_errors($errors, $id); |
|
| 53 | 53 | |
| 54 | - } else if ( isset($bbbsession) && !is_null($bbbsession) ) { |
|
| 55 | - /// Moodle event logger: Create an event for meeting left |
|
| 56 | - bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_LEFT, $bigbluebuttonbn, $context, $cm); |
|
| 54 | + } else if ( isset($bbbsession) && !is_null($bbbsession) ) { |
|
| 55 | + /// Moodle event logger: Create an event for meeting left |
|
| 56 | + bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_LEFT, $bigbluebuttonbn, $context, $cm); |
|
| 57 | 57 | |
| 58 | - /// Update the cache |
|
| 59 | - $meeting_info = bigbluebuttonbn_bbb_broker_get_meeting_info($bbbsession['meetingid'], $bbbsession['modPW'], BIGBLUEBUTTONBN_FORCED); |
|
| 58 | + /// Update the cache |
|
| 59 | + $meeting_info = bigbluebuttonbn_bbb_broker_get_meeting_info($bbbsession['meetingid'], $bbbsession['modPW'], BIGBLUEBUTTONBN_FORCED); |
|
| 60 | 60 | |
| 61 | - /// Close the tab or window where BBB was opened |
|
| 62 | - bigbluebutton_bbb_view_close_window(); |
|
| 63 | - |
|
| 64 | - } else { |
|
| 65 | - bigbluebutton_bbb_view_close_window_manually(); |
|
| 66 | - } |
|
| 67 | - break; |
|
| 68 | - case 'join': |
|
| 69 | - if ( isset($bbbsession) && !is_null($bbbsession) ) { |
|
| 70 | - //See if the session is in progress |
|
| 71 | - if( bigbluebuttonbn_isMeetingRunning( $bbbsession['meetingid'], $bbbsession['endpoint'], $bbbsession['shared_secret'] ) ) { |
|
| 72 | - /// Since the meeting is already running, we just join the session |
|
| 73 | - bigbluebutton_bbb_view_execute_join($bbbsession, $cm, $context, $bigbluebuttonbn); |
|
| 61 | + /// Close the tab or window where BBB was opened |
|
| 62 | + bigbluebutton_bbb_view_close_window(); |
|
| 74 | 63 | |
| 75 | 64 | } else { |
| 76 | - // If user is administrator, moderator or if is viewer and no waiting is required |
|
| 77 | - if( $bbbsession['administrator'] || $bbbsession['moderator'] || !$bbbsession['wait'] ) { |
|
| 78 | - /// Prepare the metadata |
|
| 79 | - $metadata = array("meta_bn-origin" => $bbbsession['origin'], |
|
| 80 | - "meta_bbb-origin-version" => $bbbsession['originVersion'], |
|
| 81 | - "meta_bbb-origin-server-name" => $bbbsession['originServerName'], |
|
| 82 | - "meta_bbb-origin-server-common-name" => $bbbsession['originServerCommonName'], |
|
| 83 | - "meta_bbb-origin-tag" => $bbbsession['originTag'], |
|
| 84 | - "meta_bbb-context" => $bbbsession['course']->fullname, |
|
| 85 | - "meta_bbb-recording-name" => (isset($name) && $name != '')? $name: $bbbsession['contextActivityName'], |
|
| 86 | - "meta_bbb-recording-description" => (isset($description) && $description != '')? $description: $bbbsession['contextActivityDescription'], |
|
| 87 | - "meta_bbb-recording-tags" => (isset($tags) && $tags != '')? $tags: $bbbsession['contextActivityTags'], |
|
| 88 | - ); |
|
| 89 | - |
|
| 90 | - if ( bigbluebuttonbn_server_offers_bn_capabilities() && bigbluebuttonbn_get_cfg_recordingready_enabled() ) { |
|
| 91 | - $metadata["meta_bn-recording-ready-url"] = $bbbsession['recordingReadyURL']; |
|
| 92 | - } |
|
| 65 | + bigbluebutton_bbb_view_close_window_manually(); |
|
| 66 | + } |
|
| 67 | + break; |
|
| 68 | + case 'join': |
|
| 69 | + if ( isset($bbbsession) && !is_null($bbbsession) ) { |
|
| 70 | + //See if the session is in progress |
|
| 71 | + if( bigbluebuttonbn_isMeetingRunning( $bbbsession['meetingid'], $bbbsession['endpoint'], $bbbsession['shared_secret'] ) ) { |
|
| 72 | + /// Since the meeting is already running, we just join the session |
|
| 73 | + bigbluebutton_bbb_view_execute_join($bbbsession, $cm, $context, $bigbluebuttonbn); |
|
| 93 | 74 | |
| 94 | - /// Set the duration for the meeting |
|
| 95 | - if ( bigbluebuttonbn_get_cfg_scheduled_duration_enabled() ) { |
|
| 96 | - $durationtime = bigbluebuttonbn_get_duration($bigbluebuttonbn->openingtime, $bigbluebuttonbn->closingtime); |
|
| 97 | - if( $durationtime > 0 ) |
|
| 98 | - $bbbsession['welcome'] .= '<br><br>'.str_replace("%duration%", ''.$durationtime, get_string('bbbdurationwarning', 'bigbluebuttonbn')); |
|
| 99 | - } else { |
|
| 100 | - $durationtime = 0; |
|
| 101 | - } |
|
| 102 | - /// Execute the create command |
|
| 103 | - $response = bigbluebuttonbn_getCreateMeetingArray( |
|
| 104 | - $bbbsession['meetingname'], |
|
| 105 | - $bbbsession['meetingid'], |
|
| 106 | - $bbbsession['welcome'], |
|
| 107 | - $bbbsession['modPW'], |
|
| 108 | - $bbbsession['viewerPW'], |
|
| 109 | - $bbbsession['shared_secret'], |
|
| 110 | - $bbbsession['endpoint'], |
|
| 111 | - $bbbsession['logoutURL'], |
|
| 112 | - $bbbsession['record']? 'true': 'false', |
|
| 113 | - $durationtime, |
|
| 114 | - $bbbsession['voicebridge'], |
|
| 115 | - $bbbsession['userlimit'], |
|
| 116 | - $metadata, |
|
| 117 | - $bbbsession['presentation']['name'], |
|
| 118 | - $bbbsession['presentation']['url'] |
|
| 119 | - ); |
|
| 120 | - |
|
| 121 | - if (!$response) { |
|
| 122 | - // If the server is unreachable, then prompts the user of the necessary action |
|
| 123 | - if ( $bbbsession['administrator'] ) { |
|
| 124 | - print_error( 'view_error_unable_join', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
|
| 125 | - } else if ( $bbbsession['moderator'] ) { |
|
| 126 | - print_error( 'view_error_unable_join_teacher', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
|
| 127 | - } else { |
|
| 128 | - print_error( 'view_error_unable_join_student', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
|
| 75 | + } else { |
|
| 76 | + // If user is administrator, moderator or if is viewer and no waiting is required |
|
| 77 | + if( $bbbsession['administrator'] || $bbbsession['moderator'] || !$bbbsession['wait'] ) { |
|
| 78 | + /// Prepare the metadata |
|
| 79 | + $metadata = array("meta_bn-origin" => $bbbsession['origin'], |
|
| 80 | + "meta_bbb-origin-version" => $bbbsession['originVersion'], |
|
| 81 | + "meta_bbb-origin-server-name" => $bbbsession['originServerName'], |
|
| 82 | + "meta_bbb-origin-server-common-name" => $bbbsession['originServerCommonName'], |
|
| 83 | + "meta_bbb-origin-tag" => $bbbsession['originTag'], |
|
| 84 | + "meta_bbb-context" => $bbbsession['course']->fullname, |
|
| 85 | + "meta_bbb-recording-name" => (isset($name) && $name != '')? $name: $bbbsession['contextActivityName'], |
|
| 86 | + "meta_bbb-recording-description" => (isset($description) && $description != '')? $description: $bbbsession['contextActivityDescription'], |
|
| 87 | + "meta_bbb-recording-tags" => (isset($tags) && $tags != '')? $tags: $bbbsession['contextActivityTags'], |
|
| 88 | + ); |
|
| 89 | + |
|
| 90 | + if ( bigbluebuttonbn_server_offers_bn_capabilities() && bigbluebuttonbn_get_cfg_recordingready_enabled() ) { |
|
| 91 | + $metadata["meta_bn-recording-ready-url"] = $bbbsession['recordingReadyURL']; |
|
| 129 | 92 | } |
| 130 | 93 | |
| 131 | - } else if( $response['returncode'] == "FAILED" ) { |
|
| 132 | - // The meeting was not created |
|
| 133 | - $error_key = bigbluebuttonbn_get_error_key( $response['messageKey'], 'view_error_create' ); |
|
| 134 | - if( !$error_key ) { |
|
| 135 | - print_error( $response['message'], 'bigbluebuttonbn' ); |
|
| 94 | + /// Set the duration for the meeting |
|
| 95 | + if ( bigbluebuttonbn_get_cfg_scheduled_duration_enabled() ) { |
|
| 96 | + $durationtime = bigbluebuttonbn_get_duration($bigbluebuttonbn->openingtime, $bigbluebuttonbn->closingtime); |
|
| 97 | + if( $durationtime > 0 ) |
|
| 98 | + $bbbsession['welcome'] .= '<br><br>'.str_replace("%duration%", ''.$durationtime, get_string('bbbdurationwarning', 'bigbluebuttonbn')); |
|
| 136 | 99 | } else { |
| 137 | - print_error( $error_key, 'bigbluebuttonbn' ); |
|
| 100 | + $durationtime = 0; |
|
| 101 | + } |
|
| 102 | + /// Execute the create command |
|
| 103 | + $response = bigbluebuttonbn_getCreateMeetingArray( |
|
| 104 | + $bbbsession['meetingname'], |
|
| 105 | + $bbbsession['meetingid'], |
|
| 106 | + $bbbsession['welcome'], |
|
| 107 | + $bbbsession['modPW'], |
|
| 108 | + $bbbsession['viewerPW'], |
|
| 109 | + $bbbsession['shared_secret'], |
|
| 110 | + $bbbsession['endpoint'], |
|
| 111 | + $bbbsession['logoutURL'], |
|
| 112 | + $bbbsession['record']? 'true': 'false', |
|
| 113 | + $durationtime, |
|
| 114 | + $bbbsession['voicebridge'], |
|
| 115 | + $bbbsession['userlimit'], |
|
| 116 | + $metadata, |
|
| 117 | + $bbbsession['presentation']['name'], |
|
| 118 | + $bbbsession['presentation']['url'] |
|
| 119 | + ); |
|
| 120 | + |
|
| 121 | + if (!$response) { |
|
| 122 | + // If the server is unreachable, then prompts the user of the necessary action |
|
| 123 | + if ( $bbbsession['administrator'] ) { |
|
| 124 | + print_error( 'view_error_unable_join', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
|
| 125 | + } else if ( $bbbsession['moderator'] ) { |
|
| 126 | + print_error( 'view_error_unable_join_teacher', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
|
| 127 | + } else { |
|
| 128 | + print_error( 'view_error_unable_join_student', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
|
| 129 | + } |
|
| 130 | + |
|
| 131 | + } else if( $response['returncode'] == "FAILED" ) { |
|
| 132 | + // The meeting was not created |
|
| 133 | + $error_key = bigbluebuttonbn_get_error_key( $response['messageKey'], 'view_error_create' ); |
|
| 134 | + if( !$error_key ) { |
|
| 135 | + print_error( $response['message'], 'bigbluebuttonbn' ); |
|
| 136 | + } else { |
|
| 137 | + print_error( $error_key, 'bigbluebuttonbn' ); |
|
| 138 | + } |
|
| 139 | + |
|
| 140 | + } else if ($response['hasBeenForciblyEnded'] == "true"){ |
|
| 141 | + print_error( get_string( 'index_error_forciblyended', 'bigbluebuttonbn' )); |
|
| 142 | + |
|
| 143 | + } else { ///////////////Everything is ok ///////////////////// |
|
| 144 | + /// Moodle event logger: Create an event for meeting created |
|
| 145 | + bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_CREATED, $bigbluebuttonbn, $context, $cm); |
|
| 146 | + /// Internal logger: Instert a record with the meeting created |
|
| 147 | + bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_CREATE); |
|
| 148 | + /// Since the meeting is already running, we just join the session |
|
| 149 | + bigbluebutton_bbb_view_execute_join($bbbsession, $cm, $context, $bigbluebuttonbn); |
|
| 138 | 150 | } |
| 139 | 151 | |
| 140 | - } else if ($response['hasBeenForciblyEnded'] == "true"){ |
|
| 141 | - print_error( get_string( 'index_error_forciblyended', 'bigbluebuttonbn' )); |
|
| 142 | - |
|
| 143 | - } else { ///////////////Everything is ok ///////////////////// |
|
| 144 | - /// Moodle event logger: Create an event for meeting created |
|
| 145 | - bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_CREATED, $bigbluebuttonbn, $context, $cm); |
|
| 146 | - /// Internal logger: Instert a record with the meeting created |
|
| 147 | - bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_CREATE); |
|
| 148 | - /// Since the meeting is already running, we just join the session |
|
| 149 | - bigbluebutton_bbb_view_execute_join($bbbsession, $cm, $context, $bigbluebuttonbn); |
|
| 152 | + } else { |
|
| 153 | + header('Location: '.$bbbsession['logoutURL'] ); |
|
| 150 | 154 | } |
| 151 | - |
|
| 152 | - } else { |
|
| 153 | - header('Location: '.$bbbsession['logoutURL'] ); |
|
| 154 | 155 | } |
| 155 | - } |
|
| 156 | 156 | |
| 157 | - } else { |
|
| 158 | - print_error( 'view_error_unable_join', 'bigbluebuttonbn' ); |
|
| 159 | - } |
|
| 160 | - break; |
|
| 161 | - default: |
|
| 162 | - bigbluebutton_bbb_view_close_window(); |
|
| 157 | + } else { |
|
| 158 | + print_error( 'view_error_unable_join', 'bigbluebuttonbn' ); |
|
| 159 | + } |
|
| 160 | + break; |
|
| 161 | + default: |
|
| 162 | + bigbluebutton_bbb_view_close_window(); |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | |
@@ -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); |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | require_login($course, true, $cm); |
| 45 | 45 | |
| 46 | -if ( isset($SESSION) && isset($SESSION->bigbluebuttonbn_bbbsession)) { |
|
| 46 | +if (isset($SESSION) && isset($SESSION->bigbluebuttonbn_bbbsession)) { |
|
| 47 | 47 | $bbbsession = $SESSION->bigbluebuttonbn_bbbsession; |
| 48 | 48 | } |
| 49 | 49 | switch (strtolower($action)) { |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | if (isset($errors) && $errors != '') { |
| 52 | 52 | bigbluebutton_bbb_view_errors($errors, $id); |
| 53 | 53 | |
| 54 | - } else if ( isset($bbbsession) && !is_null($bbbsession) ) { |
|
| 54 | + } else if (isset($bbbsession) && !is_null($bbbsession)) { |
|
| 55 | 55 | /// Moodle event logger: Create an event for meeting left |
| 56 | 56 | bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_LEFT, $bigbluebuttonbn, $context, $cm); |
| 57 | 57 | |
@@ -66,15 +66,15 @@ discard block |
||
| 66 | 66 | } |
| 67 | 67 | break; |
| 68 | 68 | case 'join': |
| 69 | - if ( isset($bbbsession) && !is_null($bbbsession) ) { |
|
| 69 | + if (isset($bbbsession) && !is_null($bbbsession)) { |
|
| 70 | 70 | //See if the session is in progress |
| 71 | - if( bigbluebuttonbn_isMeetingRunning( $bbbsession['meetingid'], $bbbsession['endpoint'], $bbbsession['shared_secret'] ) ) { |
|
| 71 | + if (bigbluebuttonbn_isMeetingRunning($bbbsession['meetingid'], $bbbsession['endpoint'], $bbbsession['shared_secret'])) { |
|
| 72 | 72 | /// Since the meeting is already running, we just join the session |
| 73 | 73 | bigbluebutton_bbb_view_execute_join($bbbsession, $cm, $context, $bigbluebuttonbn); |
| 74 | 74 | |
| 75 | 75 | } else { |
| 76 | 76 | // If user is administrator, moderator or if is viewer and no waiting is required |
| 77 | - if( $bbbsession['administrator'] || $bbbsession['moderator'] || !$bbbsession['wait'] ) { |
|
| 77 | + if ($bbbsession['administrator'] || $bbbsession['moderator'] || !$bbbsession['wait']) { |
|
| 78 | 78 | /// Prepare the metadata |
| 79 | 79 | $metadata = array("meta_bn-origin" => $bbbsession['origin'], |
| 80 | 80 | "meta_bbb-origin-version" => $bbbsession['originVersion'], |
@@ -82,20 +82,20 @@ discard block |
||
| 82 | 82 | "meta_bbb-origin-server-common-name" => $bbbsession['originServerCommonName'], |
| 83 | 83 | "meta_bbb-origin-tag" => $bbbsession['originTag'], |
| 84 | 84 | "meta_bbb-context" => $bbbsession['course']->fullname, |
| 85 | - "meta_bbb-recording-name" => (isset($name) && $name != '')? $name: $bbbsession['contextActivityName'], |
|
| 86 | - "meta_bbb-recording-description" => (isset($description) && $description != '')? $description: $bbbsession['contextActivityDescription'], |
|
| 87 | - "meta_bbb-recording-tags" => (isset($tags) && $tags != '')? $tags: $bbbsession['contextActivityTags'], |
|
| 85 | + "meta_bbb-recording-name" => (isset($name) && $name != '') ? $name : $bbbsession['contextActivityName'], |
|
| 86 | + "meta_bbb-recording-description" => (isset($description) && $description != '') ? $description : $bbbsession['contextActivityDescription'], |
|
| 87 | + "meta_bbb-recording-tags" => (isset($tags) && $tags != '') ? $tags : $bbbsession['contextActivityTags'], |
|
| 88 | 88 | ); |
| 89 | 89 | |
| 90 | - if ( bigbluebuttonbn_server_offers_bn_capabilities() && bigbluebuttonbn_get_cfg_recordingready_enabled() ) { |
|
| 90 | + if (bigbluebuttonbn_server_offers_bn_capabilities() && bigbluebuttonbn_get_cfg_recordingready_enabled()) { |
|
| 91 | 91 | $metadata["meta_bn-recording-ready-url"] = $bbbsession['recordingReadyURL']; |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | /// Set the duration for the meeting |
| 95 | - if ( bigbluebuttonbn_get_cfg_scheduled_duration_enabled() ) { |
|
| 95 | + if (bigbluebuttonbn_get_cfg_scheduled_duration_enabled()) { |
|
| 96 | 96 | $durationtime = bigbluebuttonbn_get_duration($bigbluebuttonbn->openingtime, $bigbluebuttonbn->closingtime); |
| 97 | - if( $durationtime > 0 ) |
|
| 98 | - $bbbsession['welcome'] .= '<br><br>'.str_replace("%duration%", ''.$durationtime, get_string('bbbdurationwarning', 'bigbluebuttonbn')); |
|
| 97 | + if ($durationtime > 0) |
|
| 98 | + $bbbsession['welcome'] .= '<br><br>' . str_replace("%duration%", '' . $durationtime, get_string('bbbdurationwarning', 'bigbluebuttonbn')); |
|
| 99 | 99 | } else { |
| 100 | 100 | $durationtime = 0; |
| 101 | 101 | } |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | $bbbsession['shared_secret'], |
| 110 | 110 | $bbbsession['endpoint'], |
| 111 | 111 | $bbbsession['logoutURL'], |
| 112 | - $bbbsession['record']? 'true': 'false', |
|
| 112 | + $bbbsession['record'] ? 'true' : 'false', |
|
| 113 | 113 | $durationtime, |
| 114 | 114 | $bbbsession['voicebridge'], |
| 115 | 115 | $bbbsession['userlimit'], |
@@ -120,25 +120,25 @@ discard block |
||
| 120 | 120 | |
| 121 | 121 | if (!$response) { |
| 122 | 122 | // If the server is unreachable, then prompts the user of the necessary action |
| 123 | - if ( $bbbsession['administrator'] ) { |
|
| 124 | - print_error( 'view_error_unable_join', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
|
| 125 | - } else if ( $bbbsession['moderator'] ) { |
|
| 126 | - print_error( 'view_error_unable_join_teacher', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
|
| 123 | + if ($bbbsession['administrator']) { |
|
| 124 | + print_error('view_error_unable_join', 'bigbluebuttonbn', $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 125 | + } else if ($bbbsession['moderator']) { |
|
| 126 | + print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 127 | 127 | } else { |
| 128 | - print_error( 'view_error_unable_join_student', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
|
| 128 | + print_error('view_error_unable_join_student', 'bigbluebuttonbn', $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | - } else if( $response['returncode'] == "FAILED" ) { |
|
| 131 | + } else if ($response['returncode'] == "FAILED") { |
|
| 132 | 132 | // The meeting was not created |
| 133 | - $error_key = bigbluebuttonbn_get_error_key( $response['messageKey'], 'view_error_create' ); |
|
| 134 | - if( !$error_key ) { |
|
| 135 | - print_error( $response['message'], 'bigbluebuttonbn' ); |
|
| 133 | + $error_key = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create'); |
|
| 134 | + if (!$error_key) { |
|
| 135 | + print_error($response['message'], 'bigbluebuttonbn'); |
|
| 136 | 136 | } else { |
| 137 | - print_error( $error_key, 'bigbluebuttonbn' ); |
|
| 137 | + print_error($error_key, 'bigbluebuttonbn'); |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | - } else if ($response['hasBeenForciblyEnded'] == "true"){ |
|
| 141 | - print_error( get_string( 'index_error_forciblyended', 'bigbluebuttonbn' )); |
|
| 140 | + } else if ($response['hasBeenForciblyEnded'] == "true") { |
|
| 141 | + print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn')); |
|
| 142 | 142 | |
| 143 | 143 | } else { ///////////////Everything is ok ///////////////////// |
| 144 | 144 | /// Moodle event logger: Create an event for meeting created |
@@ -150,12 +150,12 @@ discard block |
||
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | } else { |
| 153 | - header('Location: '.$bbbsession['logoutURL'] ); |
|
| 153 | + header('Location: ' . $bbbsession['logoutURL']); |
|
| 154 | 154 | } |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | } else { |
| 158 | - print_error( 'view_error_unable_join', 'bigbluebuttonbn' ); |
|
| 158 | + print_error('view_error_unable_join', 'bigbluebuttonbn'); |
|
| 159 | 159 | } |
| 160 | 160 | break; |
| 161 | 161 | default: |
@@ -179,9 +179,9 @@ discard block |
||
| 179 | 179 | function bigbluebutton_bbb_view_execute_join($bbbsession, $cm, $context, $bigbluebuttonbn) { |
| 180 | 180 | //// Update the cache |
| 181 | 181 | $meeting_info = bigbluebuttonbn_bbb_broker_get_meeting_info($bbbsession['meetingid'], $bbbsession['modPW'], true); |
| 182 | - if( $bbbsession['userlimit'] == 0 || intval($meeting_info['participantCount']) < $bbbsession['userlimit'] ) { |
|
| 182 | + if ($bbbsession['userlimit'] == 0 || intval($meeting_info['participantCount']) < $bbbsession['userlimit']) { |
|
| 183 | 183 | //// Build the URL |
| 184 | - if( $bbbsession['administrator'] || $bbbsession['moderator'] ) { |
|
| 184 | + if ($bbbsession['administrator'] || $bbbsession['moderator']) { |
|
| 185 | 185 | $password = $bbbsession['modPW']; |
| 186 | 186 | } else { |
| 187 | 187 | $password = $bbbsession['viewerPW']; |
@@ -192,25 +192,25 @@ discard block |
||
| 192 | 192 | /// Internal logger: Instert a record with the meeting created |
| 193 | 193 | bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_JOIN); |
| 194 | 194 | //// Before executing the redirect, increment the number of participants |
| 195 | - bigbluebuttonbn_bbb_broker_participant_joined($bbbsession['meetingid'], ($bbbsession['administrator'] || $bbbsession['moderator']) ); |
|
| 195 | + bigbluebuttonbn_bbb_broker_participant_joined($bbbsession['meetingid'], ($bbbsession['administrator'] || $bbbsession['moderator'])); |
|
| 196 | 196 | //// Execute the redirect |
| 197 | - header('Location: '.$join_url ); |
|
| 197 | + header('Location: ' . $join_url); |
|
| 198 | 198 | |
| 199 | 199 | } else { |
| 200 | - header('Location: '.$bbbsession['logoutURL'] ); |
|
| 200 | + header('Location: ' . $bbbsession['logoutURL']); |
|
| 201 | 201 | } |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | function bigbluebutton_bbb_view_errors($sErrors, $id) { |
| 205 | 205 | global $CFG, $OUTPUT, $PAGE; |
| 206 | 206 | |
| 207 | - $errors = (array) json_decode(urldecode($sErrors)); |
|
| 207 | + $errors = (array)json_decode(urldecode($sErrors)); |
|
| 208 | 208 | $msgErrors = ""; |
| 209 | 209 | foreach ($errors as $error) { |
| 210 | 210 | $msgErrors .= html_writer::tag('p', $error->{"message"}, array('class' => 'alert alert-danger')) . "\n"; |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | echo $OUTPUT->header(); |
| 214 | - print_error( 'view_error_bigbluebutton', 'bigbluebuttonbn', $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$id, $msgErrors, $sErrors ); |
|
| 214 | + print_error('view_error_bigbluebutton', 'bigbluebuttonbn', $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $id, $msgErrors, $sErrors); |
|
| 215 | 215 | echo $OUTPUT->footer(); |
| 216 | 216 | } |
@@ -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 |
@@ -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); |
@@ -189,6 +189,9 @@ discard block |
||
| 189 | 189 | return $xml; |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | +/** |
|
| 193 | + * @param string $meetingID |
|
| 194 | + */ |
|
| 192 | 195 | function bigbluebuttonbn_getMeetingInfoArray( $meetingID, $modPW, $URL, $SALT ) { |
| 193 | 196 | $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getMeetingInfoURL( $meetingID, $modPW, $URL, $SALT ) ); |
| 194 | 197 | |
@@ -206,6 +209,9 @@ discard block |
||
| 206 | 209 | } |
| 207 | 210 | } |
| 208 | 211 | |
| 212 | +/** |
|
| 213 | + * @param string $meetingIDs |
|
| 214 | + */ |
|
| 209 | 215 | function bigbluebuttonbn_getRecordingsArray( $meetingIDs, $URL, $SALT ) { |
| 210 | 216 | $recordings = array(); |
| 211 | 217 | |
@@ -287,6 +293,10 @@ discard block |
||
| 287 | 293 | else return 1; |
| 288 | 294 | } |
| 289 | 295 | |
| 296 | +/** |
|
| 297 | + * @param string $URL |
|
| 298 | + * @param string $SALT |
|
| 299 | + */ |
|
| 290 | 300 | function bigbluebuttonbn_doDeleteRecordings( $recordIDs, $URL, $SALT ) { |
| 291 | 301 | $ids = explode(",", $recordIDs); |
| 292 | 302 | foreach( $ids as $id){ |
@@ -297,6 +307,11 @@ discard block |
||
| 297 | 307 | return true; |
| 298 | 308 | } |
| 299 | 309 | |
| 310 | +/** |
|
| 311 | + * @param string $set |
|
| 312 | + * @param string $URL |
|
| 313 | + * @param string $SALT |
|
| 314 | + */ |
|
| 300 | 315 | function bigbluebuttonbn_doPublishRecordings( $recordIDs, $set, $URL, $SALT ) { |
| 301 | 316 | $ids = explode(",", $recordIDs); |
| 302 | 317 | foreach( $ids as $id){ |
@@ -307,6 +322,10 @@ discard block |
||
| 307 | 322 | return true; |
| 308 | 323 | } |
| 309 | 324 | |
| 325 | +/** |
|
| 326 | + * @param string $URL |
|
| 327 | + * @param string $SALT |
|
| 328 | + */ |
|
| 310 | 329 | function bigbluebuttonbn_doEndMeeting( $meetingID, $modPW, $URL, $SALT ) { |
| 311 | 330 | $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getEndMeetingURL( $meetingID, $modPW, $URL, $SALT ) ); |
| 312 | 331 | |
@@ -328,6 +347,9 @@ discard block |
||
| 328 | 347 | } |
| 329 | 348 | |
| 330 | 349 | |
| 350 | +/** |
|
| 351 | + * @param string $URL |
|
| 352 | + */ |
|
| 331 | 353 | function bigbluebuttonbn_getServerVersion( $URL ){ |
| 332 | 354 | $xml = bigbluebuttonbn_wrap_xml_load_file( $URL."api" ); |
| 333 | 355 | if ( $xml && $xml->returncode == 'SUCCESS' ) { |
@@ -346,6 +368,9 @@ discard block |
||
| 346 | 368 | } |
| 347 | 369 | } |
| 348 | 370 | |
| 371 | +/** |
|
| 372 | + * @param string $url |
|
| 373 | + */ |
|
| 349 | 374 | function bigbluebuttonbn_wrap_xml_load_file($url, $method=BIGBLUEBUTTONBN_METHOD_GET, $data=null) { |
| 350 | 375 | if ( bigbluebuttonbn_debugdisplay() ) error_log("Request to: ".$url); |
| 351 | 376 | |
@@ -781,6 +806,9 @@ discard block |
||
| 781 | 806 | $cache = cache::make_from_params(cache_store::MODE_APPLICATION, 'mod_bigbluebuttonbn', 'meetings_cache'); |
| 782 | 807 | } |
| 783 | 808 | |
| 809 | +/** |
|
| 810 | + * @param boolean $is_moderator |
|
| 811 | + */ |
|
| 784 | 812 | function bigbluebuttonbn_bbb_broker_participant_joined($meetingid, $is_moderator) { |
| 785 | 813 | $cache = cache::make_from_params(cache_store::MODE_APPLICATION, 'mod_bigbluebuttonbn', 'meetings_cache'); |
| 786 | 814 | $result = $cache->get($meetingid); |
@@ -1365,6 +1393,9 @@ discard block |
||
| 1365 | 1393 | return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingready_enabled)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingready_enabled: (isset($CFG->bigbluebuttonbn_recordingready_enabled)? $CFG->bigbluebuttonbn_recordingready_enabled: false)); |
| 1366 | 1394 | } |
| 1367 | 1395 | |
| 1396 | +/** |
|
| 1397 | + * @return string |
|
| 1398 | + */ |
|
| 1368 | 1399 | function bigbluebuttonbn_get_cfg_moderator_default() { |
| 1369 | 1400 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1370 | 1401 | return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_moderator_default)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_moderator_default: (isset($CFG->bigbluebuttonbn_moderator_default)? $CFG->bigbluebuttonbn_moderator_default: 'owner')); |
@@ -69,19 +69,23 @@ discard block |
||
| 69 | 69 | $params = 'name='.urlencode($name).'&meetingID='.urlencode($meetingID).'&attendeePW='.urlencode($attendeePW).'&moderatorPW='.urlencode($moderatorPW).'&logoutURL='.urlencode($logoutURL).'&record='.$record; |
| 70 | 70 | |
| 71 | 71 | $voiceBridge = intval($voiceBridge); |
| 72 | - if ( $voiceBridge > 0 && $voiceBridge < 79999) |
|
| 73 | - $params .= '&voiceBridge='.$voiceBridge; |
|
| 72 | + if ( $voiceBridge > 0 && $voiceBridge < 79999) { |
|
| 73 | + $params .= '&voiceBridge='.$voiceBridge; |
|
| 74 | + } |
|
| 74 | 75 | |
| 75 | 76 | $duration = intval($duration); |
| 76 | - if( $duration > 0 ) |
|
| 77 | - $params .= '&duration='.$duration; |
|
| 77 | + if( $duration > 0 ) { |
|
| 78 | + $params .= '&duration='.$duration; |
|
| 79 | + } |
|
| 78 | 80 | |
| 79 | 81 | $maxParticipants = intval($maxParticipants); |
| 80 | - if( $maxParticipants > 0 ) |
|
| 81 | - $params .= '&maxParticipants='.$maxParticipants; |
|
| 82 | + if( $maxParticipants > 0 ) { |
|
| 83 | + $params .= '&maxParticipants='.$maxParticipants; |
|
| 84 | + } |
|
| 82 | 85 | |
| 83 | - if( trim( $welcome ) ) |
|
| 84 | - $params .= '&welcome='.urlencode($welcome); |
|
| 86 | + if( trim( $welcome ) ) { |
|
| 87 | + $params .= '&welcome='.urlencode($welcome); |
|
| 88 | + } |
|
| 85 | 89 | |
| 86 | 90 | foreach ($metadata as $key => $value) { |
| 87 | 91 | $params .= '&'.$key.'='.urlencode($value); |
@@ -155,10 +159,11 @@ discard block |
||
| 155 | 159 | } |
| 156 | 160 | |
| 157 | 161 | if ( $xml ) { |
| 158 | - if ($xml->meetingID) |
|
| 159 | - return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey, 'meetingID' => $xml->meetingID, 'attendeePW' => $xml->attendeePW, 'moderatorPW' => $xml->moderatorPW, 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded ); |
|
| 160 | - else |
|
| 161 | - return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey ); |
|
| 162 | + if ($xml->meetingID) { |
|
| 163 | + return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey, 'meetingID' => $xml->meetingID, 'attendeePW' => $xml->attendeePW, 'moderatorPW' => $xml->moderatorPW, 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded ); |
|
| 164 | + } else { |
|
| 165 | + return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey ); |
|
| 166 | + } |
|
| 162 | 167 | } else { |
| 163 | 168 | return null; |
| 164 | 169 | } |
@@ -267,7 +272,9 @@ discard block |
||
| 267 | 272 | $metadataArray = array(); |
| 268 | 273 | $metadata = get_object_vars($recording->metadata); |
| 269 | 274 | foreach ( $metadata as $key => $value ) { |
| 270 | - if ( is_object($value) ) $value = ''; |
|
| 275 | + if ( is_object($value) ) { |
|
| 276 | + $value = ''; |
|
| 277 | + } |
|
| 271 | 278 | $metadataArray['meta_'.$key] = $value; |
| 272 | 279 | } |
| 273 | 280 | |
@@ -277,17 +284,22 @@ discard block |
||
| 277 | 284 | } |
| 278 | 285 | |
| 279 | 286 | function bigbluebuttonbn_recordingBuildSorter($a, $b){ |
| 280 | - if( $a['startTime'] < $b['startTime']) return -1; |
|
| 281 | - else if( $a['startTime'] == $b['startTime']) return 0; |
|
| 282 | - else return 1; |
|
| 283 | -} |
|
| 287 | + if( $a['startTime'] < $b['startTime']) { |
|
| 288 | + return -1; |
|
| 289 | + } else if( $a['startTime'] == $b['startTime']) { |
|
| 290 | + return 0; |
|
| 291 | + } else { |
|
| 292 | + return 1; |
|
| 293 | + } |
|
| 294 | + } |
|
| 284 | 295 | |
| 285 | 296 | function bigbluebuttonbn_doDeleteRecordings( $recordIDs, $URL, $SALT ) { |
| 286 | 297 | $ids = explode(",", $recordIDs); |
| 287 | 298 | foreach( $ids as $id){ |
| 288 | 299 | $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getDeleteRecordingsURL($id, $URL, $SALT) ); |
| 289 | - if( $xml && $xml->returncode != 'SUCCESS' ) |
|
| 290 | - return false; |
|
| 300 | + if( $xml && $xml->returncode != 'SUCCESS' ) { |
|
| 301 | + return false; |
|
| 302 | + } |
|
| 291 | 303 | } |
| 292 | 304 | return true; |
| 293 | 305 | } |
@@ -296,8 +308,9 @@ discard block |
||
| 296 | 308 | $ids = explode(",", $recordIDs); |
| 297 | 309 | foreach( $ids as $id){ |
| 298 | 310 | $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getPublishRecordingsURL($id, $set, $URL, $SALT) ); |
| 299 | - if( $xml && $xml->returncode != 'SUCCESS' ) |
|
| 300 | - return false; |
|
| 311 | + if( $xml && $xml->returncode != 'SUCCESS' ) { |
|
| 312 | + return false; |
|
| 313 | + } |
|
| 301 | 314 | } |
| 302 | 315 | return true; |
| 303 | 316 | } |
@@ -307,8 +320,7 @@ discard block |
||
| 307 | 320 | |
| 308 | 321 | if( $xml ) { //If the xml packet returned failure it displays the message to the user |
| 309 | 322 | return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); |
| 310 | - } |
|
| 311 | - else { //If the server is unreachable, then prompts the user of the necessary action |
|
| 323 | + } else { //If the server is unreachable, then prompts the user of the necessary action |
|
| 312 | 324 | return null; |
| 313 | 325 | } |
| 314 | 326 | } |
@@ -342,7 +354,9 @@ discard block |
||
| 342 | 354 | } |
| 343 | 355 | |
| 344 | 356 | function bigbluebuttonbn_wrap_xml_load_file($url, $method=BIGBLUEBUTTONBN_METHOD_GET, $data=null) { |
| 345 | - if ( bigbluebuttonbn_debugdisplay() ) error_log("Request to: ".$url); |
|
| 357 | + if ( bigbluebuttonbn_debugdisplay() ) { |
|
| 358 | + error_log("Request to: ".$url); |
|
| 359 | + } |
|
| 346 | 360 | |
| 347 | 361 | if (extension_loaded('curl')) { |
| 348 | 362 | $c = new curl(); |
@@ -530,8 +544,9 @@ discard block |
||
| 530 | 544 | // Iterate looking for all configuration |
| 531 | 545 | foreach($participant_list as $participant){ |
| 532 | 546 | if( $participant->selectiontype == 'all' ) { |
| 533 | - if ( $participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR ) |
|
| 534 | - return true; |
|
| 547 | + if ( $participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR ) { |
|
| 548 | + return true; |
|
| 549 | + } |
|
| 535 | 550 | } |
| 536 | 551 | } |
| 537 | 552 | |
@@ -542,8 +557,9 @@ discard block |
||
| 542 | 557 | foreach( $roles as $role ) { |
| 543 | 558 | $db_moodle_role = bigbluebuttonbn_moodle_db_role_lookup($db_moodle_roles, $role->roleid); |
| 544 | 559 | if( $participant->selectionid == $db_moodle_role->shortname ) { |
| 545 | - if ( $participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR ) |
|
| 546 | - return true; |
|
| 560 | + if ( $participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR ) { |
|
| 561 | + return true; |
|
| 562 | + } |
|
| 547 | 563 | } |
| 548 | 564 | } |
| 549 | 565 | } |
@@ -553,8 +569,9 @@ discard block |
||
| 553 | 569 | foreach($participant_list as $participant){ |
| 554 | 570 | if( $participant->selectiontype == 'user' ) { |
| 555 | 571 | if( $participant->selectionid == $user ) { |
| 556 | - if ( $participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR ) |
|
| 557 | - return true; |
|
| 572 | + if ( $participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR ) { |
|
| 573 | + return true; |
|
| 574 | + } |
|
| 558 | 575 | } |
| 559 | 576 | } |
| 560 | 577 | } |
@@ -588,7 +605,9 @@ discard block |
||
| 588 | 605 | if( $voicebridge != 0 ) { |
| 589 | 606 | $table = "bigbluebuttonbn"; |
| 590 | 607 | $select = "voicebridge = ".$voicebridge; |
| 591 | - if( $id ) $select .= " AND id <> ".$id; |
|
| 608 | + if( $id ) { |
|
| 609 | + $select .= " AND id <> ".$id; |
|
| 610 | + } |
|
| 592 | 611 | if ( $rooms = $DB->get_records_select($table, $select) ) { |
| 593 | 612 | $is_unique = false; |
| 594 | 613 | } |
@@ -924,7 +943,9 @@ discard block |
||
| 924 | 943 | $error = $org_msg; |
| 925 | 944 | |
| 926 | 945 | if( !empty($new_msg) ) { |
| 927 | - if( !empty($error) ) $error .= ' '; |
|
| 946 | + if( !empty($error) ) { |
|
| 947 | + $error .= ' '; |
|
| 948 | + } |
|
| 928 | 949 | $error .= $new_msg; |
| 929 | 950 | } |
| 930 | 951 | |
@@ -1208,8 +1229,9 @@ discard block |
||
| 1208 | 1229 | $capabilities = bigbluebuttonbn_getCapabilitiesArray( $endpoint, $shared_secret ); |
| 1209 | 1230 | if( $capabilities ) { |
| 1210 | 1231 | foreach ($capabilities as $capability) { |
| 1211 | - if( $capability["name"] == $capability_name) |
|
| 1212 | - $capability_offered = $capability; |
|
| 1232 | + if( $capability["name"] == $capability_name) { |
|
| 1233 | + $capability_offered = $capability; |
|
| 1234 | + } |
|
| 1213 | 1235 | } |
| 1214 | 1236 | } |
| 1215 | 1237 | } |
@@ -1513,7 +1535,9 @@ discard block |
||
| 1513 | 1535 | } |
| 1514 | 1536 | //Generates the meetingID string |
| 1515 | 1537 | foreach ($mIDs as $mID) { |
| 1516 | - if (strlen($meetingID) > 0) $meetingID .= ','; |
|
| 1538 | + if (strlen($meetingID) > 0) { |
|
| 1539 | + $meetingID .= ','; |
|
| 1540 | + } |
|
| 1517 | 1541 | $meetingID .= $mID; |
| 1518 | 1542 | } |
| 1519 | 1543 | } |
@@ -1611,9 +1635,10 @@ discard block |
||
| 1611 | 1635 | function bigbluebuttonbn_html2text($html, $len) { |
| 1612 | 1636 | $text = strip_tags($html); |
| 1613 | 1637 | $text = str_replace(" ", ' ', $text); |
| 1614 | - if( strlen($text) > $len ) |
|
| 1615 | - $text = substr($text, 0, $len)."..."; |
|
| 1616 | - else |
|
| 1617 | - $text = substr($text, 0, $len); |
|
| 1638 | + if( strlen($text) > $len ) { |
|
| 1639 | + $text = substr($text, 0, $len)."..."; |
|
| 1640 | + } else { |
|
| 1641 | + $text = substr($text, 0, $len); |
|
| 1642 | + } |
|
| 1618 | 1643 | return $text; |
| 1619 | 1644 | } |
| 1620 | 1645 | \ No newline at end of file |
@@ -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 | |
@@ -33,21 +33,21 @@ discard block |
||
| 33 | 33 | const BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED = 'recording_published'; |
| 34 | 34 | const BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED = 'recording_unpublished'; |
| 35 | 35 | |
| 36 | -function bigbluebuttonbn_logs(array $bbbsession, $event, array $overrides = [], $meta = NULL ) { |
|
| 36 | +function bigbluebuttonbn_logs(array $bbbsession, $event, array $overrides = [], $meta = NULL) { |
|
| 37 | 37 | global $DB; |
| 38 | 38 | |
| 39 | 39 | $log = new stdClass(); |
| 40 | 40 | |
| 41 | - $log->courseid = isset($overrides['courseid'])? $overrides['courseid']: $bbbsession['course']->id; |
|
| 42 | - $log->bigbluebuttonbnid = isset($overrides['bigbluebuttonbnid'])? $overrides['bigbluebuttonbnid']: $bbbsession['bigbluebuttonbn']->id; |
|
| 43 | - $log->userid = isset($overrides['userid'])? $overrides['userid']: $bbbsession['userID']; |
|
| 44 | - $log->meetingid = isset($overrides['meetingid'])? $overrides['meetingid']: $bbbsession['meetingid']; |
|
| 45 | - $log->timecreated = isset($overrides['timecreated'])? $overrides['timecreated']: time(); |
|
| 41 | + $log->courseid = isset($overrides['courseid']) ? $overrides['courseid'] : $bbbsession['course']->id; |
|
| 42 | + $log->bigbluebuttonbnid = isset($overrides['bigbluebuttonbnid']) ? $overrides['bigbluebuttonbnid'] : $bbbsession['bigbluebuttonbn']->id; |
|
| 43 | + $log->userid = isset($overrides['userid']) ? $overrides['userid'] : $bbbsession['userID']; |
|
| 44 | + $log->meetingid = isset($overrides['meetingid']) ? $overrides['meetingid'] : $bbbsession['meetingid']; |
|
| 45 | + $log->timecreated = isset($overrides['timecreated']) ? $overrides['timecreated'] : time(); |
|
| 46 | 46 | $log->log = $event; |
| 47 | - if ( isset($meta) ) { |
|
| 47 | + if (isset($meta)) { |
|
| 48 | 48 | $log->meta = $meta; |
| 49 | - } else if( $event == BIGBLUEBUTTONBN_LOG_EVENT_CREATE) { |
|
| 50 | - $log->meta = '{"record":'.($bbbsession['record']? 'true': 'false').'}'; |
|
| 49 | + } else if ($event == BIGBLUEBUTTONBN_LOG_EVENT_CREATE) { |
|
| 50 | + $log->meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}'; |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | $returnid = $DB->insert_record('bigbluebuttonbn_logs', $log); |
@@ -56,127 +56,127 @@ discard block |
||
| 56 | 56 | //////////////////////////// |
| 57 | 57 | // BigBlueButton API Calls // |
| 58 | 58 | //////////////////////////// |
| 59 | -function bigbluebuttonbn_getJoinURL( $meetingID, $userName, $PW, $SALT, $URL, $logoutURL ) { |
|
| 60 | - $url_join = $URL."api/join?"; |
|
| 61 | - $params = 'meetingID='.urlencode($meetingID).'&fullName='.urlencode($userName).'&password='.urlencode($PW).'&logoutURL='.urlencode($logoutURL); |
|
| 62 | - $url = $url_join.$params.'&checksum='.sha1("join".$params.$SALT); |
|
| 59 | +function bigbluebuttonbn_getJoinURL($meetingID, $userName, $PW, $SALT, $URL, $logoutURL) { |
|
| 60 | + $url_join = $URL . "api/join?"; |
|
| 61 | + $params = 'meetingID=' . urlencode($meetingID) . '&fullName=' . urlencode($userName) . '&password=' . urlencode($PW) . '&logoutURL=' . urlencode($logoutURL); |
|
| 62 | + $url = $url_join . $params . '&checksum=' . sha1("join" . $params . $SALT); |
|
| 63 | 63 | return $url; |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | -function bigbluebuttonbn_getCreateMeetingURL($name, $meetingID, $attendeePW, $moderatorPW, $welcome, $logoutURL, $SALT, $URL, $record = 'false', $duration=0, $voiceBridge=0, $maxParticipants=0, $metadata=array() ) { |
|
| 67 | - $url_create = $URL."api/create?"; |
|
| 66 | +function bigbluebuttonbn_getCreateMeetingURL($name, $meetingID, $attendeePW, $moderatorPW, $welcome, $logoutURL, $SALT, $URL, $record = 'false', $duration = 0, $voiceBridge = 0, $maxParticipants = 0, $metadata = array()) { |
|
| 67 | + $url_create = $URL . "api/create?"; |
|
| 68 | 68 | |
| 69 | - $params = 'name='.urlencode($name).'&meetingID='.urlencode($meetingID).'&attendeePW='.urlencode($attendeePW).'&moderatorPW='.urlencode($moderatorPW).'&logoutURL='.urlencode($logoutURL).'&record='.$record; |
|
| 69 | + $params = 'name=' . urlencode($name) . '&meetingID=' . urlencode($meetingID) . '&attendeePW=' . urlencode($attendeePW) . '&moderatorPW=' . urlencode($moderatorPW) . '&logoutURL=' . urlencode($logoutURL) . '&record=' . $record; |
|
| 70 | 70 | |
| 71 | 71 | $voiceBridge = intval($voiceBridge); |
| 72 | - if ( $voiceBridge > 0 && $voiceBridge < 79999) |
|
| 73 | - $params .= '&voiceBridge='.$voiceBridge; |
|
| 72 | + if ($voiceBridge > 0 && $voiceBridge < 79999) |
|
| 73 | + $params .= '&voiceBridge=' . $voiceBridge; |
|
| 74 | 74 | |
| 75 | 75 | $duration = intval($duration); |
| 76 | - if( $duration > 0 ) |
|
| 77 | - $params .= '&duration='.$duration; |
|
| 76 | + if ($duration > 0) |
|
| 77 | + $params .= '&duration=' . $duration; |
|
| 78 | 78 | |
| 79 | 79 | $maxParticipants = intval($maxParticipants); |
| 80 | - if( $maxParticipants > 0 ) |
|
| 81 | - $params .= '&maxParticipants='.$maxParticipants; |
|
| 80 | + if ($maxParticipants > 0) |
|
| 81 | + $params .= '&maxParticipants=' . $maxParticipants; |
|
| 82 | 82 | |
| 83 | - if( trim( $welcome ) ) |
|
| 84 | - $params .= '&welcome='.urlencode($welcome); |
|
| 83 | + if (trim($welcome)) |
|
| 84 | + $params .= '&welcome=' . urlencode($welcome); |
|
| 85 | 85 | |
| 86 | 86 | foreach ($metadata as $key => $value) { |
| 87 | - $params .= '&'.$key.'='.urlencode($value); |
|
| 87 | + $params .= '&' . $key . '=' . urlencode($value); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - $url = $url_create.$params.'&checksum='.sha1("create".$params.$SALT); |
|
| 90 | + $url = $url_create . $params . '&checksum=' . sha1("create" . $params . $SALT); |
|
| 91 | 91 | return $url; |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | -function bigbluebuttonbn_getIsMeetingRunningURL( $meetingID, $URL, $SALT ) { |
|
| 95 | - $base_url = $URL."api/isMeetingRunning?"; |
|
| 96 | - $params = 'meetingID='.urlencode($meetingID); |
|
| 97 | - $url = $base_url.$params.'&checksum='.sha1("isMeetingRunning".$params.$SALT); |
|
| 94 | +function bigbluebuttonbn_getIsMeetingRunningURL($meetingID, $URL, $SALT) { |
|
| 95 | + $base_url = $URL . "api/isMeetingRunning?"; |
|
| 96 | + $params = 'meetingID=' . urlencode($meetingID); |
|
| 97 | + $url = $base_url . $params . '&checksum=' . sha1("isMeetingRunning" . $params . $SALT); |
|
| 98 | 98 | return $url; |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | -function bigbluebuttonbn_getMeetingInfoURL( $meetingID, $modPW, $URL, $SALT ) { |
|
| 102 | - $base_url = $URL."api/getMeetingInfo?"; |
|
| 103 | - $params = 'meetingID='.urlencode($meetingID).'&password='.urlencode($modPW); |
|
| 104 | - $url = $base_url.$params.'&checksum='.sha1("getMeetingInfo".$params.$SALT); |
|
| 101 | +function bigbluebuttonbn_getMeetingInfoURL($meetingID, $modPW, $URL, $SALT) { |
|
| 102 | + $base_url = $URL . "api/getMeetingInfo?"; |
|
| 103 | + $params = 'meetingID=' . urlencode($meetingID) . '&password=' . urlencode($modPW); |
|
| 104 | + $url = $base_url . $params . '&checksum=' . sha1("getMeetingInfo" . $params . $SALT); |
|
| 105 | 105 | return $url; |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | -function bigbluebuttonbn_getMeetingsURL( $URL, $SALT ) { |
|
| 109 | - $base_url = $URL."api/getMeetings?"; |
|
| 110 | - $url = $base_url.'&checksum='.sha1("getMeetings".$SALT); |
|
| 108 | +function bigbluebuttonbn_getMeetingsURL($URL, $SALT) { |
|
| 109 | + $base_url = $URL . "api/getMeetings?"; |
|
| 110 | + $url = $base_url . '&checksum=' . sha1("getMeetings" . $SALT); |
|
| 111 | 111 | return $url; |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | -function bigbluebuttonbn_getEndMeetingURL( $meetingID, $modPW, $URL, $SALT ) { |
|
| 115 | - $base_url = $URL."api/end?"; |
|
| 116 | - $params = 'meetingID='.urlencode($meetingID).'&password='.urlencode($modPW); |
|
| 117 | - $url = $base_url.$params.'&checksum='.sha1("end".$params.$SALT); |
|
| 114 | +function bigbluebuttonbn_getEndMeetingURL($meetingID, $modPW, $URL, $SALT) { |
|
| 115 | + $base_url = $URL . "api/end?"; |
|
| 116 | + $params = 'meetingID=' . urlencode($meetingID) . '&password=' . urlencode($modPW); |
|
| 117 | + $url = $base_url . $params . '&checksum=' . sha1("end" . $params . $SALT); |
|
| 118 | 118 | return $url; |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | -function bigbluebuttonbn_getRecordingsURL( $URL, $SALT, $meetingID=null ) { |
|
| 122 | - $base_url_record = $URL."api/getRecordings?"; |
|
| 123 | - if( $meetingID == null ) { |
|
| 121 | +function bigbluebuttonbn_getRecordingsURL($URL, $SALT, $meetingID = null) { |
|
| 122 | + $base_url_record = $URL . "api/getRecordings?"; |
|
| 123 | + if ($meetingID == null) { |
|
| 124 | 124 | $params = ""; |
| 125 | 125 | } else { |
| 126 | - $params = "meetingID=".urlencode($meetingID); |
|
| 126 | + $params = "meetingID=" . urlencode($meetingID); |
|
| 127 | 127 | } |
| 128 | - $url = $base_url_record.$params."&checksum=".sha1("getRecordings".$params.$SALT); |
|
| 128 | + $url = $base_url_record . $params . "&checksum=" . sha1("getRecordings" . $params . $SALT); |
|
| 129 | 129 | return $url; |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | -function bigbluebuttonbn_getDeleteRecordingsURL( $recordID, $URL, $SALT ) { |
|
| 133 | - $url_delete = $URL."api/deleteRecordings?"; |
|
| 134 | - $params = 'recordID='.urlencode($recordID); |
|
| 135 | - $url = $url_delete.$params.'&checksum='.sha1("deleteRecordings".$params.$SALT); |
|
| 132 | +function bigbluebuttonbn_getDeleteRecordingsURL($recordID, $URL, $SALT) { |
|
| 133 | + $url_delete = $URL . "api/deleteRecordings?"; |
|
| 134 | + $params = 'recordID=' . urlencode($recordID); |
|
| 135 | + $url = $url_delete . $params . '&checksum=' . sha1("deleteRecordings" . $params . $SALT); |
|
| 136 | 136 | return $url; |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | -function bigbluebuttonbn_getPublishRecordingsURL( $recordID, $set, $URL, $SALT ) { |
|
| 140 | - $url_publish = $URL."api/publishRecordings?"; |
|
| 141 | - $params = 'recordID='.$recordID."&publish=".$set; |
|
| 142 | - $url = $url_publish.$params.'&checksum='.sha1("publishRecordings".$params.$SALT); |
|
| 139 | +function bigbluebuttonbn_getPublishRecordingsURL($recordID, $set, $URL, $SALT) { |
|
| 140 | + $url_publish = $URL . "api/publishRecordings?"; |
|
| 141 | + $params = 'recordID=' . $recordID . "&publish=" . $set; |
|
| 142 | + $url = $url_publish . $params . '&checksum=' . sha1("publishRecordings" . $params . $SALT); |
|
| 143 | 143 | return $url; |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | -function bigbluebuttonbn_getCreateMeetingArray( $username, $meetingID, $welcomeString, $mPW, $aPW, $SALT, $URL, $logoutURL, $record='false', $duration=0, $voiceBridge=0, $maxParticipants=0, $metadata=array(), $presentation_name=null, $presentation_url=null ) { |
|
| 146 | +function bigbluebuttonbn_getCreateMeetingArray($username, $meetingID, $welcomeString, $mPW, $aPW, $SALT, $URL, $logoutURL, $record = 'false', $duration = 0, $voiceBridge = 0, $maxParticipants = 0, $metadata = array(), $presentation_name = null, $presentation_url = null) { |
|
| 147 | 147 | $create_meeting_url = bigbluebuttonbn_getCreateMeetingURL($username, $meetingID, $aPW, $mPW, $welcomeString, $logoutURL, $SALT, $URL, $record, $duration, $voiceBridge, $maxParticipants, $metadata); |
| 148 | - if( !is_null($presentation_name) && !is_null($presentation_url) ) { |
|
| 149 | - $xml = bigbluebuttonbn_wrap_xml_load_file( $create_meeting_url, |
|
| 148 | + if (!is_null($presentation_name) && !is_null($presentation_url)) { |
|
| 149 | + $xml = bigbluebuttonbn_wrap_xml_load_file($create_meeting_url, |
|
| 150 | 150 | BIGBLUEBUTTONBN_METHOD_POST, |
| 151 | - "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='".$presentation_url."' /></module></modules>" |
|
| 151 | + "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='" . $presentation_url . "' /></module></modules>" |
|
| 152 | 152 | ); |
| 153 | 153 | } else { |
| 154 | - $xml = bigbluebuttonbn_wrap_xml_load_file( $create_meeting_url ); |
|
| 154 | + $xml = bigbluebuttonbn_wrap_xml_load_file($create_meeting_url); |
|
| 155 | 155 | } |
| 156 | 156 | |
| 157 | - if ( $xml ) { |
|
| 157 | + if ($xml) { |
|
| 158 | 158 | if ($xml->meetingID) |
| 159 | - return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey, 'meetingID' => $xml->meetingID, 'attendeePW' => $xml->attendeePW, 'moderatorPW' => $xml->moderatorPW, 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded ); |
|
| 159 | + return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey, 'meetingID' => $xml->meetingID, 'attendeePW' => $xml->attendeePW, 'moderatorPW' => $xml->moderatorPW, 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded); |
|
| 160 | 160 | else |
| 161 | - return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey ); |
|
| 161 | + return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); |
|
| 162 | 162 | } else { |
| 163 | 163 | return null; |
| 164 | 164 | } |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | -function bigbluebuttonbn_getMeetingsArray($meetingID, $URL, $SALT ) { |
|
| 168 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getMeetingsURL($URL, $SALT) ); |
|
| 167 | +function bigbluebuttonbn_getMeetingsArray($meetingID, $URL, $SALT) { |
|
| 168 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getMeetingsURL($URL, $SALT)); |
|
| 169 | 169 | |
| 170 | - if( $xml && $xml->returncode == 'SUCCESS' && $xml->messageKey ) { //The meetings were returned |
|
| 170 | + if ($xml && $xml->returncode == 'SUCCESS' && $xml->messageKey) { //The meetings were returned |
|
| 171 | 171 | return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); |
| 172 | 172 | |
| 173 | - } else if($xml && $xml->returncode == 'SUCCESS'){ //If there were meetings already created |
|
| 173 | + } else if ($xml && $xml->returncode == 'SUCCESS') { //If there were meetings already created |
|
| 174 | 174 | foreach ($xml->meetings->meeting as $meeting) { |
| 175 | - $meetings[] = array( 'meetingID' => $meeting->meetingID, 'moderatorPW' => $meeting->moderatorPW, 'attendeePW' => $meeting->attendeePW, 'hasBeenForciblyEnded' => $meeting->hasBeenForciblyEnded, 'running' => $meeting->running ); |
|
| 175 | + $meetings[] = array('meetingID' => $meeting->meetingID, 'moderatorPW' => $meeting->moderatorPW, 'attendeePW' => $meeting->attendeePW, 'hasBeenForciblyEnded' => $meeting->hasBeenForciblyEnded, 'running' => $meeting->running); |
|
| 176 | 176 | } |
| 177 | 177 | return $meetings; |
| 178 | 178 | |
| 179 | - } else if( $xml ) { //If the xml packet returned failure it displays the message to the user |
|
| 179 | + } else if ($xml) { //If the xml packet returned failure it displays the message to the user |
|
| 180 | 180 | return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); |
| 181 | 181 | |
| 182 | 182 | } else { //If the server is unreachable, then prompts the user of the necessary action |
@@ -184,21 +184,21 @@ discard block |
||
| 184 | 184 | } |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | -function bigbluebuttonbn_getMeetingInfo( $meetingID, $modPW, $URL, $SALT ) { |
|
| 188 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getMeetingInfoURL( $meetingID, $modPW, $URL, $SALT ) ); |
|
| 187 | +function bigbluebuttonbn_getMeetingInfo($meetingID, $modPW, $URL, $SALT) { |
|
| 188 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getMeetingInfoURL($meetingID, $modPW, $URL, $SALT)); |
|
| 189 | 189 | return $xml; |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | -function bigbluebuttonbn_getMeetingInfoArray( $meetingID, $modPW, $URL, $SALT ) { |
|
| 193 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getMeetingInfoURL( $meetingID, $modPW, $URL, $SALT ) ); |
|
| 192 | +function bigbluebuttonbn_getMeetingInfoArray($meetingID, $modPW, $URL, $SALT) { |
|
| 193 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getMeetingInfoURL($meetingID, $modPW, $URL, $SALT)); |
|
| 194 | 194 | |
| 195 | - if( $xml && $xml->returncode == 'SUCCESS' && $xml->messageKey == null){//The meeting info was returned |
|
| 196 | - return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey ); |
|
| 195 | + if ($xml && $xml->returncode == 'SUCCESS' && $xml->messageKey == null) {//The meeting info was returned |
|
| 196 | + return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); |
|
| 197 | 197 | |
| 198 | - } else if($xml && $xml->returncode == 'SUCCESS'){ //If there were meetings already created |
|
| 199 | - 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 ); |
|
| 198 | + } else if ($xml && $xml->returncode == 'SUCCESS') { //If there were meetings already created |
|
| 199 | + 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); |
|
| 200 | 200 | |
| 201 | - } else if( ($xml && $xml->returncode == 'FAILED') || $xml) { //If the xml packet returned failure it displays the message to the user |
|
| 201 | + } else if (($xml && $xml->returncode == 'FAILED') || $xml) { //If the xml packet returned failure it displays the message to the user |
|
| 202 | 202 | return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); |
| 203 | 203 | |
| 204 | 204 | } else { //If the server is unreachable, then prompts the user of the necessary action |
@@ -206,19 +206,19 @@ discard block |
||
| 206 | 206 | } |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | -function bigbluebuttonbn_getRecordingsArray( $meetingIDs, $URL, $SALT ) { |
|
| 209 | +function bigbluebuttonbn_getRecordingsArray($meetingIDs, $URL, $SALT) { |
|
| 210 | 210 | $recordings = array(); |
| 211 | 211 | |
| 212 | - if ( is_array($meetingIDs) ) { |
|
| 212 | + if (is_array($meetingIDs)) { |
|
| 213 | 213 | // getRecordings is executes using a method POST (supported only on BBB 1.0 and later) |
| 214 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getRecordingsURL( $URL, $SALT ), BIGBLUEBUTTONBN_METHOD_POST, $meetingIDs ); |
|
| 214 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getRecordingsURL($URL, $SALT), BIGBLUEBUTTONBN_METHOD_POST, $meetingIDs); |
|
| 215 | 215 | } else { |
| 216 | 216 | // getRecordings is executes using a method GET supported by any version of BBB |
| 217 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getRecordingsURL( $URL, $SALT, $meetingIDs ) ); |
|
| 217 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getRecordingsURL($URL, $SALT, $meetingIDs)); |
|
| 218 | 218 | } |
| 219 | 219 | |
| 220 | - if ( $xml && $xml->returncode == 'SUCCESS' && isset($xml->recordings) ) { //If there were meetings already created |
|
| 221 | - foreach ( $xml->recordings->recording as $recording ) { |
|
| 220 | + if ($xml && $xml->returncode == 'SUCCESS' && isset($xml->recordings)) { //If there were meetings already created |
|
| 221 | + foreach ($xml->recordings->recording as $recording) { |
|
| 222 | 222 | $recordings[] = bigbluebuttonbn_getRecordingArrayRow($recording); |
| 223 | 223 | } |
| 224 | 224 | |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | return $recordings; |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | -function bigbluebuttonbn_index_recordings($recordings, $index_key='recordID') { |
|
| 231 | +function bigbluebuttonbn_index_recordings($recordings, $index_key = 'recordID') { |
|
| 232 | 232 | $indexed_recordings = array(); |
| 233 | 233 | |
| 234 | 234 | foreach ($recordings as $recording) { |
@@ -238,14 +238,14 @@ discard block |
||
| 238 | 238 | return $indexed_recordings; |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | -function bigbluebuttonbn_getRecordingArray( $recordingID, $meetingID, $URL, $SALT ) { |
|
| 241 | +function bigbluebuttonbn_getRecordingArray($recordingID, $meetingID, $URL, $SALT) { |
|
| 242 | 242 | $recordingArray = array(); |
| 243 | 243 | |
| 244 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getRecordingsURL( $URL, $SALT, $meetingID ) ); |
|
| 244 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getRecordingsURL($URL, $SALT, $meetingID)); |
|
| 245 | 245 | |
| 246 | - if ( $xml && $xml->returncode == 'SUCCESS' && isset($xml->recordings) ) { //If there were meetings already created |
|
| 246 | + if ($xml && $xml->returncode == 'SUCCESS' && isset($xml->recordings)) { //If there were meetings already created |
|
| 247 | 247 | foreach ($xml->recordings->recording as $recording) { |
| 248 | - if( $recording->recordID == $recordingID ) { |
|
| 248 | + if ($recording->recordID == $recordingID) { |
|
| 249 | 249 | $recordingArray = bigbluebuttonbn_getRecordingArrayRow($recording); |
| 250 | 250 | break; |
| 251 | 251 | } |
@@ -255,57 +255,57 @@ discard block |
||
| 255 | 255 | return $recordingArray; |
| 256 | 256 | } |
| 257 | 257 | |
| 258 | -function bigbluebuttonbn_getRecordingArrayRow( $recording ) { |
|
| 258 | +function bigbluebuttonbn_getRecordingArrayRow($recording) { |
|
| 259 | 259 | $recordingArrayRow = array(); |
| 260 | 260 | |
| 261 | 261 | $playbackArray = array(); |
| 262 | - foreach ( $recording->playback->format as $format ) { |
|
| 263 | - $playbackArray[(string) $format->type] = array( 'type' => (string) $format->type, 'url' => (string) $format->url, 'length' => (string) $format->length ); |
|
| 262 | + foreach ($recording->playback->format as $format) { |
|
| 263 | + $playbackArray[(string)$format->type] = array('type' => (string)$format->type, 'url' => (string)$format->url, 'length' => (string)$format->length); |
|
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | //Add the metadata to the recordings array |
| 267 | 267 | $metadataArray = array(); |
| 268 | 268 | $metadata = get_object_vars($recording->metadata); |
| 269 | - foreach ( $metadata as $key => $value ) { |
|
| 270 | - if ( is_object($value) ) $value = ''; |
|
| 271 | - $metadataArray['meta_'.$key] = $value; |
|
| 269 | + foreach ($metadata as $key => $value) { |
|
| 270 | + if (is_object($value)) $value = ''; |
|
| 271 | + $metadataArray['meta_' . $key] = $value; |
|
| 272 | 272 | } |
| 273 | 273 | |
| 274 | - $recordingArrayRow = 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; |
|
| 274 | + $recordingArrayRow = 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; |
|
| 275 | 275 | |
| 276 | 276 | return $recordingArrayRow; |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | -function bigbluebuttonbn_recordingBuildSorter($a, $b){ |
|
| 280 | - if( $a['startTime'] < $b['startTime']) return -1; |
|
| 281 | - else if( $a['startTime'] == $b['startTime']) return 0; |
|
| 279 | +function bigbluebuttonbn_recordingBuildSorter($a, $b) { |
|
| 280 | + if ($a['startTime'] < $b['startTime']) return -1; |
|
| 281 | + else if ($a['startTime'] == $b['startTime']) return 0; |
|
| 282 | 282 | else return 1; |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | -function bigbluebuttonbn_doDeleteRecordings( $recordIDs, $URL, $SALT ) { |
|
| 286 | - $ids = explode(",", $recordIDs); |
|
| 287 | - foreach( $ids as $id){ |
|
| 288 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getDeleteRecordingsURL($id, $URL, $SALT) ); |
|
| 289 | - if( $xml && $xml->returncode != 'SUCCESS' ) |
|
| 285 | +function bigbluebuttonbn_doDeleteRecordings($recordIDs, $URL, $SALT) { |
|
| 286 | + $ids = explode(",", $recordIDs); |
|
| 287 | + foreach ($ids as $id) { |
|
| 288 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getDeleteRecordingsURL($id, $URL, $SALT)); |
|
| 289 | + if ($xml && $xml->returncode != 'SUCCESS') |
|
| 290 | 290 | return false; |
| 291 | 291 | } |
| 292 | 292 | return true; |
| 293 | 293 | } |
| 294 | 294 | |
| 295 | -function bigbluebuttonbn_doPublishRecordings( $recordIDs, $set, $URL, $SALT ) { |
|
| 296 | - $ids = explode(",", $recordIDs); |
|
| 297 | - foreach( $ids as $id){ |
|
| 298 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getPublishRecordingsURL($id, $set, $URL, $SALT) ); |
|
| 299 | - if( $xml && $xml->returncode != 'SUCCESS' ) |
|
| 295 | +function bigbluebuttonbn_doPublishRecordings($recordIDs, $set, $URL, $SALT) { |
|
| 296 | + $ids = explode(",", $recordIDs); |
|
| 297 | + foreach ($ids as $id) { |
|
| 298 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getPublishRecordingsURL($id, $set, $URL, $SALT)); |
|
| 299 | + if ($xml && $xml->returncode != 'SUCCESS') |
|
| 300 | 300 | return false; |
| 301 | 301 | } |
| 302 | 302 | return true; |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | -function bigbluebuttonbn_doEndMeeting( $meetingID, $modPW, $URL, $SALT ) { |
|
| 306 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getEndMeetingURL( $meetingID, $modPW, $URL, $SALT ) ); |
|
| 305 | +function bigbluebuttonbn_doEndMeeting($meetingID, $modPW, $URL, $SALT) { |
|
| 306 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getEndMeetingURL($meetingID, $modPW, $URL, $SALT)); |
|
| 307 | 307 | |
| 308 | - if( $xml ) { //If the xml packet returned failure it displays the message to the user |
|
| 308 | + if ($xml) { //If the xml packet returned failure it displays the message to the user |
|
| 309 | 309 | return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); |
| 310 | 310 | } |
| 311 | 311 | else { //If the server is unreachable, then prompts the user of the necessary action |
@@ -313,46 +313,46 @@ discard block |
||
| 313 | 313 | } |
| 314 | 314 | } |
| 315 | 315 | |
| 316 | -function bigbluebuttonbn_isMeetingRunning( $meetingID, $URL, $SALT ) { |
|
| 317 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getIsMeetingRunningURL( $meetingID, $URL, $SALT ) ); |
|
| 318 | - if ( $xml && $xml->returncode == 'SUCCESS' ) { |
|
| 319 | - return ( ( $xml->running == 'true' ) ? true : false); |
|
| 316 | +function bigbluebuttonbn_isMeetingRunning($meetingID, $URL, $SALT) { |
|
| 317 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getIsMeetingRunningURL($meetingID, $URL, $SALT)); |
|
| 318 | + if ($xml && $xml->returncode == 'SUCCESS') { |
|
| 319 | + return (($xml->running == 'true') ? true : false); |
|
| 320 | 320 | } else { |
| 321 | - return ( false ); |
|
| 321 | + return (false); |
|
| 322 | 322 | } |
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | |
| 326 | -function bigbluebuttonbn_getServerVersion( $URL ){ |
|
| 327 | - $xml = bigbluebuttonbn_wrap_xml_load_file( $URL."api" ); |
|
| 328 | - if ( $xml && $xml->returncode == 'SUCCESS' ) { |
|
| 326 | +function bigbluebuttonbn_getServerVersion($URL) { |
|
| 327 | + $xml = bigbluebuttonbn_wrap_xml_load_file($URL . "api"); |
|
| 328 | + if ($xml && $xml->returncode == 'SUCCESS') { |
|
| 329 | 329 | return $xml->version; |
| 330 | 330 | } else { |
| 331 | 331 | return NULL; |
| 332 | 332 | } |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | -function bigbluebuttonbn_getMeetingXML( $meetingID, $URL, $SALT ) { |
|
| 336 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getIsMeetingRunningURL( $meetingID, $URL, $SALT ) ); |
|
| 337 | - if ( $xml && $xml->returncode == 'SUCCESS') { |
|
| 338 | - return ( str_replace('</response>', '', str_replace("<?xml version=\"1.0\"?>\n<response>", '', $xml->asXML()))); |
|
| 335 | +function bigbluebuttonbn_getMeetingXML($meetingID, $URL, $SALT) { |
|
| 336 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getIsMeetingRunningURL($meetingID, $URL, $SALT)); |
|
| 337 | + if ($xml && $xml->returncode == 'SUCCESS') { |
|
| 338 | + return (str_replace('</response>', '', str_replace("<?xml version=\"1.0\"?>\n<response>", '', $xml->asXML()))); |
|
| 339 | 339 | } else { |
| 340 | 340 | return 'false'; |
| 341 | 341 | } |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | -function bigbluebuttonbn_wrap_xml_load_file($url, $method=BIGBLUEBUTTONBN_METHOD_GET, $data=null) { |
|
| 345 | - if ( bigbluebuttonbn_debugdisplay() ) error_log("Request to: ".$url); |
|
| 344 | +function bigbluebuttonbn_wrap_xml_load_file($url, $method = BIGBLUEBUTTONBN_METHOD_GET, $data = null) { |
|
| 345 | + if (bigbluebuttonbn_debugdisplay()) error_log("Request to: " . $url); |
|
| 346 | 346 | |
| 347 | 347 | if (extension_loaded('curl')) { |
| 348 | 348 | $c = new curl(); |
| 349 | - $c->setopt( Array( "SSL_VERIFYPEER" => true)); |
|
| 350 | - if( $method == BIGBLUEBUTTONBN_METHOD_POST ) { |
|
| 351 | - if( !is_null($data) ) { |
|
| 352 | - if( !is_array($data) ) { |
|
| 349 | + $c->setopt(Array("SSL_VERIFYPEER" => true)); |
|
| 350 | + if ($method == BIGBLUEBUTTONBN_METHOD_POST) { |
|
| 351 | + if (!is_null($data)) { |
|
| 352 | + if (!is_array($data)) { |
|
| 353 | 353 | $options['CURLOPT_HTTPHEADER'] = array( |
| 354 | 354 | 'Content-Type: text/xml', |
| 355 | - 'Content-Length: '.strlen($data), |
|
| 355 | + 'Content-Length: ' . strlen($data), |
|
| 356 | 356 | 'Content-Language: en-US' |
| 357 | 357 | ); |
| 358 | 358 | $response = $c->post($url, $data, $options); |
@@ -374,9 +374,9 @@ discard block |
||
| 374 | 374 | try { |
| 375 | 375 | $xml = new SimpleXMLElement($response, LIBXML_NOCDATA); |
| 376 | 376 | return $xml; |
| 377 | - } catch (Exception $e){ |
|
| 377 | + } catch (Exception $e) { |
|
| 378 | 378 | libxml_use_internal_errors($previous); |
| 379 | - $error = 'Caught exception: '.$e->getMessage(); |
|
| 379 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
| 380 | 380 | error_log($error); |
| 381 | 381 | return NULL; |
| 382 | 382 | } |
@@ -388,18 +388,18 @@ discard block |
||
| 388 | 388 | } else { |
| 389 | 389 | $previous = libxml_use_internal_errors(true); |
| 390 | 390 | try { |
| 391 | - $xml = simplexml_load_file($url,'SimpleXMLElement', LIBXML_NOCDATA); |
|
| 391 | + $xml = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA); |
|
| 392 | 392 | return $xml; |
| 393 | - } catch (Exception $e){ |
|
| 393 | + } catch (Exception $e) { |
|
| 394 | 394 | libxml_use_internal_errors($previous); |
| 395 | 395 | return NULL; |
| 396 | 396 | } |
| 397 | 397 | } |
| 398 | 398 | } |
| 399 | 399 | |
| 400 | -function bigbluebuttonbn_get_role_name($role_shortname){ |
|
| 400 | +function bigbluebuttonbn_get_role_name($role_shortname) { |
|
| 401 | 401 | $role = bigbluebuttonbn_get_db_moodle_roles($role_shortname); |
| 402 | - if( $role != null && $role->name != "") { |
|
| 402 | + if ($role != null && $role->name != "") { |
|
| 403 | 403 | $role_name = $role->name; |
| 404 | 404 | } else { |
| 405 | 405 | switch ($role_shortname) { |
@@ -419,13 +419,13 @@ discard block |
||
| 419 | 419 | return $role_name; |
| 420 | 420 | } |
| 421 | 421 | |
| 422 | -function bigbluebuttonbn_get_roles($rolename='all', $format='json'){ |
|
| 422 | +function bigbluebuttonbn_get_roles($rolename = 'all', $format = 'json') { |
|
| 423 | 423 | $roles = bigbluebuttonbn_get_db_moodle_roles($rolename); |
| 424 | 424 | $roles_array = array(); |
| 425 | - foreach($roles as $role){ |
|
| 426 | - if( $format=='json' ) { |
|
| 425 | + foreach ($roles as $role) { |
|
| 426 | + if ($format == 'json') { |
|
| 427 | 427 | array_push($roles_array, |
| 428 | - array( "id" => $role->shortname, |
|
| 428 | + array("id" => $role->shortname, |
|
| 429 | 429 | "name" => bigbluebuttonbn_get_role_name($role->shortname) |
| 430 | 430 | ) |
| 431 | 431 | ); |
@@ -436,19 +436,19 @@ discard block |
||
| 436 | 436 | return $roles_array; |
| 437 | 437 | } |
| 438 | 438 | |
| 439 | -function bigbluebuttonbn_get_roles_json($rolename='all'){ |
|
| 439 | +function bigbluebuttonbn_get_roles_json($rolename = 'all') { |
|
| 440 | 440 | return json_encode(bigbluebuttonbn_get_roles($rolename)); |
| 441 | 441 | } |
| 442 | 442 | |
| 443 | -function bigbluebuttonbn_get_users_json($users, $full=false) { |
|
| 444 | - if( $full ) { |
|
| 443 | +function bigbluebuttonbn_get_users_json($users, $full = false) { |
|
| 444 | + if ($full) { |
|
| 445 | 445 | return json_encode($users); |
| 446 | 446 | } else { |
| 447 | 447 | $users_array = array(); |
| 448 | - foreach($users as $user){ |
|
| 448 | + foreach ($users as $user) { |
|
| 449 | 449 | array_push($users_array, |
| 450 | - array( "id" => $user->id, |
|
| 451 | - "name" => $user->firstname.' '.$user->lastname |
|
| 450 | + array("id" => $user->id, |
|
| 451 | + "name" => $user->firstname . ' ' . $user->lastname |
|
| 452 | 452 | ) |
| 453 | 453 | ); |
| 454 | 454 | } |
@@ -456,15 +456,15 @@ discard block |
||
| 456 | 456 | } |
| 457 | 457 | } |
| 458 | 458 | |
| 459 | -function bigbluebuttonbn_get_participant_list($bigbluebuttonbn=null, $context=null){ |
|
| 459 | +function bigbluebuttonbn_get_participant_list($bigbluebuttonbn = null, $context = null) { |
|
| 460 | 460 | global $CFG, $USER; |
| 461 | 461 | |
| 462 | 462 | $participant_list_array = array(); |
| 463 | 463 | |
| 464 | - if( $bigbluebuttonbn != null ) { |
|
| 464 | + if ($bigbluebuttonbn != null) { |
|
| 465 | 465 | $participant_list = json_decode($bigbluebuttonbn->participants); |
| 466 | 466 | if (is_array($participant_list)) { |
| 467 | - foreach($participant_list as $participant){ |
|
| 467 | + foreach ($participant_list as $participant) { |
|
| 468 | 468 | array_push($participant_list_array, |
| 469 | 469 | array( |
| 470 | 470 | "selectiontype" => $participant->selectiontype, |
@@ -484,16 +484,16 @@ discard block |
||
| 484 | 484 | ); |
| 485 | 485 | |
| 486 | 486 | $moderator_defaults = bigbluebuttonbn_get_cfg_moderator_default(); |
| 487 | - if ( !isset($moderator_defaults) ) { |
|
| 487 | + if (!isset($moderator_defaults)) { |
|
| 488 | 488 | $moderator_defaults = array('owner'); |
| 489 | 489 | } else { |
| 490 | 490 | $moderator_defaults = explode(',', $moderator_defaults); |
| 491 | 491 | } |
| 492 | - foreach( $moderator_defaults as $moderator_default ) { |
|
| 493 | - if( $moderator_default == 'owner' ) { |
|
| 492 | + foreach ($moderator_defaults as $moderator_default) { |
|
| 493 | + if ($moderator_default == 'owner') { |
|
| 494 | 494 | $users = bigbluebuttonbn_get_users($context); |
| 495 | - foreach( $users as $user ){ |
|
| 496 | - if( $user->id == $USER->id ){ |
|
| 495 | + foreach ($users as $user) { |
|
| 496 | + if ($user->id == $USER->id) { |
|
| 497 | 497 | array_push($participant_list_array, |
| 498 | 498 | array( |
| 499 | 499 | "selectiontype" => "user", |
@@ -519,7 +519,7 @@ discard block |
||
| 519 | 519 | return $participant_list_array; |
| 520 | 520 | } |
| 521 | 521 | |
| 522 | -function bigbluebuttonbn_get_participant_list_json($bigbluebuttonbnid=null){ |
|
| 522 | +function bigbluebuttonbn_get_participant_list_json($bigbluebuttonbnid = null) { |
|
| 523 | 523 | return json_encode(bigbluebuttonbn_get_participant_list($bigbluebuttonbnid)); |
| 524 | 524 | } |
| 525 | 525 | |
@@ -528,21 +528,21 @@ discard block |
||
| 528 | 528 | |
| 529 | 529 | if (is_array($participant_list)) { |
| 530 | 530 | // Iterate looking for all configuration |
| 531 | - foreach($participant_list as $participant){ |
|
| 532 | - if( $participant->selectiontype == 'all' ) { |
|
| 533 | - if ( $participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR ) |
|
| 531 | + foreach ($participant_list as $participant) { |
|
| 532 | + if ($participant->selectiontype == 'all') { |
|
| 533 | + if ($participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR) |
|
| 534 | 534 | return true; |
| 535 | 535 | } |
| 536 | 536 | } |
| 537 | 537 | |
| 538 | 538 | //Iterate looking for roles |
| 539 | 539 | $db_moodle_roles = bigbluebuttonbn_get_db_moodle_roles(); |
| 540 | - foreach($participant_list as $participant){ |
|
| 541 | - if( $participant->selectiontype == 'role' ) { |
|
| 542 | - foreach( $roles as $role ) { |
|
| 540 | + foreach ($participant_list as $participant) { |
|
| 541 | + if ($participant->selectiontype == 'role') { |
|
| 542 | + foreach ($roles as $role) { |
|
| 543 | 543 | $db_moodle_role = bigbluebuttonbn_moodle_db_role_lookup($db_moodle_roles, $role->roleid); |
| 544 | - if( $participant->selectionid == $db_moodle_role->shortname ) { |
|
| 545 | - if ( $participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR ) |
|
| 544 | + if ($participant->selectionid == $db_moodle_role->shortname) { |
|
| 545 | + if ($participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR) |
|
| 546 | 546 | return true; |
| 547 | 547 | } |
| 548 | 548 | } |
@@ -550,10 +550,10 @@ discard block |
||
| 550 | 550 | } |
| 551 | 551 | |
| 552 | 552 | //Iterate looking for users |
| 553 | - foreach($participant_list as $participant){ |
|
| 554 | - if( $participant->selectiontype == 'user' ) { |
|
| 555 | - if( $participant->selectionid == $user ) { |
|
| 556 | - if ( $participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR ) |
|
| 553 | + foreach ($participant_list as $participant) { |
|
| 554 | + if ($participant->selectiontype == 'user') { |
|
| 555 | + if ($participant->selectionid == $user) { |
|
| 556 | + if ($participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR) |
|
| 557 | 557 | return true; |
| 558 | 558 | } |
| 559 | 559 | } |
@@ -564,8 +564,8 @@ discard block |
||
| 564 | 564 | } |
| 565 | 565 | |
| 566 | 566 | function bigbluebuttonbn_moodle_db_role_lookup($db_moodle_roles, $role_id) { |
| 567 | - foreach( $db_moodle_roles as $db_moodle_role ){ |
|
| 568 | - if( $role_id == $db_moodle_role->id ) { |
|
| 567 | + foreach ($db_moodle_roles as $db_moodle_role) { |
|
| 568 | + if ($role_id == $db_moodle_role->id) { |
|
| 569 | 569 | return $db_moodle_role; |
| 570 | 570 | } |
| 571 | 571 | } |
@@ -573,23 +573,23 @@ discard block |
||
| 573 | 573 | |
| 574 | 574 | function bigbluebuttonbn_get_error_key($messageKey, $defaultKey = null) { |
| 575 | 575 | $key = $defaultKey; |
| 576 | - if ( $messageKey == "checksumError" ){ |
|
| 576 | + if ($messageKey == "checksumError") { |
|
| 577 | 577 | $key = 'index_error_checksum'; |
| 578 | - } else if ( $messageKey == 'maxConcurrent' ) { |
|
| 578 | + } else if ($messageKey == 'maxConcurrent') { |
|
| 579 | 579 | $key = 'view_error_max_concurrent'; |
| 580 | 580 | } |
| 581 | 581 | return $key; |
| 582 | 582 | } |
| 583 | 583 | |
| 584 | -function bigbluebuttonbn_voicebridge_unique($voicebridge, $id=null) { |
|
| 584 | +function bigbluebuttonbn_voicebridge_unique($voicebridge, $id = null) { |
|
| 585 | 585 | global $DB; |
| 586 | 586 | |
| 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_publish_recording_imported($recordingid, $courseID, $bigbluebuttonbnID, $publish=true){ |
|
| 837 | +function bigbluebuttonbn_bbb_broker_do_publish_recording_imported($recordingid, $courseID, $bigbluebuttonbnID, $publish = true) { |
|
| 838 | 838 | global $DB; |
| 839 | 839 | |
| 840 | 840 | //Locate the record to be updated |
@@ -843,9 +843,9 @@ discard block |
||
| 843 | 843 | $recordings_imported = array(); |
| 844 | 844 | foreach ($records as $key => $record) { |
| 845 | 845 | $meta = json_decode($record->meta, true); |
| 846 | - if( $recordingid == $meta['recording']['recordID'] ) { |
|
| 846 | + if ($recordingid == $meta['recording']['recordID']) { |
|
| 847 | 847 | // Found, prepare data for the update |
| 848 | - $meta['recording']['published'] = ($publish)? 'true': 'false'; |
|
| 848 | + $meta['recording']['published'] = ($publish) ? 'true' : 'false'; |
|
| 849 | 849 | $records[$key]->meta = json_encode($meta); |
| 850 | 850 | |
| 851 | 851 | // Proceed with the update |
@@ -854,7 +854,7 @@ discard block |
||
| 854 | 854 | } |
| 855 | 855 | } |
| 856 | 856 | |
| 857 | -function bigbluebuttonbn_bbb_broker_do_delete_recording($recordingid){ |
|
| 857 | +function bigbluebuttonbn_bbb_broker_do_delete_recording($recordingid) { |
|
| 858 | 858 | global $CFG; |
| 859 | 859 | |
| 860 | 860 | $endpoint = bigbluebuttonbn_get_cfg_server_url(); |
@@ -863,7 +863,7 @@ discard block |
||
| 863 | 863 | bigbluebuttonbn_doDeleteRecordings($recordingid, $endpoint, $shared_secret); |
| 864 | 864 | } |
| 865 | 865 | |
| 866 | -function bigbluebuttonbn_bbb_broker_do_delete_recording_imported($recordingid, $courseID, $bigbluebuttonbnID){ |
|
| 866 | +function bigbluebuttonbn_bbb_broker_do_delete_recording_imported($recordingid, $courseID, $bigbluebuttonbnID) { |
|
| 867 | 867 | global $DB; |
| 868 | 868 | |
| 869 | 869 | //Locate the record to be updated |
@@ -872,7 +872,7 @@ discard block |
||
| 872 | 872 | $recordings_imported = array(); |
| 873 | 873 | foreach ($records as $key => $record) { |
| 874 | 874 | $meta = json_decode($record->meta, true); |
| 875 | - if( $recordingid == $meta['recording']['recordID'] ) { |
|
| 875 | + if ($recordingid == $meta['recording']['recordID']) { |
|
| 876 | 876 | // Execute delete |
| 877 | 877 | $DB->delete_records("bigbluebuttonbn_logs", array('id' => $key)); |
| 878 | 878 | } |
@@ -882,18 +882,18 @@ discard block |
||
| 882 | 882 | function bigbluebuttonbn_bbb_broker_validate_parameters($params) { |
| 883 | 883 | $error = ''; |
| 884 | 884 | |
| 885 | - if ( !isset($params['callback']) ) { |
|
| 885 | + if (!isset($params['callback'])) { |
|
| 886 | 886 | $error = $bigbluebuttonbn_bbb_broker_add_error($error, 'This call must include a javascript callback.'); |
| 887 | 887 | } |
| 888 | 888 | |
| 889 | - if ( !isset($params['action']) ) { |
|
| 889 | + if (!isset($params['action'])) { |
|
| 890 | 890 | $error = $bigbluebuttonbn_bbb_broker_add_error($error, 'Action parameter must be included.'); |
| 891 | 891 | } else { |
| 892 | - switch ( strtolower($params['action']) ){ |
|
| 892 | + switch (strtolower($params['action'])) { |
|
| 893 | 893 | case 'server_ping': |
| 894 | 894 | case 'meeting_info': |
| 895 | 895 | case 'meeting_end': |
| 896 | - if ( !isset($params['id']) ) { |
|
| 896 | + if (!isset($params['id'])) { |
|
| 897 | 897 | $error = $bigbluebuttonbn_bbb_broker_add_error($error, 'The meetingID must be specified.'); |
| 898 | 898 | } |
| 899 | 899 | break; |
@@ -903,79 +903,79 @@ discard block |
||
| 903 | 903 | case 'recording_unpublish': |
| 904 | 904 | case 'recording_delete': |
| 905 | 905 | case 'recording_import': |
| 906 | - if ( !isset($params['id']) ) { |
|
| 906 | + if (!isset($params['id'])) { |
|
| 907 | 907 | $error = bigbluebuttonbn_bbb_broker_add_error($error, 'The recordingID must be specified.'); |
| 908 | 908 | } |
| 909 | 909 | break; |
| 910 | 910 | case 'recording_ready': |
| 911 | - if( empty($params['signed_parameters']) ) { |
|
| 911 | + if (empty($params['signed_parameters'])) { |
|
| 912 | 912 | $error = bigbluebuttonbn_bbb_broker_add_error($error, 'A JWT encoded string must be included as [signed_parameters].'); |
| 913 | 913 | } |
| 914 | 914 | break; |
| 915 | 915 | default: |
| 916 | - $error = bigbluebuttonbn_bbb_broker_add_error($error, 'Action '.$params['action'].' can not be performed.'); |
|
| 916 | + $error = bigbluebuttonbn_bbb_broker_add_error($error, 'Action ' . $params['action'] . ' can not be performed.'); |
|
| 917 | 917 | } |
| 918 | 918 | } |
| 919 | 919 | |
| 920 | 920 | return $error; |
| 921 | 921 | } |
| 922 | 922 | |
| 923 | -function bigbluebuttonbn_bbb_broker_add_error($org_msg, $new_msg='') { |
|
| 923 | +function bigbluebuttonbn_bbb_broker_add_error($org_msg, $new_msg = '') { |
|
| 924 | 924 | $error = $org_msg; |
| 925 | 925 | |
| 926 | - if( !empty($new_msg) ) { |
|
| 927 | - if( !empty($error) ) $error .= ' '; |
|
| 926 | + if (!empty($new_msg)) { |
|
| 927 | + if (!empty($error)) $error .= ' '; |
|
| 928 | 928 | $error .= $new_msg; |
| 929 | 929 | } |
| 930 | 930 | |
| 931 | 931 | return $error; |
| 932 | 932 | } |
| 933 | 933 | |
| 934 | -function bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools=["publishing", "deleting"]) { |
|
| 934 | +function bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools = ["publishing", "deleting"]) { |
|
| 935 | 935 | global $OUTPUT, $CFG, $USER; |
| 936 | 936 | |
| 937 | 937 | $row = null; |
| 938 | 938 | |
| 939 | - if ( $bbbsession['managerecordings'] || $recording['published'] == 'true' ) { |
|
| 939 | + if ($bbbsession['managerecordings'] || $recording['published'] == 'true') { |
|
| 940 | 940 | $length = 0; |
| 941 | - $startTime = isset($recording['startTime'])? floatval($recording['startTime']):0; |
|
| 941 | + $startTime = isset($recording['startTime']) ? floatval($recording['startTime']) : 0; |
|
| 942 | 942 | $startTime = $startTime - ($startTime % 1000); |
| 943 | - $endTime = isset($recording['endTime'])? floatval($recording['endTime']):0; |
|
| 943 | + $endTime = isset($recording['endTime']) ? floatval($recording['endTime']) : 0; |
|
| 944 | 944 | $endTime = $endTime - ($endTime % 1000); |
| 945 | 945 | $duration = intval(array_values($recording['playbacks'])[0]['length']); |
| 946 | 946 | |
| 947 | 947 | //For backward compatibility |
| 948 | - if( isset($recording['meta_contextactivity']) ) { |
|
| 948 | + if (isset($recording['meta_contextactivity'])) { |
|
| 949 | 949 | $meta_activity = str_replace('"', '\"', $recording['meta_contextactivity']); |
| 950 | - } if( isset($recording['meta_bbb-recording-name']) ) { |
|
| 950 | + } if (isset($recording['meta_bbb-recording-name'])) { |
|
| 951 | 951 | $meta_activity = str_replace('"', '\"', $recording['meta_bbb-recording-name']); |
| 952 | 952 | } else { |
| 953 | 953 | $meta_activity = str_replace('"', '\"', $recording['meetingName']); |
| 954 | 954 | } |
| 955 | 955 | |
| 956 | - if( isset($recording['meta_contextactivitydescription']) ) { |
|
| 956 | + if (isset($recording['meta_contextactivitydescription'])) { |
|
| 957 | 957 | $meta_description = str_replace('"', '\"', $recording['meta_contextactivitydescription']); |
| 958 | - } else if( isset($recording['meta_bbb-recording-description']) ) { |
|
| 958 | + } else if (isset($recording['meta_bbb-recording-description'])) { |
|
| 959 | 959 | $meta_description = str_replace('"', '\"', $recording['meta_bbb-recording-description']); |
| 960 | 960 | } else { |
| 961 | 961 | $meta_description = ''; |
| 962 | 962 | } |
| 963 | 963 | |
| 964 | 964 | //Set recording_types |
| 965 | - if ( isset($recording['imported']) ) { |
|
| 966 | - $attributes = 'data-imported="true" title='.get_string('view_recording_link_warning', 'bigbluebuttonbn'); |
|
| 965 | + if (isset($recording['imported'])) { |
|
| 966 | + $attributes = 'data-imported="true" title=' . get_string('view_recording_link_warning', 'bigbluebuttonbn'); |
|
| 967 | 967 | } else { |
| 968 | 968 | $attributes = 'data-imported="false"'; |
| 969 | 969 | } |
| 970 | 970 | |
| 971 | 971 | $recording_types = ''; |
| 972 | 972 | if ($recording['published'] == 'true') { |
| 973 | - $recording_types .= '<div id="playbacks-'.$recording['recordID'].'" '.$attributes.'>'; |
|
| 973 | + $recording_types .= '<div id="playbacks-' . $recording['recordID'] . '" ' . $attributes . '>'; |
|
| 974 | 974 | } else { |
| 975 | - $recording_types .= '<div id="playbacks-'.$recording['recordID'].'" '.$attributes.'" hidden>'; |
|
| 975 | + $recording_types .= '<div id="playbacks-' . $recording['recordID'] . '" ' . $attributes . '" hidden>'; |
|
| 976 | 976 | } |
| 977 | - foreach ( $recording['playbacks'] as $playback ) { |
|
| 978 | - $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') ).' '; |
|
| 977 | + foreach ($recording['playbacks'] as $playback) { |
|
| 978 | + $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')) . ' '; |
|
| 979 | 979 | } |
| 980 | 980 | $recording_types .= '</div>'; |
| 981 | 981 | |
@@ -984,11 +984,11 @@ discard block |
||
| 984 | 984 | |
| 985 | 985 | //Set actionbar, if user is allowed to manage recordings |
| 986 | 986 | $actionbar = ''; |
| 987 | - if ( $bbbsession['managerecordings'] ) { |
|
| 987 | + if ($bbbsession['managerecordings']) { |
|
| 988 | 988 | // Set style for imported links |
| 989 | - if( isset($recording['imported']) ) { |
|
| 989 | + if (isset($recording['imported'])) { |
|
| 990 | 990 | $recordings_imported_count = 0; |
| 991 | - $tag_tail = ' '.get_string('view_recording_link', 'bigbluebuttonbn'); |
|
| 991 | + $tag_tail = ' ' . get_string('view_recording_link', 'bigbluebuttonbn'); |
|
| 992 | 992 | $head = '<i>'; |
| 993 | 993 | $tail = '</i>'; |
| 994 | 994 | } else { |
@@ -1002,53 +1002,53 @@ discard block |
||
| 1002 | 1002 | |
| 1003 | 1003 | if (in_array("publishing", $tools)) { |
| 1004 | 1004 | ///Set action [show|hide] |
| 1005 | - if ( $recording['published'] == 'true' ){ |
|
| 1005 | + if ($recording['published'] == 'true') { |
|
| 1006 | 1006 | $manage_tag = 'hide'; |
| 1007 | 1007 | $manage_action = 'unpublish'; |
| 1008 | 1008 | } else { |
| 1009 | 1009 | $manage_tag = 'show'; |
| 1010 | 1010 | $manage_action = 'publish'; |
| 1011 | 1011 | } |
| 1012 | - $onclick = 'M.mod_bigbluebuttonbn.broker_manageRecording("'.$manage_action.'", "'.$recording['recordID'].'", "'.$recording['meetingID'].'");'; |
|
| 1012 | + $onclick = 'M.mod_bigbluebuttonbn.broker_manageRecording("' . $manage_action . '", "' . $recording['recordID'] . '", "' . $recording['meetingID'] . '");'; |
|
| 1013 | 1013 | |
| 1014 | - if ( bigbluebuttonbn_get_cfg_recording_icons_enabled() ) { |
|
| 1014 | + if (bigbluebuttonbn_get_cfg_recording_icons_enabled()) { |
|
| 1015 | 1015 | //With icon for publish/unpublish |
| 1016 | - $icon_attributes = array('id' => 'recording-btn-'.$manage_action.'-'.$recording['recordID']); |
|
| 1017 | - $icon = new pix_icon('t/'.$manage_tag, get_string($manage_tag).$tag_tail, 'moodle', $icon_attributes); |
|
| 1018 | - $link_attributes = array('id' => 'recording-link-'.$manage_action.'-'.$recording['recordID'], 'onclick' => $onclick, 'data-links' => $recordings_imported_count); |
|
| 1016 | + $icon_attributes = array('id' => 'recording-btn-' . $manage_action . '-' . $recording['recordID']); |
|
| 1017 | + $icon = new pix_icon('t/' . $manage_tag, get_string($manage_tag) . $tag_tail, 'moodle', $icon_attributes); |
|
| 1018 | + $link_attributes = array('id' => 'recording-link-' . $manage_action . '-' . $recording['recordID'], 'onclick' => $onclick, 'data-links' => $recordings_imported_count); |
|
| 1019 | 1019 | $actionbar .= $OUTPUT->action_icon($url, $icon, $action, $link_attributes, false); |
| 1020 | 1020 | } else { |
| 1021 | 1021 | //With text for publish/unpublish |
| 1022 | - $link_attributes = array('title' => get_string($manage_tag).$tag_tail, 'class' => 'btn btn-xs', 'onclick' => $onclick, 'data-links' => $recordings_imported_count); |
|
| 1023 | - $actionbar .= $OUTPUT->action_link($url, get_string($manage_tag).$tag_tail, $action, $link_attributes); |
|
| 1022 | + $link_attributes = array('title' => get_string($manage_tag) . $tag_tail, 'class' => 'btn btn-xs', 'onclick' => $onclick, 'data-links' => $recordings_imported_count); |
|
| 1023 | + $actionbar .= $OUTPUT->action_link($url, get_string($manage_tag) . $tag_tail, $action, $link_attributes); |
|
| 1024 | 1024 | $actionbar .= " "; |
| 1025 | 1025 | } |
| 1026 | 1026 | } |
| 1027 | 1027 | |
| 1028 | 1028 | if (in_array("deleting", $tools)) { |
| 1029 | - $onclick = 'M.mod_bigbluebuttonbn.broker_manageRecording("delete", "'.$recording['recordID'].'", "'.$recording['meetingID'].'");'; |
|
| 1029 | + $onclick = 'M.mod_bigbluebuttonbn.broker_manageRecording("delete", "' . $recording['recordID'] . '", "' . $recording['meetingID'] . '");'; |
|
| 1030 | 1030 | |
| 1031 | - if ( bigbluebuttonbn_get_cfg_recording_icons_enabled() ) { |
|
| 1031 | + if (bigbluebuttonbn_get_cfg_recording_icons_enabled()) { |
|
| 1032 | 1032 | //With icon for delete |
| 1033 | - $icon_attributes = array('id' => 'recording-btn-delete-'.$recording['recordID']); |
|
| 1034 | - $icon = new pix_icon('t/delete', get_string('delete').$tag_tail, 'moodle', $icon_attributes); |
|
| 1035 | - $link_attributes = array('id' => 'recording-link-delete-'.$recording['recordID'], 'onclick' => $onclick, 'data-links' => $recordings_imported_count); |
|
| 1033 | + $icon_attributes = array('id' => 'recording-btn-delete-' . $recording['recordID']); |
|
| 1034 | + $icon = new pix_icon('t/delete', get_string('delete') . $tag_tail, 'moodle', $icon_attributes); |
|
| 1035 | + $link_attributes = array('id' => 'recording-link-delete-' . $recording['recordID'], 'onclick' => $onclick, 'data-links' => $recordings_imported_count); |
|
| 1036 | 1036 | $actionbar .= $OUTPUT->action_icon($url, $icon, $action, $link_attributes, false); |
| 1037 | 1037 | } else { |
| 1038 | 1038 | //With text for delete |
| 1039 | - $link_attributes = array('title' => get_string('delete').$tag_tail, 'class' => 'btn btn-xs btn-danger', 'onclick' => $onclick, 'data-links' => $recordings_imported_count); |
|
| 1040 | - $actionbar .= $OUTPUT->action_link($url, get_string('delete').$tag_tail, $action, $link_attributes); |
|
| 1039 | + $link_attributes = array('title' => get_string('delete') . $tag_tail, 'class' => 'btn btn-xs btn-danger', 'onclick' => $onclick, 'data-links' => $recordings_imported_count); |
|
| 1040 | + $actionbar .= $OUTPUT->action_link($url, get_string('delete') . $tag_tail, $action, $link_attributes); |
|
| 1041 | 1041 | } |
| 1042 | 1042 | } |
| 1043 | 1043 | |
| 1044 | 1044 | if (in_array("importing", $tools)) { |
| 1045 | - $onclick = 'M.mod_bigbluebuttonbn.broker_manageRecording("import", "'.$recording['recordID'].'", "'.$recording['meetingID'].'");'; |
|
| 1045 | + $onclick = 'M.mod_bigbluebuttonbn.broker_manageRecording("import", "' . $recording['recordID'] . '", "' . $recording['meetingID'] . '");'; |
|
| 1046 | 1046 | |
| 1047 | - if ( bigbluebuttonbn_get_cfg_recording_icons_enabled() ) { |
|
| 1047 | + if (bigbluebuttonbn_get_cfg_recording_icons_enabled()) { |
|
| 1048 | 1048 | //With icon for import |
| 1049 | - $icon_attributes = array('id' => 'recording-btn-import-'.$recording['recordID']); |
|
| 1049 | + $icon_attributes = array('id' => 'recording-btn-import-' . $recording['recordID']); |
|
| 1050 | 1050 | $icon = new pix_icon('i/import', get_string('import'), 'moodle', $icon_attributes); |
| 1051 | - $link_attributes = array('id' => 'recording-link-import-'.$recording['recordID'], 'onclick' => $onclick); |
|
| 1051 | + $link_attributes = array('id' => 'recording-link-import-' . $recording['recordID'], 'onclick' => $onclick); |
|
| 1052 | 1052 | $actionbar .= $OUTPUT->action_icon($url, $icon, $action, $link_attributes, false); |
| 1053 | 1053 | } else { |
| 1054 | 1054 | //With text for import |
@@ -1059,7 +1059,7 @@ discard block |
||
| 1059 | 1059 | } |
| 1060 | 1060 | |
| 1061 | 1061 | //Set corresponding format |
| 1062 | - $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z'; |
|
| 1062 | + $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z'; |
|
| 1063 | 1063 | $formattedStartDate = userdate($startTime / 1000, $dateformat, usertimezone($USER->timezone)); |
| 1064 | 1064 | |
| 1065 | 1065 | $row = new stdClass(); |
@@ -1070,7 +1070,7 @@ discard block |
||
| 1070 | 1070 | $row->date_formatted = "{$head}{$formattedStartDate}{$tail}"; |
| 1071 | 1071 | $row->duration = "{$duration}"; |
| 1072 | 1072 | $row->duration_formatted = "{$head}{$duration}{$tail}"; |
| 1073 | - if ( $bbbsession['managerecordings'] ) { |
|
| 1073 | + if ($bbbsession['managerecordings']) { |
|
| 1074 | 1074 | $row->actionbar = $actionbar; |
| 1075 | 1075 | } |
| 1076 | 1076 | } |
@@ -1096,21 +1096,21 @@ discard block |
||
| 1096 | 1096 | array("key" =>"duration", "label" => $view_recording_duration, "width" => "50px") |
| 1097 | 1097 | ); |
| 1098 | 1098 | |
| 1099 | - if ( $bbbsession['managerecordings'] ) { |
|
| 1099 | + if ($bbbsession['managerecordings']) { |
|
| 1100 | 1100 | array_push($recordingsbn_columns, array("key" =>"actionbar", "label" => $view_recording_actionbar, "width" => "75px", "allowHTML" => true)); |
| 1101 | 1101 | } |
| 1102 | 1102 | |
| 1103 | 1103 | return $recordingsbn_columns; |
| 1104 | 1104 | } |
| 1105 | 1105 | |
| 1106 | -function bigbluebuttonbn_get_recording_data($bbbsession, $recordings, $tools=["publishing", "deleting"]) { |
|
| 1106 | +function bigbluebuttonbn_get_recording_data($bbbsession, $recordings, $tools = ["publishing", "deleting"]) { |
|
| 1107 | 1107 | $table_data = array(); |
| 1108 | 1108 | |
| 1109 | 1109 | ///Build table content |
| 1110 | - if ( isset($recordings) && !array_key_exists('messageKey', $recordings)) { // There are recordings for this meeting |
|
| 1111 | - foreach ( $recordings as $recording ) { |
|
| 1110 | + if (isset($recordings) && !array_key_exists('messageKey', $recordings)) { // There are recordings for this meeting |
|
| 1111 | + foreach ($recordings as $recording) { |
|
| 1112 | 1112 | $row = bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools); |
| 1113 | - if( $row != null ) { |
|
| 1113 | + if ($row != null) { |
|
| 1114 | 1114 | array_push($table_data, $row); |
| 1115 | 1115 | } |
| 1116 | 1116 | } |
@@ -1119,7 +1119,7 @@ discard block |
||
| 1119 | 1119 | return $table_data; |
| 1120 | 1120 | } |
| 1121 | 1121 | |
| 1122 | -function bigbluebuttonbn_get_recording_table($bbbsession, $recordings, $tools=['publishing','deleting']) { |
|
| 1122 | +function bigbluebuttonbn_get_recording_table($bbbsession, $recordings, $tools = ['publishing', 'deleting']) { |
|
| 1123 | 1123 | global $OUTPUT, $CFG; |
| 1124 | 1124 | |
| 1125 | 1125 | ///Set strings to show |
@@ -1138,20 +1138,20 @@ discard block |
||
| 1138 | 1138 | $table->data = array(); |
| 1139 | 1139 | |
| 1140 | 1140 | ///Initialize table headers |
| 1141 | - if ( $bbbsession['managerecordings'] ) { |
|
| 1142 | - $table->head = array ($view_recording_recording, $view_recording_activity, $view_recording_description, $view_recording_date, $view_recording_duration, $view_recording_actionbar); |
|
| 1143 | - $table->align = array ('left', 'left', 'left', 'left', 'center', 'left'); |
|
| 1141 | + if ($bbbsession['managerecordings']) { |
|
| 1142 | + $table->head = array($view_recording_recording, $view_recording_activity, $view_recording_description, $view_recording_date, $view_recording_duration, $view_recording_actionbar); |
|
| 1143 | + $table->align = array('left', 'left', 'left', 'left', 'center', 'left'); |
|
| 1144 | 1144 | } else { |
| 1145 | - $table->head = array ($view_recording_recording, $view_recording_activity, $view_recording_description, $view_recording_date, $view_recording_duration); |
|
| 1146 | - $table->align = array ('left', 'left', 'left', 'left', 'center'); |
|
| 1145 | + $table->head = array($view_recording_recording, $view_recording_activity, $view_recording_description, $view_recording_date, $view_recording_duration); |
|
| 1146 | + $table->align = array('left', 'left', 'left', 'left', 'center'); |
|
| 1147 | 1147 | } |
| 1148 | 1148 | |
| 1149 | 1149 | ///Build table content |
| 1150 | - if ( isset($recordings) && !array_key_exists('messageKey', $recordings)) { // There are recordings for this meeting |
|
| 1151 | - foreach ( $recordings as $recording ){ |
|
| 1150 | + if (isset($recordings) && !array_key_exists('messageKey', $recordings)) { // There are recordings for this meeting |
|
| 1151 | + foreach ($recordings as $recording) { |
|
| 1152 | 1152 | $row = new html_table_row(); |
| 1153 | - $row->id = 'recording-td-'.$recording['recordID']; |
|
| 1154 | - if ( isset($recording['imported']) ) { |
|
| 1153 | + $row->id = 'recording-td-' . $recording['recordID']; |
|
| 1154 | + if (isset($recording['imported'])) { |
|
| 1155 | 1155 | $row->attributes['data-imported'] = 'true'; |
| 1156 | 1156 | $row->attributes['title'] = get_string('view_recording_link_warning', 'bigbluebuttonbn'); |
| 1157 | 1157 | } else { |
@@ -1159,12 +1159,12 @@ discard block |
||
| 1159 | 1159 | } |
| 1160 | 1160 | |
| 1161 | 1161 | $row_data = bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools); |
| 1162 | - if( $row_data != null ) { |
|
| 1162 | + if ($row_data != null) { |
|
| 1163 | 1163 | $row_data->date_formatted = str_replace(" ", " ", $row_data->date_formatted); |
| 1164 | - if ( $bbbsession['managerecordings'] ) { |
|
| 1165 | - $row->cells = array ($row_data->recording, $row_data->activity, $row_data->description, $row_data->date_formatted, $row_data->duration_formatted, $row_data->actionbar ); |
|
| 1164 | + if ($bbbsession['managerecordings']) { |
|
| 1165 | + $row->cells = array($row_data->recording, $row_data->activity, $row_data->description, $row_data->date_formatted, $row_data->duration_formatted, $row_data->actionbar); |
|
| 1166 | 1166 | } else { |
| 1167 | - $row->cells = array ($row_data->recording, $row_data->activity, $row_data->description, $row_data->date_formatted, $row_data->duration_formatted ); |
|
| 1167 | + $row->cells = array($row_data->recording, $row_data->activity, $row_data->description, $row_data->date_formatted, $row_data->duration_formatted); |
|
| 1168 | 1168 | } |
| 1169 | 1169 | |
| 1170 | 1170 | array_push($table->data, $row); |
@@ -1184,12 +1184,12 @@ discard block |
||
| 1184 | 1184 | /// Build the message_body |
| 1185 | 1185 | $msg->activity_type = ""; |
| 1186 | 1186 | $msg->activity_title = $bigbluebuttonbn->name; |
| 1187 | - $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>'; |
|
| 1187 | + $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>'; |
|
| 1188 | 1188 | |
| 1189 | 1189 | bigbluebuttonbn_send_notification($sender, $bigbluebuttonbn, $message_text); |
| 1190 | 1190 | } |
| 1191 | 1191 | |
| 1192 | -function bigbluebuttonbn_server_offers($capability_name){ |
|
| 1192 | +function bigbluebuttonbn_server_offers($capability_name) { |
|
| 1193 | 1193 | global $CFG; |
| 1194 | 1194 | |
| 1195 | 1195 | $capability_offered = null; |
@@ -1203,12 +1203,12 @@ discard block |
||
| 1203 | 1203 | $host_ends = explode(".", $host); |
| 1204 | 1204 | $host_ends_length = count($host_ends); |
| 1205 | 1205 | |
| 1206 | - if( $host_ends_length > 0 && $host_ends[$host_ends_length -1] == 'com' && $host_ends[$host_ends_length -2] == 'blindsidenetworks' ) { |
|
| 1206 | + if ($host_ends_length > 0 && $host_ends[$host_ends_length - 1] == 'com' && $host_ends[$host_ends_length - 2] == 'blindsidenetworks') { |
|
| 1207 | 1207 | //Validate the capabilities offered |
| 1208 | - $capabilities = bigbluebuttonbn_getCapabilitiesArray( $endpoint, $shared_secret ); |
|
| 1209 | - if( $capabilities ) { |
|
| 1208 | + $capabilities = bigbluebuttonbn_getCapabilitiesArray($endpoint, $shared_secret); |
|
| 1209 | + if ($capabilities) { |
|
| 1210 | 1210 | foreach ($capabilities as $capability) { |
| 1211 | - if( $capability["name"] == $capability_name) |
|
| 1211 | + if ($capability["name"] == $capability_name) |
|
| 1212 | 1212 | $capability_offered = $capability; |
| 1213 | 1213 | } |
| 1214 | 1214 | } |
@@ -1217,14 +1217,14 @@ discard block |
||
| 1217 | 1217 | return $capability_offered; |
| 1218 | 1218 | } |
| 1219 | 1219 | |
| 1220 | -function bigbluebuttonbn_server_offers_bn_capabilities(){ |
|
| 1220 | +function bigbluebuttonbn_server_offers_bn_capabilities() { |
|
| 1221 | 1221 | //Validates if the server may have extended capabilities |
| 1222 | 1222 | $parsed_url = parse_url(bigbluebuttonbn_get_cfg_server_url()); |
| 1223 | 1223 | $host = isset($parsed_url['host']) ? $parsed_url['host'] : ''; |
| 1224 | 1224 | $host_ends = explode(".", $host); |
| 1225 | 1225 | $host_ends_length = count($host_ends); |
| 1226 | 1226 | |
| 1227 | - return ( $host_ends_length > 0 && $host_ends[$host_ends_length -1] == 'com' && $host_ends[$host_ends_length -2] == 'blindsidenetworks' ); |
|
| 1227 | + return ($host_ends_length > 0 && $host_ends[$host_ends_length - 1] == 'com' && $host_ends[$host_ends_length - 2] == 'blindsidenetworks'); |
|
| 1228 | 1228 | } |
| 1229 | 1229 | |
| 1230 | 1230 | function bigbluebuttonbn_get_locales_for_ui() { |
@@ -1267,89 +1267,89 @@ discard block |
||
| 1267 | 1267 | |
| 1268 | 1268 | function bigbluebuttonbn_get_cfg_server_url_default() { |
| 1269 | 1269 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1270 | - 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/'))); |
|
| 1270 | + 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/'))); |
|
| 1271 | 1271 | } |
| 1272 | 1272 | |
| 1273 | 1273 | function bigbluebuttonbn_get_cfg_shared_secret_default() { |
| 1274 | 1274 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1275 | - 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'))); |
|
| 1275 | + 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'))); |
|
| 1276 | 1276 | } |
| 1277 | 1277 | |
| 1278 | 1278 | function bigbluebuttonbn_get_cfg_voicebridge_editable() { |
| 1279 | 1279 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1280 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_voicebridge_editable)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_voicebridge_editable: (isset($CFG->bigbluebuttonbn_voicebridge_editable)? $CFG->bigbluebuttonbn_voicebridge_editable: false)); |
|
| 1280 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_voicebridge_editable) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_voicebridge_editable : (isset($CFG->bigbluebuttonbn_voicebridge_editable) ? $CFG->bigbluebuttonbn_voicebridge_editable : false)); |
|
| 1281 | 1281 | } |
| 1282 | 1282 | |
| 1283 | 1283 | function bigbluebuttonbn_get_cfg_recording_default() { |
| 1284 | 1284 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1285 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_default)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_default: (isset($CFG->bigbluebuttonbn_recording_default)? $CFG->bigbluebuttonbn_recording_default: true)); |
|
| 1285 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_default) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_default : (isset($CFG->bigbluebuttonbn_recording_default) ? $CFG->bigbluebuttonbn_recording_default : true)); |
|
| 1286 | 1286 | } |
| 1287 | 1287 | |
| 1288 | 1288 | function bigbluebuttonbn_get_cfg_recording_editable() { |
| 1289 | 1289 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1290 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_editable)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_editable: (isset($CFG->bigbluebuttonbn_recording_editable)? $CFG->bigbluebuttonbn_recording_editable: true)); |
|
| 1290 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_editable) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_editable : (isset($CFG->bigbluebuttonbn_recording_editable) ? $CFG->bigbluebuttonbn_recording_editable : true)); |
|
| 1291 | 1291 | } |
| 1292 | 1292 | |
| 1293 | 1293 | function bigbluebuttonbn_get_cfg_recording_tagging_default() { |
| 1294 | 1294 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1295 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_default)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_default: (isset($CFG->bigbluebuttonbn_recordingtagging_default)? $CFG->bigbluebuttonbn_recordingtagging_default: false)); |
|
| 1295 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_default) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_default : (isset($CFG->bigbluebuttonbn_recordingtagging_default) ? $CFG->bigbluebuttonbn_recordingtagging_default : false)); |
|
| 1296 | 1296 | } |
| 1297 | 1297 | |
| 1298 | 1298 | function bigbluebuttonbn_get_cfg_recording_tagging_editable() { |
| 1299 | 1299 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1300 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_editable)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_editable: (isset($CFG->bigbluebuttonbn_recordingtagging_editable)? $CFG->bigbluebuttonbn_recordingtagging_editable: false)); |
|
| 1300 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_editable) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_editable : (isset($CFG->bigbluebuttonbn_recordingtagging_editable) ? $CFG->bigbluebuttonbn_recordingtagging_editable : false)); |
|
| 1301 | 1301 | } |
| 1302 | 1302 | |
| 1303 | 1303 | function bigbluebuttonbn_get_cfg_recording_icons_enabled() { |
| 1304 | 1304 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1305 | - 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)); |
|
| 1305 | + 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)); |
|
| 1306 | 1306 | } |
| 1307 | 1307 | |
| 1308 | 1308 | function bigbluebuttonbn_get_cfg_importrecordings_enabled() { |
| 1309 | 1309 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1310 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_enabled)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_enabled: (isset($CFG->bigbluebuttonbn_importrecordings_enabled)? $CFG->bigbluebuttonbn_importrecordings_enabled: false)); |
|
| 1310 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_enabled) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_enabled : (isset($CFG->bigbluebuttonbn_importrecordings_enabled) ? $CFG->bigbluebuttonbn_importrecordings_enabled : false)); |
|
| 1311 | 1311 | } |
| 1312 | 1312 | |
| 1313 | 1313 | function bigbluebuttonbn_get_cfg_importrecordings_from_deleted_activities_enabled() { |
| 1314 | 1314 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1315 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled: (isset($CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled)? $CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled: false)); |
|
| 1315 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled : (isset($CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled) ? $CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled : false)); |
|
| 1316 | 1316 | } |
| 1317 | 1317 | |
| 1318 | 1318 | function bigbluebuttonbn_get_cfg_waitformoderator_default() { |
| 1319 | 1319 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1320 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_default)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_default: (isset($CFG->bigbluebuttonbn_waitformoderator_default)? $CFG->bigbluebuttonbn_waitformoderator_default: false)); |
|
| 1320 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_default) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_default : (isset($CFG->bigbluebuttonbn_waitformoderator_default) ? $CFG->bigbluebuttonbn_waitformoderator_default : false)); |
|
| 1321 | 1321 | } |
| 1322 | 1322 | |
| 1323 | 1323 | function bigbluebuttonbn_get_cfg_waitformoderator_editable() { |
| 1324 | 1324 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1325 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_editable)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_editable: (isset($CFG->bigbluebuttonbn_waitformoderator_editable)? $CFG->bigbluebuttonbn_waitformoderator_editable: true)); |
|
| 1325 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_editable) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_editable : (isset($CFG->bigbluebuttonbn_waitformoderator_editable) ? $CFG->bigbluebuttonbn_waitformoderator_editable : true)); |
|
| 1326 | 1326 | } |
| 1327 | 1327 | |
| 1328 | 1328 | function bigbluebuttonbn_get_cfg_waitformoderator_ping_interval() { |
| 1329 | 1329 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1330 | - 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)); |
|
| 1330 | + 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)); |
|
| 1331 | 1331 | } |
| 1332 | 1332 | |
| 1333 | 1333 | function bigbluebuttonbn_get_cfg_waitformoderator_cache_ttl() { |
| 1334 | 1334 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1335 | - 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)); |
|
| 1335 | + 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)); |
|
| 1336 | 1336 | } |
| 1337 | 1337 | |
| 1338 | 1338 | function bigbluebuttonbn_get_cfg_userlimit_default() { |
| 1339 | 1339 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1340 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_default)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_default: (isset($CFG->bigbluebuttonbn_userlimit_default)? $CFG->bigbluebuttonbn_userlimit_default: 0)); |
|
| 1340 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_default) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_default : (isset($CFG->bigbluebuttonbn_userlimit_default) ? $CFG->bigbluebuttonbn_userlimit_default : 0)); |
|
| 1341 | 1341 | } |
| 1342 | 1342 | |
| 1343 | 1343 | function bigbluebuttonbn_get_cfg_userlimit_editable() { |
| 1344 | 1344 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1345 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_editable)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_editable: (isset($CFG->bigbluebuttonbn_userlimit_editable)? $CFG->bigbluebuttonbn_userlimit_editable: false)); |
|
| 1345 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_editable) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_editable : (isset($CFG->bigbluebuttonbn_userlimit_editable) ? $CFG->bigbluebuttonbn_userlimit_editable : false)); |
|
| 1346 | 1346 | } |
| 1347 | 1347 | |
| 1348 | 1348 | function bigbluebuttonbn_get_cfg_preuploadpresentation_enabled() { |
| 1349 | 1349 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1350 | 1350 | if (extension_loaded('curl')) { |
| 1351 | 1351 | // This feature only works if curl is installed |
| 1352 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_preuploadpresentation_enabled)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_preuploadpresentation_enabled: (isset($CFG->bigbluebuttonbn_preuploadpresentation_enabled)? $CFG->bigbluebuttonbn_preuploadpresentation_enabled: false)); |
|
| 1352 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_preuploadpresentation_enabled) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_preuploadpresentation_enabled : (isset($CFG->bigbluebuttonbn_preuploadpresentation_enabled) ? $CFG->bigbluebuttonbn_preuploadpresentation_enabled : false)); |
|
| 1353 | 1353 | } else { |
| 1354 | 1354 | return false; |
| 1355 | 1355 | } |
@@ -1357,37 +1357,37 @@ discard block |
||
| 1357 | 1357 | |
| 1358 | 1358 | function bigbluebuttonbn_get_cfg_sendnotifications_enabled() { |
| 1359 | 1359 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1360 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_sendnotifications_enabled)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_sendnotifications_enabled: (isset($CFG->bigbluebuttonbn_sendnotifications_enabled)? $CFG->bigbluebuttonbn_sendnotifications_enabled: false)); |
|
| 1360 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_sendnotifications_enabled) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_sendnotifications_enabled : (isset($CFG->bigbluebuttonbn_sendnotifications_enabled) ? $CFG->bigbluebuttonbn_sendnotifications_enabled : false)); |
|
| 1361 | 1361 | } |
| 1362 | 1362 | |
| 1363 | 1363 | function bigbluebuttonbn_get_cfg_recordingready_enabled() { |
| 1364 | 1364 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1365 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingready_enabled)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingready_enabled: (isset($CFG->bigbluebuttonbn_recordingready_enabled)? $CFG->bigbluebuttonbn_recordingready_enabled: false)); |
|
| 1365 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingready_enabled) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingready_enabled : (isset($CFG->bigbluebuttonbn_recordingready_enabled) ? $CFG->bigbluebuttonbn_recordingready_enabled : false)); |
|
| 1366 | 1366 | } |
| 1367 | 1367 | |
| 1368 | 1368 | function bigbluebuttonbn_get_cfg_moderator_default() { |
| 1369 | 1369 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1370 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_moderator_default)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_moderator_default: (isset($CFG->bigbluebuttonbn_moderator_default)? $CFG->bigbluebuttonbn_moderator_default: 'owner')); |
|
| 1370 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_moderator_default) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_moderator_default : (isset($CFG->bigbluebuttonbn_moderator_default) ? $CFG->bigbluebuttonbn_moderator_default : 'owner')); |
|
| 1371 | 1371 | } |
| 1372 | 1372 | |
| 1373 | 1373 | function bigbluebuttonbn_get_cfg_scheduled_duration_enabled() { |
| 1374 | 1374 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1375 | - 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)); |
|
| 1375 | + 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)); |
|
| 1376 | 1376 | } |
| 1377 | 1377 | |
| 1378 | 1378 | function bigbluebuttonbn_get_cfg_scheduled_duration_compensation() { |
| 1379 | 1379 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1380 | - 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)); |
|
| 1380 | + 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)); |
|
| 1381 | 1381 | } |
| 1382 | 1382 | |
| 1383 | 1383 | function bigbluebuttonbn_get_cfg_scheduled_pre_opening() { |
| 1384 | 1384 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1385 | - 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)); |
|
| 1385 | + 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)); |
|
| 1386 | 1386 | } |
| 1387 | 1387 | |
| 1388 | 1388 | function bigbluebuttonbn_import_get_courses_for_select(array $bbbsession) { |
| 1389 | 1389 | |
| 1390 | - if( $bbbsession['administrator'] ) { |
|
| 1390 | + if ($bbbsession['administrator']) { |
|
| 1391 | 1391 | $courses = get_courses('all', 'c.id ASC', 'c.id,c.shortname,c.fullname'); |
| 1392 | 1392 | //It includes the name of the site as a course (category 0), so remove the first one |
| 1393 | 1393 | unset($courses["1"]); |
@@ -1396,21 +1396,21 @@ discard block |
||
| 1396 | 1396 | } |
| 1397 | 1397 | |
| 1398 | 1398 | $courses_for_select = []; |
| 1399 | - foreach($courses as $course) { |
|
| 1400 | - if( $course->id != $bbbsession['course']->id ) { |
|
| 1399 | + foreach ($courses as $course) { |
|
| 1400 | + if ($course->id != $bbbsession['course']->id) { |
|
| 1401 | 1401 | $courses_for_select[$course->id] = $course->fullname; |
| 1402 | 1402 | } |
| 1403 | 1403 | } |
| 1404 | 1404 | return $courses_for_select; |
| 1405 | 1405 | } |
| 1406 | 1406 | |
| 1407 | -function bigbluebuttonbn_getRecordedMeetingsDeleted($courseID, $bigbluebuttonbnID=NULL) { |
|
| 1407 | +function bigbluebuttonbn_getRecordedMeetingsDeleted($courseID, $bigbluebuttonbnID = NULL) { |
|
| 1408 | 1408 | global $DB; |
| 1409 | 1409 | |
| 1410 | 1410 | $records_deleted = array(); |
| 1411 | 1411 | |
| 1412 | - $filter = array('courseid' => $courseID, 'log' => BIGBLUEBUTTONBN_LOG_EVENT_DELETE ); |
|
| 1413 | - if ( $bigbluebuttonbnID != NULL ) { |
|
| 1412 | + $filter = array('courseid' => $courseID, 'log' => BIGBLUEBUTTONBN_LOG_EVENT_DELETE); |
|
| 1413 | + if ($bigbluebuttonbnID != NULL) { |
|
| 1414 | 1414 | $filter['id'] = $bigbluebuttonbnID; |
| 1415 | 1415 | } |
| 1416 | 1416 | |
@@ -1419,17 +1419,17 @@ discard block |
||
| 1419 | 1419 | foreach ($bigbluebuttonbns_deleted as $key => $bigbluebuttonbn_deleted) { |
| 1420 | 1420 | $records = $DB->get_records('bigbluebuttonbn_logs', array('courseid' => $courseID, 'log' => BIGBLUEBUTTONBN_LOG_EVENT_CREATE)); |
| 1421 | 1421 | |
| 1422 | - if( !empty($records) ) { |
|
| 1422 | + if (!empty($records)) { |
|
| 1423 | 1423 | //Remove duplicates |
| 1424 | 1424 | $unique_records = array(); |
| 1425 | 1425 | foreach ($records as $key => $record) { |
| 1426 | - if (array_key_exists($record->meetingid, $unique_records) ) { |
|
| 1426 | + if (array_key_exists($record->meetingid, $unique_records)) { |
|
| 1427 | 1427 | unset($records[$key]); |
| 1428 | 1428 | } else { |
| 1429 | 1429 | $meta = json_decode($record->meta); |
| 1430 | - if ( !$meta->record ) { |
|
| 1430 | + if (!$meta->record) { |
|
| 1431 | 1431 | unset($records[$key]); |
| 1432 | - } else if ( $bigbluebuttonbn_deleted->meetingid != substr($record->meetingid, 0, strlen($bigbluebuttonbn_deleted->meetingid))) { |
|
| 1432 | + } else if ($bigbluebuttonbn_deleted->meetingid != substr($record->meetingid, 0, strlen($bigbluebuttonbn_deleted->meetingid))) { |
|
| 1433 | 1433 | unset($records[$key]); |
| 1434 | 1434 | } else { |
| 1435 | 1435 | array_push($unique_records, $record->meetingid); |
@@ -1444,27 +1444,27 @@ discard block |
||
| 1444 | 1444 | return $records_deleted; |
| 1445 | 1445 | } |
| 1446 | 1446 | |
| 1447 | -function bigbluebuttonbn_getRecordedMeetings($courseID, $bigbluebuttonbnID=NULL) { |
|
| 1447 | +function bigbluebuttonbn_getRecordedMeetings($courseID, $bigbluebuttonbnID = NULL) { |
|
| 1448 | 1448 | global $DB; |
| 1449 | 1449 | |
| 1450 | 1450 | $records = Array(); |
| 1451 | 1451 | |
| 1452 | 1452 | $filter = array('course' => $courseID); |
| 1453 | - if ( $bigbluebuttonbnID != NULL ) { |
|
| 1453 | + if ($bigbluebuttonbnID != NULL) { |
|
| 1454 | 1454 | $filter['id'] = $bigbluebuttonbnID; |
| 1455 | 1455 | } |
| 1456 | 1456 | $bigbluebuttonbns = $DB->get_records('bigbluebuttonbn', $filter); |
| 1457 | 1457 | |
| 1458 | - if ( !empty($bigbluebuttonbns) ) { |
|
| 1458 | + if (!empty($bigbluebuttonbns)) { |
|
| 1459 | 1459 | $table = 'bigbluebuttonbn_logs'; |
| 1460 | 1460 | |
| 1461 | 1461 | //Prepare select for loading records based on existent bigbluebuttonbns |
| 1462 | 1462 | $select = ""; |
| 1463 | 1463 | foreach ($bigbluebuttonbns as $key => $bigbluebuttonbn) { |
| 1464 | - $select .= strlen($select) == 0? "(": " OR "; |
|
| 1465 | - $select .= "bigbluebuttonbnid=".$bigbluebuttonbn->id; |
|
| 1464 | + $select .= strlen($select) == 0 ? "(" : " OR "; |
|
| 1465 | + $select .= "bigbluebuttonbnid=" . $bigbluebuttonbn->id; |
|
| 1466 | 1466 | } |
| 1467 | - $select .= ") AND log='".BIGBLUEBUTTONBN_LOG_EVENT_CREATE."'"; |
|
| 1467 | + $select .= ") AND log='" . BIGBLUEBUTTONBN_LOG_EVENT_CREATE . "'"; |
|
| 1468 | 1468 | |
| 1469 | 1469 | //Execute select for loading records based on existent bigbluebuttonbns |
| 1470 | 1470 | $records = $DB->get_records_select($table, $select); |
@@ -1472,8 +1472,8 @@ discard block |
||
| 1472 | 1472 | //Remove duplicates |
| 1473 | 1473 | $unique_records = array(); |
| 1474 | 1474 | foreach ($records as $key => $record) { |
| 1475 | - $record_key = $record->meetingid.','.$record->bigbluebuttonbnid.','.$record->meta; |
|
| 1476 | - if( array_search($record_key, $unique_records) === false ) { |
|
| 1475 | + $record_key = $record->meetingid . ',' . $record->bigbluebuttonbnid . ',' . $record->meta; |
|
| 1476 | + if (array_search($record_key, $unique_records) === false) { |
|
| 1477 | 1477 | array_push($unique_records, $record_key); |
| 1478 | 1478 | } else { |
| 1479 | 1479 | unset($records[$key]); |
@@ -1483,7 +1483,7 @@ discard block |
||
| 1483 | 1483 | //Remove the ones with record=false |
| 1484 | 1484 | foreach ($records as $key => $record) { |
| 1485 | 1485 | $meta = json_decode($record->meta); |
| 1486 | - if ( !$meta || !$meta->record ) { |
|
| 1486 | + if (!$meta || !$meta->record) { |
|
| 1487 | 1487 | unset($records[$key]); |
| 1488 | 1488 | } |
| 1489 | 1489 | } |
@@ -1497,15 +1497,15 @@ discard block |
||
| 1497 | 1497 | |
| 1498 | 1498 | // Load the meetingIDs to be used in the getRecordings request |
| 1499 | 1499 | $meetingID = ''; |
| 1500 | - if ( is_numeric($courseID) ) { |
|
| 1500 | + if (is_numeric($courseID)) { |
|
| 1501 | 1501 | $results = bigbluebuttonbn_getRecordedMeetings($courseID); |
| 1502 | 1502 | |
| 1503 | - if( bigbluebuttonbn_get_cfg_importrecordings_from_deleted_activities_enabled() ) { |
|
| 1503 | + if (bigbluebuttonbn_get_cfg_importrecordings_from_deleted_activities_enabled()) { |
|
| 1504 | 1504 | $results_deleted = bigbluebuttonbn_getRecordedMeetingsDeleted($courseID); |
| 1505 | 1505 | $results = array_merge($results, $results_deleted); |
| 1506 | 1506 | } |
| 1507 | 1507 | |
| 1508 | - if( $results ) { |
|
| 1508 | + if ($results) { |
|
| 1509 | 1509 | //Eliminates duplicates |
| 1510 | 1510 | $mIDs = array(); |
| 1511 | 1511 | foreach ($results as $result) { |
@@ -1520,7 +1520,7 @@ discard block |
||
| 1520 | 1520 | } |
| 1521 | 1521 | |
| 1522 | 1522 | // If there were meetingIDs excecute the getRecordings request |
| 1523 | - if ( $meetingID != '' ) { |
|
| 1523 | + if ($meetingID != '') { |
|
| 1524 | 1524 | $recordings = bigbluebuttonbn_getRecordingsArray($meetingID, $URL, $SALT); |
| 1525 | 1525 | } |
| 1526 | 1526 | |
@@ -1543,37 +1543,37 @@ discard block |
||
| 1543 | 1543 | $recordings_already_imported_indexed = bigbluebuttonbn_index_recordings($recordings_already_imported); |
| 1544 | 1544 | |
| 1545 | 1545 | foreach ($recordings as $key => $recording) { |
| 1546 | - if( isset($recordings_already_imported_indexed[$recording['recordID']]) ) { |
|
| 1546 | + if (isset($recordings_already_imported_indexed[$recording['recordID']])) { |
|
| 1547 | 1547 | unset($recordings[$key]); |
| 1548 | 1548 | } |
| 1549 | 1549 | } |
| 1550 | 1550 | return $recordings; |
| 1551 | 1551 | } |
| 1552 | 1552 | |
| 1553 | -function bigbluebutton_output_recording_table($bbbsession, $recordings, $tools=['publishing','deleting']) { |
|
| 1553 | +function bigbluebutton_output_recording_table($bbbsession, $recordings, $tools = ['publishing', 'deleting']) { |
|
| 1554 | 1554 | |
| 1555 | - if ( isset($recordings) && !empty($recordings) ) { // There are recordings for this meeting |
|
| 1555 | + if (isset($recordings) && !empty($recordings)) { // There are recordings for this meeting |
|
| 1556 | 1556 | $table = bigbluebuttonbn_get_recording_table($bbbsession, $recordings, $tools); |
| 1557 | 1557 | } |
| 1558 | 1558 | |
| 1559 | 1559 | $output = ''; |
| 1560 | - if( isset($table->data) ) { |
|
| 1560 | + if (isset($table->data)) { |
|
| 1561 | 1561 | //Print the table |
| 1562 | - $output .= '<div id="bigbluebuttonbn_html_table">'."\n"; |
|
| 1563 | - $output .= html_writer::table($table)."\n"; |
|
| 1564 | - $output .= '</div>'."\n"; |
|
| 1562 | + $output .= '<div id="bigbluebuttonbn_html_table">' . "\n"; |
|
| 1563 | + $output .= html_writer::table($table) . "\n"; |
|
| 1564 | + $output .= '</div>' . "\n"; |
|
| 1565 | 1565 | |
| 1566 | 1566 | } else { |
| 1567 | - $output .= get_string('view_message_norecordings', 'bigbluebuttonbn').'<br>'."\n"; |
|
| 1567 | + $output .= get_string('view_message_norecordings', 'bigbluebuttonbn') . '<br>' . "\n"; |
|
| 1568 | 1568 | } |
| 1569 | 1569 | |
| 1570 | 1570 | return $output; |
| 1571 | 1571 | } |
| 1572 | 1572 | |
| 1573 | -function bigbluebuttonbn_getRecordingsImported($courseID, $bigbluebuttonbnID=NULL) { |
|
| 1573 | +function bigbluebuttonbn_getRecordingsImported($courseID, $bigbluebuttonbnID = NULL) { |
|
| 1574 | 1574 | global $DB; |
| 1575 | 1575 | |
| 1576 | - if ( $bigbluebuttonbnID != NULL ) { |
|
| 1576 | + if ($bigbluebuttonbnID != NULL) { |
|
| 1577 | 1577 | // Fetch only those related to the $courseID and $bigbluebuttonbnID requested |
| 1578 | 1578 | $recordings_imported = $DB->get_records('bigbluebuttonbn_logs', array('courseid' => $courseID, 'bigbluebuttonbnid' => $bigbluebuttonbnID, 'log' => BIGBLUEBUTTONBN_LOG_EVENT_IMPORT)); |
| 1579 | 1579 | } else { |
@@ -1583,7 +1583,7 @@ discard block |
||
| 1583 | 1583 | return $recordings_imported; |
| 1584 | 1584 | } |
| 1585 | 1585 | |
| 1586 | -function bigbluebuttonbn_getRecordingsImportedArray($courseID, $bigbluebuttonbnID=NULL) { |
|
| 1586 | +function bigbluebuttonbn_getRecordingsImportedArray($courseID, $bigbluebuttonbnID = NULL) { |
|
| 1587 | 1587 | $recordings_imported = bigbluebuttonbn_getRecordingsImported($courseID, $bigbluebuttonbnID); |
| 1588 | 1588 | $recordings_imported_array = bigbluebuttonbn_import_get_recordings_imported($recordings_imported); |
| 1589 | 1589 | return $recordings_imported_array; |
@@ -1592,7 +1592,7 @@ discard block |
||
| 1592 | 1592 | function bigbluebuttonbn_getRecordingsImportedAllInstances($recordID) { |
| 1593 | 1593 | global $DB, $CFG; |
| 1594 | 1594 | |
| 1595 | - $recordings_imported = $DB->get_records_sql('SELECT * FROM '.$CFG->prefix.'bigbluebuttonbn_logs WHERE log=? AND '.$DB->sql_like('meta', '?'), array( BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, '%'.$recordID.'%' )); |
|
| 1595 | + $recordings_imported = $DB->get_records_sql('SELECT * FROM ' . $CFG->prefix . 'bigbluebuttonbn_logs WHERE log=? AND ' . $DB->sql_like('meta', '?'), array(BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, '%' . $recordID . '%')); |
|
| 1596 | 1596 | return $recordings_imported; |
| 1597 | 1597 | } |
| 1598 | 1598 | |
@@ -1611,8 +1611,8 @@ discard block |
||
| 1611 | 1611 | function bigbluebuttonbn_html2text($html, $len) { |
| 1612 | 1612 | $text = strip_tags($html); |
| 1613 | 1613 | $text = str_replace(" ", ' ', $text); |
| 1614 | - if( strlen($text) > $len ) |
|
| 1615 | - $text = substr($text, 0, $len)."..."; |
|
| 1614 | + if (strlen($text) > $len) |
|
| 1615 | + $text = substr($text, 0, $len) . "..."; |
|
| 1616 | 1616 | else |
| 1617 | 1617 | $text = substr($text, 0, $len); |
| 1618 | 1618 | return $text; |
@@ -119,8 +119,9 @@ |
||
| 119 | 119 | //Execute the end command |
| 120 | 120 | $meeting_info = bigbluebuttonbn_bbb_broker_do_end_meeting($params['id'], $bbbsession['modPW']); |
| 121 | 121 | // Moodle event logger: Create an event for meeting ended |
| 122 | - if( isset($bigbluebuttonbn) ) |
|
| 123 | - bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_ENDED, $bigbluebuttonbn, $context, $cm); |
|
| 122 | + if( isset($bigbluebuttonbn) ) { |
|
| 123 | + bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_ENDED, $bigbluebuttonbn, $context, $cm); |
|
| 124 | + } |
|
| 124 | 125 | /// Update the cache |
| 125 | 126 | $meeting_info = bigbluebuttonbn_bbb_broker_get_meeting_info($params['id'], $bbbsession['modPW'], true); |
| 126 | 127 | |
@@ -8,15 +8,15 @@ 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 | 14 | global $PAGE, $USER, $CFG, $SESSION, $DB; |
| 15 | 15 | |
| 16 | -$params['action'] = optional_param('action', '', PARAM_TEXT); |
|
| 16 | +$params['action'] = optional_param('action', '', PARAM_TEXT); |
|
| 17 | 17 | $params['callback'] = optional_param('callback', '', PARAM_TEXT); |
| 18 | -$params['id'] = optional_param('id', '', PARAM_TEXT); //recordID, the BBB recordID |
|
| 19 | -$params['idx'] = optional_param('idx', '', PARAM_TEXT); //meetingID, the BBB meetingID |
|
| 18 | +$params['id'] = optional_param('id', '', PARAM_TEXT); //recordID, the BBB recordID |
|
| 19 | +$params['idx'] = optional_param('idx', '', PARAM_TEXT); //meetingID, the BBB meetingID |
|
| 20 | 20 | $params['bigbluebuttonbn'] = optional_param('bigbluebuttonbn', 0, PARAM_INT); |
| 21 | 21 | $params['signed_parameters'] = optional_param('signed_parameters', '', PARAM_TEXT); |
| 22 | 22 | |
@@ -25,13 +25,13 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | $error = ''; |
| 27 | 27 | |
| 28 | -if( empty($params['action']) ) { |
|
| 28 | +if (empty($params['action'])) { |
|
| 29 | 29 | $error = bigbluebuttonbn_bbb_broker_add_error($error, "Parameter [action] was not included"); |
| 30 | 30 | |
| 31 | 31 | } else { |
| 32 | 32 | $error = bigbluebuttonbn_bbb_broker_validate_parameters($params); |
| 33 | 33 | |
| 34 | - if( empty($error) && $params['action'] != "recording_ready" ) { |
|
| 34 | + if (empty($error) && $params['action'] != "recording_ready") { |
|
| 35 | 35 | |
| 36 | 36 | if ($params['bigbluebuttonbn'] != 0) { |
| 37 | 37 | $bigbluebuttonbn = $DB->get_record('bigbluebuttonbn', array('id' => $params['bigbluebuttonbn']), '*', MUST_EXIST); |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | $context = bigbluebuttonbn_get_context_module($cm->id); |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - if ( isset($SESSION->bigbluebuttonbn_bbbsession) && !is_null($SESSION->bigbluebuttonbn_bbbsession) ) { |
|
| 43 | + if (isset($SESSION->bigbluebuttonbn_bbbsession) && !is_null($SESSION->bigbluebuttonbn_bbbsession)) { |
|
| 44 | 44 | $bbbsession = $SESSION->bigbluebuttonbn_bbbsession; |
| 45 | 45 | } else { |
| 46 | 46 | $error = bigbluebuttonbn_bbb_broker_add_error($error, "No session variable set"); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | header('Content-Type: application/javascript; charset=utf-8'); |
| 52 | -if ( empty($error) ) { |
|
| 52 | +if (empty($error)) { |
|
| 53 | 53 | |
| 54 | 54 | if (!isloggedin() && $PAGE->course->id == SITEID) { |
| 55 | 55 | $userid = guest_user()->id; |
@@ -58,21 +58,21 @@ discard block |
||
| 58 | 58 | } |
| 59 | 59 | $hascourseaccess = ($PAGE->course->id == SITEID) || can_access_course($PAGE->course, $userid); |
| 60 | 60 | |
| 61 | - if( !$hascourseaccess ){ |
|
| 61 | + if (!$hascourseaccess) { |
|
| 62 | 62 | header("HTTP/1.0 401 Unauthorized"); |
| 63 | 63 | return; |
| 64 | 64 | } else { |
| 65 | 65 | try { |
| 66 | - switch ( strtolower($params['action']) ){ |
|
| 66 | + switch (strtolower($params['action'])) { |
|
| 67 | 67 | case 'meeting_info': |
| 68 | 68 | $meeting_info = bigbluebuttonbn_bbb_broker_get_meeting_info($params['id'], $bbbsession['modPW']); |
| 69 | 69 | $meeting_running = bigbluebuttonbn_bbb_broker_is_meeting_running($meeting_info); |
| 70 | 70 | |
| 71 | 71 | $status_can_end = ''; |
| 72 | 72 | $status_can_tag = ''; |
| 73 | - if( $meeting_running ) { |
|
| 73 | + if ($meeting_running) { |
|
| 74 | 74 | $join_button_text = get_string('view_conference_action_join', 'bigbluebuttonbn'); |
| 75 | - if( $bbbsession['userlimit'] == 0 || $meeting_info->participantCount < $bbbsession['userlimit'] ) { |
|
| 75 | + if ($bbbsession['userlimit'] == 0 || $meeting_info->participantCount < $bbbsession['userlimit']) { |
|
| 76 | 76 | $initial_message = get_string('view_message_conference_in_progress', 'bigbluebuttonbn'); |
| 77 | 77 | $can_join = true; |
| 78 | 78 | |
@@ -81,50 +81,50 @@ discard block |
||
| 81 | 81 | $can_join = false; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - if( $bbbsession['administrator'] || $bbbsession['moderator'] ) { |
|
| 84 | + if ($bbbsession['administrator'] || $bbbsession['moderator']) { |
|
| 85 | 85 | $end_button_text = get_string('view_conference_action_end', 'bigbluebuttonbn'); |
| 86 | 86 | $can_end = true; |
| 87 | - $status_can_end = '"can_end": true, "end_button_text": "'.$end_button_text.'", '; |
|
| 87 | + $status_can_end = '"can_end": true, "end_button_text": "' . $end_button_text . '", '; |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | } else { |
| 91 | 91 | // If user is administrator, moderator or if is viewer and no waiting is required |
| 92 | - if ( $bbbsession['administrator'] || $bbbsession['moderator'] || !$bbbsession['wait'] ) { |
|
| 92 | + if ($bbbsession['administrator'] || $bbbsession['moderator'] || !$bbbsession['wait']) { |
|
| 93 | 93 | $initial_message = get_string('view_message_conference_room_ready', 'bigbluebuttonbn'); |
| 94 | 94 | $join_button_text = get_string('view_conference_action_join', 'bigbluebuttonbn'); |
| 95 | 95 | $can_join = true; |
| 96 | 96 | |
| 97 | 97 | } else { |
| 98 | 98 | $initial_message = get_string('view_message_conference_not_started', 'bigbluebuttonbn'); |
| 99 | - if ( $bbbsession['wait'] ) { |
|
| 100 | - $initial_message .= ' '.get_string('view_message_conference_wait_for_moderator', 'bigbluebuttonbn'); |
|
| 99 | + if ($bbbsession['wait']) { |
|
| 100 | + $initial_message .= ' ' . get_string('view_message_conference_wait_for_moderator', 'bigbluebuttonbn'); |
|
| 101 | 101 | } |
| 102 | 102 | $join_button_text = get_string('view_conference_action_lineup', 'bigbluebuttonbn'); |
| 103 | 103 | $can_join = false; |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | - if( $bbbsession['tagging'] && ($bbbsession['administrator'] || $bbbsession['moderator']) ) { |
|
| 106 | + if ($bbbsession['tagging'] && ($bbbsession['administrator'] || $bbbsession['moderator'])) { |
|
| 107 | 107 | $can_tag = true; |
| 108 | 108 | |
| 109 | 109 | } else { |
| 110 | 110 | $can_tag = false; |
| 111 | 111 | } |
| 112 | - $status_can_end = '"can_tag": '.($can_tag? 'true': 'false').', '; |
|
| 112 | + $status_can_end = '"can_tag": ' . ($can_tag ? 'true' : 'false') . ', '; |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | - echo $params['callback'].'({ "running": '.($meeting_running? 'true':'false').', "info": '.json_encode($meeting_info).', "status": {"can_join": '.($can_join? 'true':'false').',"join_url": "'.$bbbsession['joinURL'].'","join_button_text": "'.$join_button_text.'", '.$status_can_end.$status_can_tag.'"message": "'.$initial_message.'"} });'; |
|
| 115 | + echo $params['callback'] . '({ "running": ' . ($meeting_running ? 'true' : 'false') . ', "info": ' . json_encode($meeting_info) . ', "status": {"can_join": ' . ($can_join ? 'true' : 'false') . ',"join_url": "' . $bbbsession['joinURL'] . '","join_button_text": "' . $join_button_text . '", ' . $status_can_end . $status_can_tag . '"message": "' . $initial_message . '"} });'; |
|
| 116 | 116 | break; |
| 117 | 117 | case 'meeting_end': |
| 118 | - if( $bbbsession['administrator'] || $bbbsession['moderator'] ) { |
|
| 118 | + if ($bbbsession['administrator'] || $bbbsession['moderator']) { |
|
| 119 | 119 | //Execute the end command |
| 120 | 120 | $meeting_info = bigbluebuttonbn_bbb_broker_do_end_meeting($params['id'], $bbbsession['modPW']); |
| 121 | 121 | // Moodle event logger: Create an event for meeting ended |
| 122 | - if( isset($bigbluebuttonbn) ) |
|
| 122 | + if (isset($bigbluebuttonbn)) |
|
| 123 | 123 | bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_ENDED, $bigbluebuttonbn, $context, $cm); |
| 124 | 124 | // Update the cache |
| 125 | 125 | $meeting_info = bigbluebuttonbn_bbb_broker_get_meeting_info($params['id'], $bbbsession['modPW'], true); |
| 126 | 126 | |
| 127 | - echo $params['callback'].'({ "status": true });'; |
|
| 127 | + echo $params['callback'] . '({ "status": true });'; |
|
| 128 | 128 | } else { |
| 129 | 129 | error_log("ERROR: User not authorized to execute end command"); |
| 130 | 130 | header("HTTP/1.0 401 Unauthorized. User not authorized to execute end command"); |
@@ -133,26 +133,26 @@ discard block |
||
| 133 | 133 | case 'recording_list': |
| 134 | 134 | break; |
| 135 | 135 | case 'recording_info': |
| 136 | - if( $bbbsession['managerecordings'] ) { |
|
| 136 | + if ($bbbsession['managerecordings']) { |
|
| 137 | 137 | //Retrieve the array of imported recordings |
| 138 | - $recordings_imported = bigbluebuttonbn_getRecordingsImportedArray($bbbsession['course']->id, isset($bbbsession['bigbluebuttonbn'])?$bbbsession['bigbluebuttonbn']->id: NULL); |
|
| 138 | + $recordings_imported = bigbluebuttonbn_getRecordingsImportedArray($bbbsession['course']->id, isset($bbbsession['bigbluebuttonbn']) ? $bbbsession['bigbluebuttonbn']->id : NULL); |
|
| 139 | 139 | $recordings_indexed = bigbluebuttonbn_index_recordings($recordings_imported); |
| 140 | - if( isset($recordings_indexed[$params['id']]) ) { |
|
| 140 | + if (isset($recordings_indexed[$params['id']])) { |
|
| 141 | 141 | //Look up for an update on the imported recording |
| 142 | 142 | $recording = $recordings_indexed[$params['id']]; |
| 143 | - if ( isset($recording) && !empty($recording) && !array_key_exists('messageKey', $recording)) { // The recording was found |
|
| 144 | - echo $params['callback'].'({ "status": "true", "published": "'.$recording['published'].'"});'; |
|
| 143 | + if (isset($recording) && !empty($recording) && !array_key_exists('messageKey', $recording)) { // The recording was found |
|
| 144 | + echo $params['callback'] . '({ "status": "true", "published": "' . $recording['published'] . '"});'; |
|
| 145 | 145 | } else { |
| 146 | - echo $params['callback'].'({ "status": "false" });'; |
|
| 146 | + echo $params['callback'] . '({ "status": "false" });'; |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | // As the recordingid was not identified as imported recording link, look up for a real recording |
| 150 | 150 | } else { |
| 151 | 151 | $recording = bigbluebuttonbn_getRecordingArray($params['id'], $params['idx'], $endpoint, $shared_secret); |
| 152 | - if ( isset($recording) && !empty($recording) && !array_key_exists('messageKey', $recording)) { // The recording was found |
|
| 153 | - echo $params['callback'].'({ "status": "true", "published": "'.$recording['published'].'"});'; |
|
| 152 | + if (isset($recording) && !empty($recording) && !array_key_exists('messageKey', $recording)) { // The recording was found |
|
| 153 | + echo $params['callback'] . '({ "status": "true", "published": "' . $recording['published'] . '"});'; |
|
| 154 | 154 | } else { |
| 155 | - echo $params['callback'].'({ "status": "false" });'; |
|
| 155 | + echo $params['callback'] . '({ "status": "false" });'; |
|
| 156 | 156 | } |
| 157 | 157 | } |
| 158 | 158 | |
@@ -162,16 +162,16 @@ discard block |
||
| 162 | 162 | } |
| 163 | 163 | break; |
| 164 | 164 | case 'recording_publish': |
| 165 | - if( $bbbsession['managerecordings'] ) { |
|
| 165 | + if ($bbbsession['managerecordings']) { |
|
| 166 | 166 | $status = true; |
| 167 | 167 | //Retrieve the array of imported recordings for the current course and activity |
| 168 | - $recordings_imported = bigbluebuttonbn_getRecordingsImportedArray($bbbsession['course']->id, isset($bbbsession['bigbluebuttonbn'])?$bbbsession['bigbluebuttonbn']->id: NULL); |
|
| 168 | + $recordings_imported = bigbluebuttonbn_getRecordingsImportedArray($bbbsession['course']->id, isset($bbbsession['bigbluebuttonbn']) ? $bbbsession['bigbluebuttonbn']->id : NULL); |
|
| 169 | 169 | $recordings_imported_indexed = bigbluebuttonbn_index_recordings($recordings_imported); |
| 170 | - if( isset($recordings_imported_indexed[$params['id']]) ) { |
|
| 170 | + if (isset($recordings_imported_indexed[$params['id']])) { |
|
| 171 | 171 | $recordings = bigbluebuttonbn_getRecordingsArray($recordings_imported_indexed[$params['id']]['meetingID'], $bbbsession['endpoint'], $bbbsession['shared_secret']); |
| 172 | 172 | $recordings_indexed = bigbluebuttonbn_index_recordings($recordings); |
| 173 | 173 | $recording = $recordings_indexed[$params['id']]; |
| 174 | - if ( $recording['published'] === 'true' ) { |
|
| 174 | + if ($recording['published'] === 'true') { |
|
| 175 | 175 | // Only if the physical recording is published, execute publish on imported recording link |
| 176 | 176 | $meeting_info = bigbluebuttonbn_bbb_broker_do_publish_recording_imported($params['id'], $bbbsession['course']->id, $bbbsession['bigbluebuttonbn']->id, true); |
| 177 | 177 | } else { |
@@ -183,11 +183,11 @@ discard block |
||
| 183 | 183 | $meeting_info = bigbluebuttonbn_bbb_broker_do_publish_recording($params['id'], true); |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | - if ( $status ) { |
|
| 186 | + if ($status) { |
|
| 187 | 187 | $callback_response['status'] = "true"; |
| 188 | 188 | |
| 189 | 189 | // Moodle event logger: Create an event for recording published |
| 190 | - if( isset($bigbluebuttonbn) ) { |
|
| 190 | + if (isset($bigbluebuttonbn)) { |
|
| 191 | 191 | bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, $bigbluebuttonbn, $context, $cm); |
| 192 | 192 | } |
| 193 | 193 | |
@@ -205,11 +205,11 @@ discard block |
||
| 205 | 205 | } |
| 206 | 206 | break; |
| 207 | 207 | case 'recording_unpublish': |
| 208 | - if( $bbbsession['managerecordings'] ) { |
|
| 208 | + if ($bbbsession['managerecordings']) { |
|
| 209 | 209 | //Retrieve the array of imported recordings for the current course and activity |
| 210 | - $recordings_imported = bigbluebuttonbn_getRecordingsImportedArray($bbbsession['course']->id, isset($bbbsession['bigbluebuttonbn'])?$bbbsession['bigbluebuttonbn']->id: NULL); |
|
| 210 | + $recordings_imported = bigbluebuttonbn_getRecordingsImportedArray($bbbsession['course']->id, isset($bbbsession['bigbluebuttonbn']) ? $bbbsession['bigbluebuttonbn']->id : NULL); |
|
| 211 | 211 | $recordings_indexed = bigbluebuttonbn_index_recordings($recordings_imported); |
| 212 | - if( isset($recordings_indexed[$params['id']]) ) { |
|
| 212 | + if (isset($recordings_indexed[$params['id']])) { |
|
| 213 | 213 | // Execute unpublish on imported recording link |
| 214 | 214 | $meeting_info = bigbluebuttonbn_bbb_broker_do_publish_recording_imported($params['id'], $bbbsession['course']->id, $bbbsession['bigbluebuttonbn']->id, false); |
| 215 | 215 | } else { |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | // First: Unpublish imported links associated to the recording |
| 218 | 218 | $recordings_imported_all = bigbluebuttonbn_getRecordingsImportedAllInstances($params['id']); |
| 219 | 219 | |
| 220 | - if( count($recordings_imported_all) > 0 ) { |
|
| 220 | + if (count($recordings_imported_all) > 0) { |
|
| 221 | 221 | foreach ($recordings_imported_all as $key => $record) { |
| 222 | 222 | $meta = json_decode($record->meta, true); |
| 223 | 223 | // Prepare data for the update |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | // Moodle event logger: Create an event for recording unpublished |
| 236 | - if( isset($bigbluebuttonbn) ) { |
|
| 236 | + if (isset($bigbluebuttonbn)) { |
|
| 237 | 237 | bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, $bigbluebuttonbn, $context, $cm); |
| 238 | 238 | } |
| 239 | 239 | |
@@ -247,11 +247,11 @@ discard block |
||
| 247 | 247 | } |
| 248 | 248 | break; |
| 249 | 249 | case 'recording_delete': |
| 250 | - if( $bbbsession['managerecordings'] ) { |
|
| 250 | + if ($bbbsession['managerecordings']) { |
|
| 251 | 251 | //Retrieve the array of imported recordings |
| 252 | - $recordings_imported = bigbluebuttonbn_getRecordingsImportedArray($bbbsession['course']->id, isset($bbbsession['bigbluebuttonbn'])?$bbbsession['bigbluebuttonbn']->id: NULL); |
|
| 252 | + $recordings_imported = bigbluebuttonbn_getRecordingsImportedArray($bbbsession['course']->id, isset($bbbsession['bigbluebuttonbn']) ? $bbbsession['bigbluebuttonbn']->id : NULL); |
|
| 253 | 253 | $recordings_indexed = bigbluebuttonbn_index_recordings($recordings_imported); |
| 254 | - if( isset($recordings_indexed[$params['id']]) ) { |
|
| 254 | + if (isset($recordings_indexed[$params['id']])) { |
|
| 255 | 255 | // Execute unpublish on imported recording link |
| 256 | 256 | bigbluebuttonbn_bbb_broker_do_delete_recording_imported($params['id'], $bbbsession['course']->id, $bbbsession['bigbluebuttonbn']->id); |
| 257 | 257 | } else { |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | // First: Delete imported links associated to the recording |
| 260 | 260 | $recordings_imported_all = bigbluebuttonbn_getRecordingsImportedAllInstances($params['id']); |
| 261 | 261 | |
| 262 | - if( count($recordings_imported_all) > 0 ) { |
|
| 262 | + if (count($recordings_imported_all) > 0) { |
|
| 263 | 263 | foreach ($recordings_imported_all as $key => $record) { |
| 264 | 264 | // Execute delete |
| 265 | 265 | $DB->delete_records("bigbluebuttonbn_logs", array('id' => $key)); |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | } |
| 271 | 271 | |
| 272 | 272 | // Moodle event logger: Create an event for recording deleted |
| 273 | - if( isset($bigbluebuttonbn) ) { |
|
| 273 | + if (isset($bigbluebuttonbn)) { |
|
| 274 | 274 | bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_DELETED, $bigbluebuttonbn, $context, $cm); |
| 275 | 275 | } |
| 276 | 276 | |
@@ -289,9 +289,9 @@ discard block |
||
| 289 | 289 | $decoded_parameters = JWT::decode($params['signed_parameters'], $shared_secret, array('HS256')); |
| 290 | 290 | |
| 291 | 291 | } catch (Exception $e) { |
| 292 | - $error = 'Caught exception: '.$e->getMessage(); |
|
| 292 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
| 293 | 293 | error_log($error); |
| 294 | - header("HTTP/1.0 400 Bad Request. ".$error); |
|
| 294 | + header("HTTP/1.0 400 Bad Request. " . $error); |
|
| 295 | 295 | return; |
| 296 | 296 | } |
| 297 | 297 | |
@@ -302,9 +302,9 @@ discard block |
||
| 302 | 302 | $bigbluebuttonbn = $DB->get_record('bigbluebuttonbn', array('id' => $meeting_id_elements[2]), '*', MUST_EXIST); |
| 303 | 303 | |
| 304 | 304 | } catch (Exception $e) { |
| 305 | - $error = 'Caught exception: '.$e->getMessage(); |
|
| 305 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
| 306 | 306 | error_log($error); |
| 307 | - header("HTTP/1.0 410 Gone. ".$error); |
|
| 307 | + header("HTTP/1.0 410 Gone. " . $error); |
|
| 308 | 308 | return; |
| 309 | 309 | } |
| 310 | 310 | |
@@ -314,22 +314,22 @@ discard block |
||
| 314 | 314 | header("HTTP/1.0 202 Accepted"); |
| 315 | 315 | return; |
| 316 | 316 | } catch (Exception $e) { |
| 317 | - $error = 'Caught exception: '.$e->getMessage(); |
|
| 317 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
| 318 | 318 | error_log($error); |
| 319 | - header("HTTP/1.0 503 Service Unavailable. ".$error); |
|
| 319 | + header("HTTP/1.0 503 Service Unavailable. " . $error); |
|
| 320 | 320 | return; |
| 321 | 321 | } |
| 322 | 322 | break; |
| 323 | 323 | case 'recording_import': |
| 324 | - if( $bbbsession['managerecordings'] ) { |
|
| 324 | + if ($bbbsession['managerecordings']) { |
|
| 325 | 325 | $importrecordings = $SESSION->bigbluebuttonbn_importrecordings; |
| 326 | - if( isset($importrecordings[$params['id']]) ) { |
|
| 326 | + if (isset($importrecordings[$params['id']])) { |
|
| 327 | 327 | $importrecordings[$params['id']]['imported'] = true; |
| 328 | 328 | $overrides['meetingid'] = $importrecordings[$params['id']]['meetingID']; |
| 329 | - $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}'; |
|
| 329 | + $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}'; |
|
| 330 | 330 | bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta); |
| 331 | 331 | // Moodle event logger: Create an event for recording imported |
| 332 | - if( isset($bigbluebuttonbn) ) { |
|
| 332 | + if (isset($bigbluebuttonbn)) { |
|
| 333 | 333 | bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, $bigbluebuttonbn, $context, $cm); |
| 334 | 334 | } |
| 335 | 335 | |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | } else { |
| 341 | 341 | $error = "Recording {$params['id']} could not be found. It can not be imported"; |
| 342 | 342 | error_log($error); |
| 343 | - header("HTTP/1.0 404 Not found. ".$error); |
|
| 343 | + header("HTTP/1.0 404 Not found. " . $error); |
|
| 344 | 344 | return; |
| 345 | 345 | } |
| 346 | 346 | } |
@@ -351,14 +351,14 @@ discard block |
||
| 351 | 351 | break; |
| 352 | 352 | } |
| 353 | 353 | |
| 354 | - } catch(Exception $e) { |
|
| 355 | - error_log("BBB_BROKER ERROR: ".$e->getCode().", ".$e->getMessage()); |
|
| 356 | - header("HTTP/1.0 502 Bad Gateway. ".$e->getMessage()); |
|
| 354 | + } catch (Exception $e) { |
|
| 355 | + error_log("BBB_BROKER ERROR: " . $e->getCode() . ", " . $e->getMessage()); |
|
| 356 | + header("HTTP/1.0 502 Bad Gateway. " . $e->getMessage()); |
|
| 357 | 357 | return; |
| 358 | 358 | } |
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | } else { |
| 362 | - header("HTTP/1.0 400 Bad Request. ".$error); |
|
| 362 | + header("HTTP/1.0 400 Bad Request. " . $error); |
|
| 363 | 363 | return; |
| 364 | 364 | } |
| 365 | 365 | \ No newline at end of file |
@@ -190,27 +190,27 @@ |
||
| 190 | 190 | |
| 191 | 191 | //// Configuration for "scheduled duration" feature |
| 192 | 192 | if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_scheduled_duration_enabled) ) { |
| 193 | - $settings->add( new admin_setting_heading('config_scheduled', |
|
| 194 | - get_string('config_scheduled', 'bigbluebuttonbn'), |
|
| 195 | - get_string('config_scheduled_description', 'bigbluebuttonbn'))); |
|
| 193 | + $settings->add( new admin_setting_heading('config_scheduled', |
|
| 194 | + get_string('config_scheduled', 'bigbluebuttonbn'), |
|
| 195 | + get_string('config_scheduled_description', 'bigbluebuttonbn'))); |
|
| 196 | 196 | |
| 197 | - // calculated duration for 'scheduled session' feature |
|
| 198 | - $settings->add(new admin_setting_configcheckbox('bigbluebuttonbn_scheduled_duration_enabled', |
|
| 199 | - get_string('config_scheduled_duration_enabled', 'bigbluebuttonbn'), |
|
| 200 | - get_string('config_scheduled_duration_enabled_description', 'bigbluebuttonbn'), |
|
| 201 | - 1)); |
|
| 197 | + // calculated duration for 'scheduled session' feature |
|
| 198 | + $settings->add(new admin_setting_configcheckbox('bigbluebuttonbn_scheduled_duration_enabled', |
|
| 199 | + get_string('config_scheduled_duration_enabled', 'bigbluebuttonbn'), |
|
| 200 | + get_string('config_scheduled_duration_enabled_description', 'bigbluebuttonbn'), |
|
| 201 | + 1)); |
|
| 202 | 202 | |
| 203 | - // compensatory time for 'scheduled session' feature |
|
| 204 | - $settings->add(new admin_setting_configtext('bigbluebuttonbn_scheduled_duration_compensation', |
|
| 205 | - get_string('config_scheduled_duration_compensation', 'bigbluebuttonbn'), |
|
| 206 | - get_string('config_scheduled_duration_compensation_description', 'bigbluebuttonbn'), |
|
| 207 | - 10, PARAM_INT)); |
|
| 203 | + // compensatory time for 'scheduled session' feature |
|
| 204 | + $settings->add(new admin_setting_configtext('bigbluebuttonbn_scheduled_duration_compensation', |
|
| 205 | + get_string('config_scheduled_duration_compensation', 'bigbluebuttonbn'), |
|
| 206 | + get_string('config_scheduled_duration_compensation_description', 'bigbluebuttonbn'), |
|
| 207 | + 10, PARAM_INT)); |
|
| 208 | 208 | |
| 209 | - // pre-opening time for 'scheduled session' feature |
|
| 210 | - $settings->add(new admin_setting_configtext('bigbluebuttonbn_scheduled_pre_opening', |
|
| 211 | - get_string('config_scheduled_pre_opening', 'bigbluebuttonbn'), |
|
| 212 | - get_string('config_scheduled_pre_opening_description', 'bigbluebuttonbn'), |
|
| 213 | - 10, PARAM_INT)); |
|
| 209 | + // pre-opening time for 'scheduled session' feature |
|
| 210 | + $settings->add(new admin_setting_configtext('bigbluebuttonbn_scheduled_pre_opening', |
|
| 211 | + get_string('config_scheduled_pre_opening', 'bigbluebuttonbn'), |
|
| 212 | + get_string('config_scheduled_pre_opening_description', 'bigbluebuttonbn'), |
|
| 213 | + 10, PARAM_INT)); |
|
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | //// Configuration for defining the default role/user that will be moderator on new activities |
@@ -13,52 +13,52 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | global $BIGBLUEBUTTONBN_CFG; |
| 15 | 15 | |
| 16 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
| 16 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
| 17 | 17 | |
| 18 | 18 | if ($ADMIN->fulltree) { |
| 19 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_server_url) || |
|
| 20 | - !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_shared_secret) ) { |
|
| 21 | - $settings->add( new admin_setting_heading('bigbluebuttonbn_config_general', |
|
| 19 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_server_url) || |
|
| 20 | + !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_shared_secret)) { |
|
| 21 | + $settings->add(new admin_setting_heading('bigbluebuttonbn_config_general', |
|
| 22 | 22 | get_string('config_general', 'bigbluebuttonbn'), |
| 23 | 23 | get_string('config_general_description', 'bigbluebuttonbn'))); |
| 24 | 24 | |
| 25 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_server_url) ) { |
|
| 26 | - $settings->add( new admin_setting_configtext( 'bigbluebuttonbn_server_url', |
|
| 27 | - get_string( 'config_server_url', 'bigbluebuttonbn' ), |
|
| 28 | - get_string( 'config_server_url_description', 'bigbluebuttonbn' ), |
|
| 25 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_server_url)) { |
|
| 26 | + $settings->add(new admin_setting_configtext('bigbluebuttonbn_server_url', |
|
| 27 | + get_string('config_server_url', 'bigbluebuttonbn'), |
|
| 28 | + get_string('config_server_url_description', 'bigbluebuttonbn'), |
|
| 29 | 29 | bigbluebuttonbn_get_cfg_server_url_default())); |
| 30 | 30 | } |
| 31 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_shared_secret) ) { |
|
| 32 | - $settings->add( new admin_setting_configtext( 'bigbluebuttonbn_shared_secret', |
|
| 33 | - get_string( 'config_shared_secret', 'bigbluebuttonbn' ), |
|
| 34 | - get_string( 'config_shared_secret_description', 'bigbluebuttonbn' ), |
|
| 31 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_shared_secret)) { |
|
| 32 | + $settings->add(new admin_setting_configtext('bigbluebuttonbn_shared_secret', |
|
| 33 | + get_string('config_shared_secret', 'bigbluebuttonbn'), |
|
| 34 | + get_string('config_shared_secret_description', 'bigbluebuttonbn'), |
|
| 35 | 35 | bigbluebuttonbn_get_cfg_shared_secret_default())); |
| 36 | 36 | } |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | //// Configuration for 'recording' feature |
| 40 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_default) || |
|
| 40 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_default) || |
|
| 41 | 41 | !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_editable) || |
| 42 | - !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_icons_enabled) ) { |
|
| 43 | - $settings->add( new admin_setting_heading('bigbluebuttonbn_recording', |
|
| 42 | + !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_icons_enabled)) { |
|
| 43 | + $settings->add(new admin_setting_heading('bigbluebuttonbn_recording', |
|
| 44 | 44 | get_string('config_feature_recording', 'bigbluebuttonbn'), |
| 45 | 45 | get_string('config_feature_recording_description', 'bigbluebuttonbn'))); |
| 46 | 46 | |
| 47 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_default) ) { |
|
| 47 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_default)) { |
|
| 48 | 48 | // default value for 'recording' feature |
| 49 | 49 | $settings->add(new admin_setting_configcheckbox('bigbluebuttonbn_recording_default', |
| 50 | 50 | get_string('config_feature_recording_default', 'bigbluebuttonbn'), |
| 51 | 51 | get_string('config_feature_recording_default_description', 'bigbluebuttonbn'), |
| 52 | 52 | 1)); |
| 53 | 53 | } |
| 54 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_editable) ) { |
|
| 54 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_editable)) { |
|
| 55 | 55 | // UI for 'recording' feature |
| 56 | 56 | $settings->add(new admin_setting_configcheckbox('bigbluebuttonbn_recording_editable', |
| 57 | 57 | get_string('config_feature_recording_editable', 'bigbluebuttonbn'), |
| 58 | 58 | get_string('config_feature_recording_editable_description', 'bigbluebuttonbn'), |
| 59 | 59 | 1)); |
| 60 | 60 | } |
| 61 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_icons_enabled) ) { |
|
| 61 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_icons_enabled)) { |
|
| 62 | 62 | // Front panel for 'recording' managment feature |
| 63 | 63 | $settings->add(new admin_setting_configcheckbox('bigbluebuttonbn_recording_icons_enabled', |
| 64 | 64 | get_string('config_feature_recording_icons_enabled', 'bigbluebuttonbn'), |
@@ -68,13 +68,13 @@ discard block |
||
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | //// Configuration for 'recording tagging' feature |
| 71 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_default) || |
|
| 72 | - !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_editable) ) { |
|
| 73 | - $settings->add( new admin_setting_heading('bigbluebuttonbn_recordingtagging', |
|
| 71 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_default) || |
|
| 72 | + !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_editable)) { |
|
| 73 | + $settings->add(new admin_setting_heading('bigbluebuttonbn_recordingtagging', |
|
| 74 | 74 | get_string('config_feature_recordingtagging', 'bigbluebuttonbn'), |
| 75 | 75 | get_string('config_feature_recordingtagging_description', 'bigbluebuttonbn'))); |
| 76 | 76 | |
| 77 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_default) ) { |
|
| 77 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_default)) { |
|
| 78 | 78 | // default value for 'recording tagging' feature |
| 79 | 79 | $settings->add(new admin_setting_configcheckbox('bigbluebuttonbn_recordingtagging_default', |
| 80 | 80 | get_string('config_feature_recordingtagging_default', 'bigbluebuttonbn'), |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | 0)); |
| 83 | 83 | } |
| 84 | 84 | // UI for 'recording tagging' feature |
| 85 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_editable) ) { |
|
| 85 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_editable)) { |
|
| 86 | 86 | $settings->add(new admin_setting_configcheckbox('bigbluebuttonbn_recordingtagging_editable', |
| 87 | 87 | get_string('config_feature_recordingtagging_editable', 'bigbluebuttonbn'), |
| 88 | 88 | get_string('config_feature_recordingtagging_editable_description', 'bigbluebuttonbn'), |
@@ -91,20 +91,20 @@ discard block |
||
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | //// Configuration for 'import recordings' feature |
| 94 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_enabled) || |
|
| 95 | - !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled) ) { |
|
| 96 | - $settings->add( new admin_setting_heading('bigbluebuttonbn_importrecordings', |
|
| 94 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_enabled) || |
|
| 95 | + !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled)) { |
|
| 96 | + $settings->add(new admin_setting_heading('bigbluebuttonbn_importrecordings', |
|
| 97 | 97 | get_string('config_feature_importrecordings', 'bigbluebuttonbn'), |
| 98 | 98 | get_string('config_feature_importrecordings_description', 'bigbluebuttonbn'))); |
| 99 | 99 | |
| 100 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_enabled) ) { |
|
| 100 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_enabled)) { |
|
| 101 | 101 | // default value for 'import recordings' feature |
| 102 | 102 | $settings->add(new admin_setting_configcheckbox('bigbluebuttonbn_importrecordings_enabled', |
| 103 | 103 | get_string('config_feature_importrecordings_enabled', 'bigbluebuttonbn'), |
| 104 | 104 | get_string('config_feature_importrecordings_enabled_description', 'bigbluebuttonbn'), |
| 105 | 105 | 0)); |
| 106 | 106 | } |
| 107 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled) ) { |
|
| 107 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled)) { |
|
| 108 | 108 | // consider deleted activities for 'import recordings' feature |
| 109 | 109 | $settings->add(new admin_setting_configcheckbox('bigbluebuttonbn_importrecordings_from_deleted_activities_enabled', |
| 110 | 110 | get_string('config_feature_importrecordings_from_deleted_activities_enabled', 'bigbluebuttonbn'), |
@@ -114,36 +114,36 @@ discard block |
||
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | //// Configuration for wait for moderator feature |
| 117 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_default) || |
|
| 117 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_default) || |
|
| 118 | 118 | !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_editable) || |
| 119 | 119 | !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_ping_interval) || |
| 120 | - !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_cache_ttl) ) { |
|
| 121 | - $settings->add( new admin_setting_heading('bigbluebuttonbn_feature_waitformoderator', |
|
| 120 | + !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_cache_ttl)) { |
|
| 121 | + $settings->add(new admin_setting_heading('bigbluebuttonbn_feature_waitformoderator', |
|
| 122 | 122 | get_string('config_feature_waitformoderator', 'bigbluebuttonbn'), |
| 123 | 123 | get_string('config_feature_waitformoderator_description', 'bigbluebuttonbn'))); |
| 124 | 124 | |
| 125 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_default) ) { |
|
| 125 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_default)) { |
|
| 126 | 126 | //default value for 'wait for moderator' feature |
| 127 | 127 | $settings->add(new admin_setting_configcheckbox('bigbluebuttonbn_waitformoderator_default', |
| 128 | 128 | get_string('config_feature_waitformoderator_default', 'bigbluebuttonbn'), |
| 129 | 129 | get_string('config_feature_waitformoderator_default_description', 'bigbluebuttonbn'), |
| 130 | 130 | 0)); |
| 131 | 131 | } |
| 132 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_editable) ) { |
|
| 132 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_editable)) { |
|
| 133 | 133 | // UI for 'wait for moderator' feature |
| 134 | 134 | $settings->add(new admin_setting_configcheckbox('bigbluebuttonbn_waitformoderator_editable', |
| 135 | 135 | get_string('config_feature_waitformoderator_editable', 'bigbluebuttonbn'), |
| 136 | 136 | get_string('config_feature_waitformoderator_editable_description', 'bigbluebuttonbn'), |
| 137 | 137 | 1)); |
| 138 | 138 | } |
| 139 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_ping_interval) ) { |
|
| 139 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_ping_interval)) { |
|
| 140 | 140 | //ping interval value for 'wait for moderator' feature |
| 141 | 141 | $settings->add(new admin_setting_configtext('bigbluebuttonbn_waitformoderator_ping_interval', |
| 142 | 142 | get_string('config_feature_waitformoderator_ping_interval', 'bigbluebuttonbn'), |
| 143 | 143 | get_string('config_feature_waitformoderator_ping_interval_description', 'bigbluebuttonbn'), |
| 144 | 144 | 10, PARAM_INT)); |
| 145 | 145 | } |
| 146 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_cache_ttl) ) { |
|
| 146 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_cache_ttl)) { |
|
| 147 | 147 | //cache TTL value for 'wait for moderator' feature |
| 148 | 148 | $settings->add(new admin_setting_configtext('bigbluebuttonbn_waitformoderator_cache_ttl', |
| 149 | 149 | get_string('config_feature_waitformoderator_cache_ttl', 'bigbluebuttonbn'), |
@@ -153,8 +153,8 @@ discard block |
||
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | //// Configuration for "static voice bridge" feature |
| 156 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_voicebridge_editable) ) { |
|
| 157 | - $settings->add( new admin_setting_heading('bigbluebuttonbn_feature_voicebridge', |
|
| 156 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_voicebridge_editable)) { |
|
| 157 | + $settings->add(new admin_setting_heading('bigbluebuttonbn_feature_voicebridge', |
|
| 158 | 158 | get_string('config_feature_voicebridge', 'bigbluebuttonbn'), |
| 159 | 159 | get_string('config_feature_voicebridge_description', 'bigbluebuttonbn'))); |
| 160 | 160 | |
@@ -166,10 +166,10 @@ discard block |
||
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | //// Configuration for "preupload presentation" feature |
| 169 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_preuploadpresentation_enabled) ) { |
|
| 169 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_preuploadpresentation_enabled)) { |
|
| 170 | 170 | // This feature only works if curl is installed |
| 171 | 171 | if (extension_loaded('curl')) { |
| 172 | - $settings->add( new admin_setting_heading('bigbluebuttonbn_feature_preuploadpresentation', |
|
| 172 | + $settings->add(new admin_setting_heading('bigbluebuttonbn_feature_preuploadpresentation', |
|
| 173 | 173 | get_string('config_feature_preuploadpresentation', 'bigbluebuttonbn'), |
| 174 | 174 | get_string('config_feature_preuploadpresentation_description', 'bigbluebuttonbn') |
| 175 | 175 | )); |
@@ -180,29 +180,29 @@ discard block |
||
| 180 | 180 | get_string('config_feature_preuploadpresentation_enabled_description', 'bigbluebuttonbn'), |
| 181 | 181 | 0)); |
| 182 | 182 | } else { |
| 183 | - $settings->add( new admin_setting_heading('bigbluebuttonbn_feature_preuploadpresentation', |
|
| 183 | + $settings->add(new admin_setting_heading('bigbluebuttonbn_feature_preuploadpresentation', |
|
| 184 | 184 | get_string('config_feature_preuploadpresentation', 'bigbluebuttonbn'), |
| 185 | - get_string('config_feature_preuploadpresentation_description', 'bigbluebuttonbn').'<br><br>'. |
|
| 186 | - '<div class="form-defaultinfo">'.get_string('config_warning_curl_not_installed', 'bigbluebuttonbn').'</div><br>' |
|
| 185 | + get_string('config_feature_preuploadpresentation_description', 'bigbluebuttonbn') . '<br><br>' . |
|
| 186 | + '<div class="form-defaultinfo">' . get_string('config_warning_curl_not_installed', 'bigbluebuttonbn') . '</div><br>' |
|
| 187 | 187 | )); |
| 188 | 188 | } |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | //// Configuration for "user limit" feature |
| 192 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_default) || |
|
| 193 | - !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_editable) ) { |
|
| 194 | - $settings->add( new admin_setting_heading('config_userlimit', |
|
| 192 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_default) || |
|
| 193 | + !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_editable)) { |
|
| 194 | + $settings->add(new admin_setting_heading('config_userlimit', |
|
| 195 | 195 | get_string('config_feature_userlimit', 'bigbluebuttonbn'), |
| 196 | 196 | get_string('config_feature_userlimit_description', 'bigbluebuttonbn'))); |
| 197 | 197 | |
| 198 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_default) ) { |
|
| 198 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_default)) { |
|
| 199 | 199 | //default value for 'user limit' feature |
| 200 | 200 | $settings->add(new admin_setting_configtext('bigbluebuttonbn_userlimit_default', |
| 201 | 201 | get_string('config_feature_userlimit_default', 'bigbluebuttonbn'), |
| 202 | 202 | get_string('config_feature_userlimit_default_description', 'bigbluebuttonbn'), |
| 203 | 203 | 0, PARAM_INT)); |
| 204 | 204 | } |
| 205 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_editable) ) { |
|
| 205 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_editable)) { |
|
| 206 | 206 | // UI for 'user limit' feature |
| 207 | 207 | $settings->add(new admin_setting_configcheckbox('bigbluebuttonbn_userlimit_editable', |
| 208 | 208 | get_string('config_feature_userlimit_editable', 'bigbluebuttonbn'), |
@@ -212,8 +212,8 @@ discard block |
||
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | //// Configuration for "scheduled duration" feature |
| 215 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_scheduled_duration_enabled) ) { |
|
| 216 | - $settings->add( new admin_setting_heading('config_scheduled', |
|
| 215 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_scheduled_duration_enabled)) { |
|
| 216 | + $settings->add(new admin_setting_heading('config_scheduled', |
|
| 217 | 217 | get_string('config_scheduled', 'bigbluebuttonbn'), |
| 218 | 218 | get_string('config_scheduled_description', 'bigbluebuttonbn'))); |
| 219 | 219 | |
@@ -237,8 +237,8 @@ discard block |
||
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | //// Configuration for defining the default role/user that will be moderator on new activities |
| 240 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_moderator_default) ) { |
|
| 241 | - $settings->add( new admin_setting_heading('bigbluebuttonbn_permission', |
|
| 240 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_moderator_default)) { |
|
| 241 | + $settings->add(new admin_setting_heading('bigbluebuttonbn_permission', |
|
| 242 | 242 | get_string('config_permission', 'bigbluebuttonbn'), |
| 243 | 243 | get_string('config_permission_description', 'bigbluebuttonbn'))); |
| 244 | 244 | |
@@ -252,8 +252,8 @@ discard block |
||
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | //// Configuration for "send notifications" feature |
| 255 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_sendnotifications_enabled) ) { |
|
| 256 | - $settings->add( new admin_setting_heading('bigbluebuttonbn_feature_sendnotifications', |
|
| 255 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_sendnotifications_enabled)) { |
|
| 256 | + $settings->add(new admin_setting_heading('bigbluebuttonbn_feature_sendnotifications', |
|
| 257 | 257 | get_string('config_feature_sendnotifications', 'bigbluebuttonbn'), |
| 258 | 258 | get_string('config_feature_sendnotifications_description', 'bigbluebuttonbn'))); |
| 259 | 259 | |
@@ -265,10 +265,10 @@ discard block |
||
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 | //// Configuration for extended BN capabilities |
| 268 | - if( bigbluebuttonbn_server_offers_bn_capabilities() ) { |
|
| 268 | + if (bigbluebuttonbn_server_offers_bn_capabilities()) { |
|
| 269 | 269 | //// Configuration for 'notify users when recording ready' feature |
| 270 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingready_enabled) ) { |
|
| 271 | - $settings->add( new admin_setting_heading('bigbluebuttonbn_extended_capabilities', |
|
| 270 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingready_enabled)) { |
|
| 271 | + $settings->add(new admin_setting_heading('bigbluebuttonbn_extended_capabilities', |
|
| 272 | 272 | get_string('config_extended_capabilities', 'bigbluebuttonbn'), |
| 273 | 273 | get_string('config_extended_capabilities_description', 'bigbluebuttonbn'))); |
| 274 | 274 | |
@@ -183,30 +183,30 @@ discard block |
||
| 183 | 183 | $mform->setType('participants', PARAM_TEXT); |
| 184 | 184 | |
| 185 | 185 | $html_participant_selection = ''. |
| 186 | - '<div id="fitem_bigbluebuttonbn_participant_selection" class="fitem fitem_fselect">'."\n". |
|
| 187 | - ' <div class="fitemtitle">'."\n". |
|
| 188 | - ' <label for="bigbluebuttonbn_participant_selectiontype">'.get_string('mod_form_field_participant_add', 'bigbluebuttonbn').' </label>'."\n". |
|
| 189 | - ' </div>'."\n". |
|
| 190 | - ' <div class="felement fselect">'."\n". |
|
| 191 | - ' <select id="bigbluebuttonbn_participant_selection_type" onchange="bigbluebuttonbn_participant_selection_set(); return 0;">'."\n". |
|
| 192 | - ' <option value="all" selected="selected">'.get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn').'</option>'."\n". |
|
| 193 | - ' <option value="role">'.get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn').'</option>'."\n". |
|
| 194 | - ' <option value="user">'.get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn').'</option>'."\n". |
|
| 195 | - ' </select>'."\n". |
|
| 196 | - ' '."\n". |
|
| 197 | - ' <select id="bigbluebuttonbn_participant_selection" disabled="disabled">'."\n". |
|
| 198 | - ' <option value="all" selected="selected">---------------</option>'."\n". |
|
| 199 | - ' </select>'."\n". |
|
| 200 | - ' '."\n". |
|
| 201 | - ' <input value="'.get_string('mod_form_field_participant_list_action_add', 'bigbluebuttonbn').'" type="button" id="id_addselectionid" onclick="bigbluebuttonbn_participant_add(); return 0;" />'."\n". |
|
| 202 | - ' </div>'."\n". |
|
| 203 | - '</div>'."\n". |
|
| 204 | - '<div id="fitem_bigbluebuttonbn_participant_list" class="fitem">'."\n". |
|
| 205 | - ' <div class="fitemtitle">'."\n". |
|
| 206 | - ' <label for="bigbluebuttonbn_participant_list">'.get_string('mod_form_field_participant_list', 'bigbluebuttonbn').' </label>'."\n". |
|
| 207 | - ' </div>'."\n". |
|
| 208 | - ' <div class="felement fselect">'."\n". |
|
| 209 | - ' <table id="participant_list_table">'."\n"; |
|
| 186 | + '<div id="fitem_bigbluebuttonbn_participant_selection" class="fitem fitem_fselect">'."\n". |
|
| 187 | + ' <div class="fitemtitle">'."\n". |
|
| 188 | + ' <label for="bigbluebuttonbn_participant_selectiontype">'.get_string('mod_form_field_participant_add', 'bigbluebuttonbn').' </label>'."\n". |
|
| 189 | + ' </div>'."\n". |
|
| 190 | + ' <div class="felement fselect">'."\n". |
|
| 191 | + ' <select id="bigbluebuttonbn_participant_selection_type" onchange="bigbluebuttonbn_participant_selection_set(); return 0;">'."\n". |
|
| 192 | + ' <option value="all" selected="selected">'.get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn').'</option>'."\n". |
|
| 193 | + ' <option value="role">'.get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn').'</option>'."\n". |
|
| 194 | + ' <option value="user">'.get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn').'</option>'."\n". |
|
| 195 | + ' </select>'."\n". |
|
| 196 | + ' '."\n". |
|
| 197 | + ' <select id="bigbluebuttonbn_participant_selection" disabled="disabled">'."\n". |
|
| 198 | + ' <option value="all" selected="selected">---------------</option>'."\n". |
|
| 199 | + ' </select>'."\n". |
|
| 200 | + ' '."\n". |
|
| 201 | + ' <input value="'.get_string('mod_form_field_participant_list_action_add', 'bigbluebuttonbn').'" type="button" id="id_addselectionid" onclick="bigbluebuttonbn_participant_add(); return 0;" />'."\n". |
|
| 202 | + ' </div>'."\n". |
|
| 203 | + '</div>'."\n". |
|
| 204 | + '<div id="fitem_bigbluebuttonbn_participant_list" class="fitem">'."\n". |
|
| 205 | + ' <div class="fitemtitle">'."\n". |
|
| 206 | + ' <label for="bigbluebuttonbn_participant_list">'.get_string('mod_form_field_participant_list', 'bigbluebuttonbn').' </label>'."\n". |
|
| 207 | + ' </div>'."\n". |
|
| 208 | + ' <div class="felement fselect">'."\n". |
|
| 209 | + ' <table id="participant_list_table">'."\n"; |
|
| 210 | 210 | |
| 211 | 211 | // Add participant list |
| 212 | 212 | foreach($participant_list as $participant){ |
@@ -243,11 +243,11 @@ discard block |
||
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | $html_participant_selection .= ''. |
| 246 | - ' </table>'."\n". |
|
| 247 | - ' </div>'."\n". |
|
| 248 | - '</div>'."\n". |
|
| 249 | - '<script type="text/javascript" src="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/mod_form.js">'."\n". |
|
| 250 | - '</script>'."\n"; |
|
| 246 | + ' </table>'."\n". |
|
| 247 | + ' </div>'."\n". |
|
| 248 | + '</div>'."\n". |
|
| 249 | + '<script type="text/javascript" src="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/mod_form.js">'."\n". |
|
| 250 | + '</script>'."\n"; |
|
| 251 | 251 | |
| 252 | 252 | $mform->addElement('html', $html_participant_selection); |
| 253 | 253 | |
@@ -255,9 +255,9 @@ discard block |
||
| 255 | 255 | $mform->addElement('html', '<script type="text/javascript">var bigbluebuttonbn_participant_selection = {"all": [], "role": '.json_encode($roles).', "user": '.bigbluebuttonbn_get_users_json($users).'}; </script>'); |
| 256 | 256 | $mform->addElement('html', '<script type="text/javascript">var bigbluebuttonbn_participant_list = '.json_encode($participant_list).'; </script>'); |
| 257 | 257 | $bigbluebuttonbn_strings = Array( "as" => get_string('mod_form_field_participant_list_text_as', 'bigbluebuttonbn'), |
| 258 | - "viewer" => get_string('mod_form_field_participant_bbb_role_viewer', 'bigbluebuttonbn'), |
|
| 259 | - "moderator" => get_string('mod_form_field_participant_bbb_role_moderator', 'bigbluebuttonbn'), |
|
| 260 | - "remove" => get_string('mod_form_field_participant_list_action_remove', 'bigbluebuttonbn'), |
|
| 258 | + "viewer" => get_string('mod_form_field_participant_bbb_role_viewer', 'bigbluebuttonbn'), |
|
| 259 | + "moderator" => get_string('mod_form_field_participant_bbb_role_moderator', 'bigbluebuttonbn'), |
|
| 260 | + "remove" => get_string('mod_form_field_participant_list_action_remove', 'bigbluebuttonbn'), |
|
| 261 | 261 | ); |
| 262 | 262 | $mform->addElement('html', '<script type="text/javascript">var bigbluebuttonbn_strings = '.json_encode($bigbluebuttonbn_strings).'; </script>'); |
| 263 | 263 | //------------------------------------------------------------------------------- |
@@ -269,8 +269,9 @@ |
||
| 269 | 269 | // Fourth block starts here |
| 270 | 270 | //------------------------------------------------------------------------------- |
| 271 | 271 | $mform->addElement('header', 'schedule', get_string('mod_form_block_schedule', 'bigbluebuttonbn')); |
| 272 | - if( isset($current_activity->openingtime) && $current_activity->openingtime != 0 || isset($current_activity->closingtime) && $current_activity->closingtime != 0 ) |
|
| 273 | - $mform->setExpanded('schedule'); |
|
| 272 | + if( isset($current_activity->openingtime) && $current_activity->openingtime != 0 || isset($current_activity->closingtime) && $current_activity->closingtime != 0 ) { |
|
| 273 | + $mform->setExpanded('schedule'); |
|
| 274 | + } |
|
| 274 | 275 | |
| 275 | 276 | $mform->addElement('date_time_selector', 'openingtime', get_string('mod_form_field_openingtime', 'bigbluebuttonbn'), array('optional' => true)); |
| 276 | 277 | $mform->setDefault('openingtime', 0); |
@@ -11,8 +11,8 @@ discard block |
||
| 11 | 11 | |
| 12 | 12 | defined('MOODLE_INTERNAL') || die(); |
| 13 | 13 | |
| 14 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
| 15 | -require_once($CFG->dirroot.'/course/moodleform_mod.php'); |
|
| 14 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
| 15 | +require_once($CFG->dirroot . '/course/moodleform_mod.php'); |
|
| 16 | 16 | |
| 17 | 17 | class mod_bigbluebuttonbn_mod_form extends moodleform_mod { |
| 18 | 18 | |
@@ -50,24 +50,24 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | //Validates if the BigBlueButton server is running |
| 52 | 52 | $serverVersion = bigbluebuttonbn_getServerVersion($endpoint); |
| 53 | - if ( !isset($serverVersion) ) { |
|
| 54 | - print_error( 'general_error_unable_connect', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
|
| 53 | + if (!isset($serverVersion)) { |
|
| 54 | + print_error('general_error_unable_connect', 'bigbluebuttonbn', $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - $mform =& $this->_form; |
|
| 58 | - $current_activity =& $this->current; |
|
| 57 | + $mform = & $this->_form; |
|
| 58 | + $current_activity = & $this->current; |
|
| 59 | 59 | |
| 60 | 60 | //------------------------------------------------------------------------------- |
| 61 | 61 | // First block starts here |
| 62 | 62 | //------------------------------------------------------------------------------- |
| 63 | 63 | $mform->addElement('header', 'general', get_string('mod_form_block_general', 'bigbluebuttonbn')); |
| 64 | 64 | |
| 65 | - $mform->addElement('text', 'name', get_string('mod_form_field_name','bigbluebuttonbn'), 'maxlength="64" size="32"'); |
|
| 65 | + $mform->addElement('text', 'name', get_string('mod_form_field_name', 'bigbluebuttonbn'), 'maxlength="64" size="32"'); |
|
| 66 | 66 | $mform->setType('name', PARAM_TEXT); |
| 67 | 67 | $mform->addRule('name', null, 'required', null, 'client'); |
| 68 | 68 | |
| 69 | 69 | $version_major = bigbluebuttonbn_get_moodle_version_major(); |
| 70 | - if ( $version_major < '2015051100' ) { |
|
| 70 | + if ($version_major < '2015051100') { |
|
| 71 | 71 | //This is valid before v2.9 |
| 72 | 72 | $this->add_intro_editor(false, get_string('mod_form_field_intro', 'bigbluebuttonbn')); |
| 73 | 73 | } else { |
@@ -77,60 +77,60 @@ discard block |
||
| 77 | 77 | $mform->setAdvanced('introeditor'); |
| 78 | 78 | $mform->setAdvanced('showdescription'); |
| 79 | 79 | |
| 80 | - $mform->addElement('textarea', 'welcome', get_string('mod_form_field_welcome','bigbluebuttonbn'), 'wrap="virtual" rows="5" cols="60"'); |
|
| 80 | + $mform->addElement('textarea', 'welcome', get_string('mod_form_field_welcome', 'bigbluebuttonbn'), 'wrap="virtual" rows="5" cols="60"'); |
|
| 81 | 81 | $mform->addHelpButton('welcome', 'mod_form_field_welcome', 'bigbluebuttonbn'); |
| 82 | 82 | $mform->setType('welcome', PARAM_TEXT); |
| 83 | 83 | $mform->setAdvanced('welcome'); |
| 84 | 84 | |
| 85 | - if ( $voicebridge_editable ) { |
|
| 86 | - $mform->addElement('text', 'voicebridge', get_string('mod_form_field_voicebridge','bigbluebuttonbn'), array('maxlength'=>4, 'size'=>6)); |
|
| 85 | + if ($voicebridge_editable) { |
|
| 86 | + $mform->addElement('text', 'voicebridge', get_string('mod_form_field_voicebridge', 'bigbluebuttonbn'), array('maxlength'=>4, 'size'=>6)); |
|
| 87 | 87 | $mform->addRule('voicebridge', get_string('mod_form_field_voicebridge_format_error', 'bigbluebuttonbn'), 'numeric', '####', 'server'); |
| 88 | - $mform->setDefault( 'voicebridge', 0 ); |
|
| 88 | + $mform->setDefault('voicebridge', 0); |
|
| 89 | 89 | $mform->addHelpButton('voicebridge', 'mod_form_field_voicebridge', 'bigbluebuttonbn'); |
| 90 | 90 | $mform->setAdvanced('voicebridge'); |
| 91 | 91 | } |
| 92 | 92 | $mform->setType('voicebridge', PARAM_INT); |
| 93 | 93 | |
| 94 | - if ( $waitformoderator_editable ) { |
|
| 94 | + if ($waitformoderator_editable) { |
|
| 95 | 95 | $mform->addElement('checkbox', 'wait', get_string('mod_form_field_wait', 'bigbluebuttonbn')); |
| 96 | 96 | $mform->addHelpButton('wait', 'mod_form_field_wait', 'bigbluebuttonbn'); |
| 97 | - $mform->setDefault( 'wait', $waitformoderator_default ); |
|
| 97 | + $mform->setDefault('wait', $waitformoderator_default); |
|
| 98 | 98 | $mform->setAdvanced('wait'); |
| 99 | 99 | } else { |
| 100 | - $mform->addElement('hidden', 'wait', $waitformoderator_default ); |
|
| 100 | + $mform->addElement('hidden', 'wait', $waitformoderator_default); |
|
| 101 | 101 | } |
| 102 | 102 | $mform->setType('wait', PARAM_INT); |
| 103 | 103 | |
| 104 | - if ( $userlimit_editable ) { |
|
| 105 | - $mform->addElement('text', 'userlimit', get_string('mod_form_field_userlimit','bigbluebuttonbn'), 'maxlength="3" size="5"' ); |
|
| 104 | + if ($userlimit_editable) { |
|
| 105 | + $mform->addElement('text', 'userlimit', get_string('mod_form_field_userlimit', 'bigbluebuttonbn'), 'maxlength="3" size="5"'); |
|
| 106 | 106 | $mform->addHelpButton('userlimit', 'mod_form_field_userlimit', 'bigbluebuttonbn'); |
| 107 | - $mform->setDefault( 'userlimit', $userlimit_default ); |
|
| 107 | + $mform->setDefault('userlimit', $userlimit_default); |
|
| 108 | 108 | } else { |
| 109 | - $mform->addElement('hidden', 'userlimit', $userlimit_default ); |
|
| 109 | + $mform->addElement('hidden', 'userlimit', $userlimit_default); |
|
| 110 | 110 | } |
| 111 | 111 | $mform->setType('userlimit', PARAM_TEXT); |
| 112 | 112 | |
| 113 | - if ( floatval($serverVersion) >= 0.8 ) { |
|
| 114 | - if ( $recording_editable ) { |
|
| 113 | + if (floatval($serverVersion) >= 0.8) { |
|
| 114 | + if ($recording_editable) { |
|
| 115 | 115 | $mform->addElement('checkbox', 'record', get_string('mod_form_field_record', 'bigbluebuttonbn')); |
| 116 | - $mform->setDefault( 'record', $recording_default ); |
|
| 116 | + $mform->setDefault('record', $recording_default); |
|
| 117 | 117 | $mform->setAdvanced('record'); |
| 118 | 118 | } else { |
| 119 | 119 | $mform->addElement('hidden', 'record', $recording_default); |
| 120 | 120 | } |
| 121 | 121 | $mform->setType('record', PARAM_INT); |
| 122 | 122 | |
| 123 | - if ( $recording_tagging_editable ) { |
|
| 123 | + if ($recording_tagging_editable) { |
|
| 124 | 124 | $mform->addElement('checkbox', 'tagging', get_string('mod_form_field_recordingtagging', 'bigbluebuttonbn')); |
| 125 | 125 | $mform->setDefault('tagging', $recording_tagging_default); |
| 126 | 126 | $mform->setAdvanced('tagging'); |
| 127 | 127 | } else { |
| 128 | - $mform->addElement('hidden', 'tagging', $recording_tagging_default ); |
|
| 128 | + $mform->addElement('hidden', 'tagging', $recording_tagging_default); |
|
| 129 | 129 | } |
| 130 | 130 | $mform->setType('tagging', PARAM_INT); |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | - if ( $sendnotifications_enabled ) { |
|
| 133 | + if ($sendnotifications_enabled) { |
|
| 134 | 134 | $mform->addElement('checkbox', 'notification', get_string('mod_form_field_notification', 'bigbluebuttonbn')); |
| 135 | 135 | if ($this->current->instance) { |
| 136 | 136 | $mform->addHelpButton('notification', 'mod_form_field_notification', 'bigbluebuttonbn'); |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | //------------------------------------------------------------------------------- |
| 149 | 149 | // Second block starts here |
| 150 | 150 | //------------------------------------------------------------------------------- |
| 151 | - if ( $preuploadpresentation_enabled ) { |
|
| 151 | + if ($preuploadpresentation_enabled) { |
|
| 152 | 152 | $mform->addElement('header', 'preupload', get_string('mod_form_block_presentation', 'bigbluebuttonbn')); |
| 153 | 153 | $mform->setExpanded('preupload'); |
| 154 | 154 | |
@@ -180,84 +180,84 @@ discard block |
||
| 180 | 180 | $mform->addElement('hidden', 'participants', json_encode($participant_list)); |
| 181 | 181 | $mform->setType('participants', PARAM_TEXT); |
| 182 | 182 | |
| 183 | - $html_participant_selection = ''. |
|
| 184 | - '<div id="fitem_bigbluebuttonbn_participant_selection" class="fitem fitem_fselect">'."\n". |
|
| 185 | - ' <div class="fitemtitle">'."\n". |
|
| 186 | - ' <label for="bigbluebuttonbn_participant_selectiontype">'.get_string('mod_form_field_participant_add', 'bigbluebuttonbn').' </label>'."\n". |
|
| 187 | - ' </div>'."\n". |
|
| 188 | - ' <div class="felement fselect">'."\n". |
|
| 189 | - ' <select id="bigbluebuttonbn_participant_selection_type" onchange="bigbluebuttonbn_participant_selection_set(); return 0;">'."\n". |
|
| 190 | - ' <option value="all" selected="selected">'.get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn').'</option>'."\n". |
|
| 191 | - ' <option value="role">'.get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn').'</option>'."\n". |
|
| 192 | - ' <option value="user">'.get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn').'</option>'."\n". |
|
| 193 | - ' </select>'."\n". |
|
| 194 | - ' '."\n". |
|
| 195 | - ' <select id="bigbluebuttonbn_participant_selection" disabled="disabled">'."\n". |
|
| 196 | - ' <option value="all" selected="selected">---------------</option>'."\n". |
|
| 197 | - ' </select>'."\n". |
|
| 198 | - ' '."\n". |
|
| 199 | - ' <input value="'.get_string('mod_form_field_participant_list_action_add', 'bigbluebuttonbn').'" type="button" id="id_addselectionid" onclick="bigbluebuttonbn_participant_add(); return 0;" />'."\n". |
|
| 200 | - ' </div>'."\n". |
|
| 201 | - '</div>'."\n". |
|
| 202 | - '<div id="fitem_bigbluebuttonbn_participant_list" class="fitem">'."\n". |
|
| 203 | - ' <div class="fitemtitle">'."\n". |
|
| 204 | - ' <label for="bigbluebuttonbn_participant_list">'.get_string('mod_form_field_participant_list', 'bigbluebuttonbn').' </label>'."\n". |
|
| 205 | - ' </div>'."\n". |
|
| 206 | - ' <div class="felement fselect">'."\n". |
|
| 207 | - ' <table id="participant_list_table">'."\n"; |
|
| 183 | + $html_participant_selection = '' . |
|
| 184 | + '<div id="fitem_bigbluebuttonbn_participant_selection" class="fitem fitem_fselect">' . "\n" . |
|
| 185 | + ' <div class="fitemtitle">' . "\n" . |
|
| 186 | + ' <label for="bigbluebuttonbn_participant_selectiontype">' . get_string('mod_form_field_participant_add', 'bigbluebuttonbn') . ' </label>' . "\n" . |
|
| 187 | + ' </div>' . "\n" . |
|
| 188 | + ' <div class="felement fselect">' . "\n" . |
|
| 189 | + ' <select id="bigbluebuttonbn_participant_selection_type" onchange="bigbluebuttonbn_participant_selection_set(); return 0;">' . "\n" . |
|
| 190 | + ' <option value="all" selected="selected">' . get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn') . '</option>' . "\n" . |
|
| 191 | + ' <option value="role">' . get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn') . '</option>' . "\n" . |
|
| 192 | + ' <option value="user">' . get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn') . '</option>' . "\n" . |
|
| 193 | + ' </select>' . "\n" . |
|
| 194 | + ' ' . "\n" . |
|
| 195 | + ' <select id="bigbluebuttonbn_participant_selection" disabled="disabled">' . "\n" . |
|
| 196 | + ' <option value="all" selected="selected">---------------</option>' . "\n" . |
|
| 197 | + ' </select>' . "\n" . |
|
| 198 | + ' ' . "\n" . |
|
| 199 | + ' <input value="' . get_string('mod_form_field_participant_list_action_add', 'bigbluebuttonbn') . '" type="button" id="id_addselectionid" onclick="bigbluebuttonbn_participant_add(); return 0;" />' . "\n" . |
|
| 200 | + ' </div>' . "\n" . |
|
| 201 | + '</div>' . "\n" . |
|
| 202 | + '<div id="fitem_bigbluebuttonbn_participant_list" class="fitem">' . "\n" . |
|
| 203 | + ' <div class="fitemtitle">' . "\n" . |
|
| 204 | + ' <label for="bigbluebuttonbn_participant_list">' . get_string('mod_form_field_participant_list', 'bigbluebuttonbn') . ' </label>' . "\n" . |
|
| 205 | + ' </div>' . "\n" . |
|
| 206 | + ' <div class="felement fselect">' . "\n" . |
|
| 207 | + ' <table id="participant_list_table">' . "\n"; |
|
| 208 | 208 | |
| 209 | 209 | // Add participant list |
| 210 | - foreach($participant_list as $participant){ |
|
| 210 | + foreach ($participant_list as $participant) { |
|
| 211 | 211 | $participant_selectionid = ''; |
| 212 | 212 | $participant_selectiontype = $participant['selectiontype']; |
| 213 | - if( $participant_selectiontype == 'all') { |
|
| 214 | - $participant_selectiontype = '<b><i>'.get_string('mod_form_field_participant_list_type_'.$participant_selectiontype, 'bigbluebuttonbn').'</i></b>'; |
|
| 213 | + if ($participant_selectiontype == 'all') { |
|
| 214 | + $participant_selectiontype = '<b><i>' . get_string('mod_form_field_participant_list_type_' . $participant_selectiontype, 'bigbluebuttonbn') . '</i></b>'; |
|
| 215 | 215 | } else { |
| 216 | - if ( $participant_selectiontype == 'role') { |
|
| 216 | + if ($participant_selectiontype == 'role') { |
|
| 217 | 217 | $participant_selectionid = bigbluebuttonbn_get_role_name($participant['selectionid']); |
| 218 | 218 | } else { |
| 219 | - foreach($users as $user){ |
|
| 220 | - if( $user->id == $participant['selectionid']) { |
|
| 221 | - $participant_selectionid = $user->firstname.' '.$user->lastname; |
|
| 219 | + foreach ($users as $user) { |
|
| 220 | + if ($user->id == $participant['selectionid']) { |
|
| 221 | + $participant_selectionid = $user->firstname . ' ' . $user->lastname; |
|
| 222 | 222 | break; |
| 223 | 223 | } |
| 224 | 224 | } |
| 225 | 225 | } |
| 226 | - $participant_selectiontype = '<b><i>'.get_string('mod_form_field_participant_list_type_'.$participant_selectiontype, 'bigbluebuttonbn').':</i></b> '; |
|
| 226 | + $participant_selectiontype = '<b><i>' . get_string('mod_form_field_participant_list_type_' . $participant_selectiontype, 'bigbluebuttonbn') . ':</i></b> '; |
|
| 227 | 227 | } |
| 228 | - $participant_role = get_string('mod_form_field_participant_bbb_role_'.$participant['role'], 'bigbluebuttonbn'); |
|
| 229 | - |
|
| 230 | - $html_participant_selection .= ''. |
|
| 231 | - ' <tr id="participant_list_tr_'.$participant['selectiontype'].'-'.$participant['selectionid'].'">'."\n". |
|
| 232 | - ' <td width="20px"><a onclick="bigbluebuttonbn_participant_remove(\''.$participant['selectiontype'].'\', \''.$participant['selectionid'].'\'); return 0;" title="'.get_string('mod_form_field_participant_list_action_remove', 'bigbluebuttonbn').'">x</a></td>'."\n". |
|
| 233 | - ' <td width="125px">'.$participant_selectiontype.'</td>'."\n". |
|
| 234 | - ' <td>'.$participant_selectionid.'</td>'."\n". |
|
| 235 | - ' <td><i> '.get_string('mod_form_field_participant_list_text_as', 'bigbluebuttonbn').' </i>'."\n". |
|
| 236 | - ' <select id="participant_list_role_'.$participant['selectiontype'].'-'.$participant['selectionid'].'" onchange="bigbluebuttonbn_participant_list_role_update(\''.$participant['selectiontype'].'\', \''.$participant['selectionid'].'\'); return 0;">'."\n". |
|
| 237 | - ' <option value="'.BIGBLUEBUTTONBN_ROLE_VIEWER.'" '.($participant['role'] == BIGBLUEBUTTONBN_ROLE_VIEWER? 'selected="selected" ': '').'>'.get_string('mod_form_field_participant_bbb_role_'.BIGBLUEBUTTONBN_ROLE_VIEWER, 'bigbluebuttonbn').'</option>'."\n". |
|
| 238 | - ' <option value="'.BIGBLUEBUTTONBN_ROLE_MODERATOR.'" '.($participant['role'] == BIGBLUEBUTTONBN_ROLE_MODERATOR? 'selected="selected" ': '').'>'.get_string('mod_form_field_participant_bbb_role_'.BIGBLUEBUTTONBN_ROLE_MODERATOR, 'bigbluebuttonbn').'</option><select>'."\n". |
|
| 239 | - ' </td>'."\n". |
|
| 240 | - ' </tr>'."\n"; |
|
| 228 | + $participant_role = get_string('mod_form_field_participant_bbb_role_' . $participant['role'], 'bigbluebuttonbn'); |
|
| 229 | + |
|
| 230 | + $html_participant_selection .= '' . |
|
| 231 | + ' <tr id="participant_list_tr_' . $participant['selectiontype'] . '-' . $participant['selectionid'] . '">' . "\n" . |
|
| 232 | + ' <td width="20px"><a onclick="bigbluebuttonbn_participant_remove(\'' . $participant['selectiontype'] . '\', \'' . $participant['selectionid'] . '\'); return 0;" title="' . get_string('mod_form_field_participant_list_action_remove', 'bigbluebuttonbn') . '">x</a></td>' . "\n" . |
|
| 233 | + ' <td width="125px">' . $participant_selectiontype . '</td>' . "\n" . |
|
| 234 | + ' <td>' . $participant_selectionid . '</td>' . "\n" . |
|
| 235 | + ' <td><i> ' . get_string('mod_form_field_participant_list_text_as', 'bigbluebuttonbn') . ' </i>' . "\n" . |
|
| 236 | + ' <select id="participant_list_role_' . $participant['selectiontype'] . '-' . $participant['selectionid'] . '" onchange="bigbluebuttonbn_participant_list_role_update(\'' . $participant['selectiontype'] . '\', \'' . $participant['selectionid'] . '\'); return 0;">' . "\n" . |
|
| 237 | + ' <option value="' . BIGBLUEBUTTONBN_ROLE_VIEWER . '" ' . ($participant['role'] == BIGBLUEBUTTONBN_ROLE_VIEWER ? 'selected="selected" ' : '') . '>' . get_string('mod_form_field_participant_bbb_role_' . BIGBLUEBUTTONBN_ROLE_VIEWER, 'bigbluebuttonbn') . '</option>' . "\n" . |
|
| 238 | + ' <option value="' . BIGBLUEBUTTONBN_ROLE_MODERATOR . '" ' . ($participant['role'] == BIGBLUEBUTTONBN_ROLE_MODERATOR ? 'selected="selected" ' : '') . '>' . get_string('mod_form_field_participant_bbb_role_' . BIGBLUEBUTTONBN_ROLE_MODERATOR, 'bigbluebuttonbn') . '</option><select>' . "\n" . |
|
| 239 | + ' </td>' . "\n" . |
|
| 240 | + ' </tr>' . "\n"; |
|
| 241 | 241 | } |
| 242 | 242 | |
| 243 | - $html_participant_selection .= ''. |
|
| 244 | - ' </table>'."\n". |
|
| 245 | - ' </div>'."\n". |
|
| 246 | - '</div>'."\n". |
|
| 247 | - '<script type="text/javascript" src="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/mod_form.js">'."\n". |
|
| 248 | - '</script>'."\n"; |
|
| 243 | + $html_participant_selection .= '' . |
|
| 244 | + ' </table>' . "\n" . |
|
| 245 | + ' </div>' . "\n" . |
|
| 246 | + '</div>' . "\n" . |
|
| 247 | + '<script type="text/javascript" src="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/mod_form.js">' . "\n" . |
|
| 248 | + '</script>' . "\n"; |
|
| 249 | 249 | |
| 250 | 250 | $mform->addElement('html', $html_participant_selection); |
| 251 | 251 | |
| 252 | 252 | // Add data |
| 253 | - $mform->addElement('html', '<script type="text/javascript">var bigbluebuttonbn_participant_selection = {"all": [], "role": '.json_encode($roles).', "user": '.bigbluebuttonbn_get_users_json($users).'}; </script>'); |
|
| 254 | - $mform->addElement('html', '<script type="text/javascript">var bigbluebuttonbn_participant_list = '.json_encode($participant_list).'; </script>'); |
|
| 255 | - $bigbluebuttonbn_strings = Array( "as" => get_string('mod_form_field_participant_list_text_as', 'bigbluebuttonbn'), |
|
| 253 | + $mform->addElement('html', '<script type="text/javascript">var bigbluebuttonbn_participant_selection = {"all": [], "role": ' . json_encode($roles) . ', "user": ' . bigbluebuttonbn_get_users_json($users) . '}; </script>'); |
|
| 254 | + $mform->addElement('html', '<script type="text/javascript">var bigbluebuttonbn_participant_list = ' . json_encode($participant_list) . '; </script>'); |
|
| 255 | + $bigbluebuttonbn_strings = Array("as" => get_string('mod_form_field_participant_list_text_as', 'bigbluebuttonbn'), |
|
| 256 | 256 | "viewer" => get_string('mod_form_field_participant_bbb_role_viewer', 'bigbluebuttonbn'), |
| 257 | 257 | "moderator" => get_string('mod_form_field_participant_bbb_role_moderator', 'bigbluebuttonbn'), |
| 258 | 258 | "remove" => get_string('mod_form_field_participant_list_action_remove', 'bigbluebuttonbn'), |
| 259 | 259 | ); |
| 260 | - $mform->addElement('html', '<script type="text/javascript">var bigbluebuttonbn_strings = '.json_encode($bigbluebuttonbn_strings).'; </script>'); |
|
| 260 | + $mform->addElement('html', '<script type="text/javascript">var bigbluebuttonbn_strings = ' . json_encode($bigbluebuttonbn_strings) . '; </script>'); |
|
| 261 | 261 | //------------------------------------------------------------------------------- |
| 262 | 262 | // Third block ends here |
| 263 | 263 | //------------------------------------------------------------------------------- |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | // Fourth block starts here |
| 268 | 268 | //------------------------------------------------------------------------------- |
| 269 | 269 | $mform->addElement('header', 'schedule', get_string('mod_form_block_schedule', 'bigbluebuttonbn')); |
| 270 | - if( isset($current_activity->openingtime) && $current_activity->openingtime != 0 || isset($current_activity->closingtime) && $current_activity->closingtime != 0 ) |
|
| 270 | + if (isset($current_activity->openingtime) && $current_activity->openingtime != 0 || isset($current_activity->closingtime) && $current_activity->closingtime != 0) |
|
| 271 | 271 | $mform->setExpanded('schedule'); |
| 272 | 272 | |
| 273 | 273 | $mform->addElement('date_time_selector', 'openingtime', get_string('mod_form_field_openingtime', 'bigbluebuttonbn'), array('optional' => true)); |
@@ -295,8 +295,8 @@ discard block |
||
| 295 | 295 | $draftitemid = file_get_submitted_draft_itemid('presentation'); |
| 296 | 296 | file_prepare_draft_area($draftitemid, $this->context->id, 'mod_bigbluebuttonbn', 'presentation', 0, array('subdirs'=>0, 'maxbytes' => 0, 'maxfiles' => 1, 'mainfile' => true)); |
| 297 | 297 | $default_values['presentation'] = $draftitemid; |
| 298 | - } catch (Exception $e){ |
|
| 299 | - error_log("Presentation could not be loaded: ".$e->getMessage()); |
|
| 298 | + } catch (Exception $e) { |
|
| 299 | + error_log("Presentation could not be loaded: " . $e->getMessage()); |
|
| 300 | 300 | return NULL; |
| 301 | 301 | } |
| 302 | 302 | } |
@@ -305,14 +305,14 @@ discard block |
||
| 305 | 305 | function validation($data, $files) { |
| 306 | 306 | $errors = parent::validation($data, $files); |
| 307 | 307 | |
| 308 | - if ( isset($data['openingtime']) && isset($data['closingtime']) ) { |
|
| 309 | - if ( $data['openingtime'] != 0 && $data['closingtime'] != 0 && $data['closingtime'] < $data['openingtime']) { |
|
| 308 | + if (isset($data['openingtime']) && isset($data['closingtime'])) { |
|
| 309 | + if ($data['openingtime'] != 0 && $data['closingtime'] != 0 && $data['closingtime'] < $data['openingtime']) { |
|
| 310 | 310 | $errors['closingtime'] = get_string('bbbduetimeoverstartingtime', 'bigbluebuttonbn'); |
| 311 | 311 | } |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | - if ( isset($data['voicebridge']) ) { |
|
| 315 | - if ( !bigbluebuttonbn_voicebridge_unique($data['voicebridge'], $data['instance'])) { |
|
| 314 | + if (isset($data['voicebridge'])) { |
|
| 315 | + if (!bigbluebuttonbn_voicebridge_unique($data['voicebridge'], $data['instance'])) { |
|
| 316 | 316 | $errors['voicebridge'] = get_string('mod_form_field_voicebridge_notunique_error', 'bigbluebuttonbn'); |
| 317 | 317 | } |
| 318 | 318 | } |