| @@ -208,7 +208,7 @@ discard block | ||
| 208 | 208 |  function bigbluebuttonbn_broker_recording_info_current($recording, $params) { | 
| 209 | 209 | $callbackresponse['status'] = true; | 
| 210 | 210 | $callbackresponse['found'] = true; | 
| 211 | - $callbackresponse['published'] = (string) $recording['published']; | |
| 211 | + $callbackresponse['published'] = (string)$recording['published']; | |
| 212 | 212 |      if (!isset($params['meta']) || empty($params['meta'])) { | 
| 213 | 213 | return $callbackresponse; | 
| 214 | 214 | } | 
| @@ -535,8 +535,8 @@ discard block | ||
| 535 | 535 | $decodedparameters = \Firebase\JWT\JWT::decode($params['signed_parameters'], | 
| 536 | 536 |              \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256')); | 
| 537 | 537 |      } catch (Exception $e) { | 
| 538 | - $error = 'Caught exception: '.$e->getMessage(); | |
| 539 | -        header('HTTP/1.0 400 Bad Request. '.$error); | |
| 538 | + $error = 'Caught exception: ' . $e->getMessage(); | |
| 539 | +        header('HTTP/1.0 400 Bad Request. ' . $error); | |
| 540 | 540 | return; | 
| 541 | 541 | } | 
| 542 | 542 | // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received. | 
| @@ -561,13 +561,13 @@ discard block | ||
| 561 | 561 | bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn); | 
| 562 | 562 | } | 
| 563 | 563 |          $overrides = array('meetingid' => $decodedparameters->meeting_id); | 
| 564 | -        $meta = '{"recordid":'.$decodedparameters->record_id.'}'; | |
| 565 | -        $meta = '{"recordid":"'.$decodedparameters->record_id.'"}'; | |
| 564 | +        $meta = '{"recordid":' . $decodedparameters->record_id . '}'; | |
| 565 | +        $meta = '{"recordid":"' . $decodedparameters->record_id . '"}'; | |
| 566 | 566 | bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTON_LOG_EVENT_CALLBACK, $overrides, $meta); | 
| 567 | 567 |          header('HTTP/1.0 202 Accepted'); | 
| 568 | 568 |      } catch (Exception $e) { | 
| 569 | - $error = 'Caught exception: '.$e->getMessage(); | |
| 570 | -        header('HTTP/1.0 503 Service Unavailable. '.$error); | |
| 569 | + $error = 'Caught exception: ' . $e->getMessage(); | |
| 570 | +        header('HTTP/1.0 503 Service Unavailable. ' . $error); | |
| 571 | 571 | } | 
| 572 | 572 | } | 
| 573 | 573 | |
| @@ -588,13 +588,13 @@ discard block | ||
| 588 | 588 | $importrecordings = $SESSION->bigbluebuttonbn_importrecordings; | 
| 589 | 589 |      if (!isset($importrecordings[$params['id']])) { | 
| 590 | 590 |          $error = "Recording {$params['id']} could not be found. It can not be imported"; | 
| 591 | -        header('HTTP/1.0 404 Not found. '.$error); | |
| 591 | +        header('HTTP/1.0 404 Not found. ' . $error); | |
| 592 | 592 | return; | 
| 593 | 593 | } | 
| 594 | 594 |      $callbackresponse = array('status' => true); | 
| 595 | 595 | $importrecordings[$params['id']]['imported'] = true; | 
| 596 | 596 |      $overrides = array('meetingid' => $importrecordings[$params['id']]['meetingID']); | 
| 597 | -    $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}'; | |
| 597 | +    $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}'; | |
| 598 | 598 | bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta); | 
| 599 | 599 | // Moodle event logger: Create an event for recording imported. | 
| 600 | 600 |      if (isset($bbbsession['bigbluebutton']) && isset($bbbsession['cm'])) { | 
| @@ -619,8 +619,8 @@ discard block | ||
| 619 | 619 | $decodedparameters = \Firebase\JWT\JWT::decode($params['signed_parameters'], | 
| 620 | 620 |              \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256')); | 
| 621 | 621 |      } catch (Exception $e) { | 
| 622 | - $error = 'Caught exception: '.$e->getMessage(); | |
| 623 | -        header('HTTP/1.0 400 Bad Request. '.$error); | |
| 622 | + $error = 'Caught exception: ' . $e->getMessage(); | |
| 623 | +        header('HTTP/1.0 400 Bad Request. ' . $error); | |
| 624 | 624 | return; | 
| 625 | 625 | } | 
| 626 | 626 | // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received. | 
| @@ -661,7 +661,7 @@ discard block | ||
| 661 | 661 | } | 
| 662 | 662 | $action = strtolower($params['action']); | 
| 663 | 663 |      if (!array_key_exists($action, $requiredparams)) { | 
| 664 | - return 'Action '.$params['action'].' can not be performed.'; | |
| 664 | + return 'Action ' . $params['action'] . ' can not be performed.'; | |
| 665 | 665 | } | 
| 666 | 666 | return bigbluebuttonbn_broker_validate_parameters_message($params, $requiredparams[$action]); | 
| 667 | 667 | } | 
| @@ -30,7 +30,7 @@ discard block | ||
| 30 | 30 | |
| 31 | 31 | global $CFG; | 
| 32 | 32 | |
| 33 | -require_once(__DIR__.'/lib.php'); | |
| 33 | +require_once(__DIR__ . '/lib.php'); | |
| 34 | 34 | |
| 35 | 35 | /** @var BIGBLUEBUTTONBN_UPDATE_CACHE boolean set to true indicates that cache has to be updated */ | 
| 36 | 36 | const BIGBLUEBUTTONBN_UPDATE_CACHE = true; | 
| @@ -108,7 +108,7 @@ discard block | ||
| 108 | 108 | 'logoutURL' => $logouturl, | 
| 109 | 109 | ]; | 
| 110 | 110 | // Choose between Adobe Flash or HTML5 Client. | 
| 111 | -    if ( $clienttype == BIGBLUEBUTTON_CLIENTTYPE_HTML5 ) { | |
| 111 | +    if ($clienttype == BIGBLUEBUTTON_CLIENTTYPE_HTML5) { | |
| 112 | 112 | $data['joinViaHtml5'] = 'true'; | 
| 113 | 113 | } | 
| 114 | 114 |      if (!is_null($configtoken)) { | 
| @@ -136,8 +136,8 @@ discard block | ||
| 136 | 136 | $data = null; | 
| 137 | 137 |      if (!is_null($pname) && !is_null($purl)) { | 
| 138 | 138 | $method = 'POST'; | 
| 139 | - $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='". | |
| 140 | - $purl."' /></module></modules>"; | |
| 139 | + $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='" . | |
| 140 | + $purl . "' /></module></modules>"; | |
| 141 | 141 | } | 
| 142 | 142 | $xml = bigbluebuttonbn_wrap_xml_load_file($createmeetingurl, $method, $data); | 
| 143 | 143 |      if ($xml) { | 
| @@ -259,7 +259,7 @@ discard block | ||
| 259 | 259 |              if (isset($recordingxml->breakoutRooms->breakoutRoom)) { | 
| 260 | 260 |                  foreach ($recordingxml->breakoutRooms->breakoutRoom as $breakoutroom) { | 
| 261 | 261 |                      $url = \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getRecordings', | 
| 262 | -                        ['recordID' => implode(',', (array) $breakoutroom)]); | |
| 262 | +                        ['recordID' => implode(',', (array)$breakoutroom)]); | |
| 263 | 263 | $xml = bigbluebuttonbn_wrap_xml_load_file($url); | 
| 264 | 264 |                      if ($xml && $xml->returncode == 'SUCCESS' && isset($xml->recordings)) { | 
| 265 | 265 | // If there were meetings already created. | 
| @@ -314,7 +314,7 @@ discard block | ||
| 314 | 314 | // Override imported flag with actual ID. | 
| 315 | 315 | $recording['imported'] = $recordimported->id; | 
| 316 | 316 |          if (isset($recordimported->protected)) { | 
| 317 | - $recording['protected'] = (string) $recordimported->protected; | |
| 317 | + $recording['protected'] = (string)$recordimported->protected; | |
| 318 | 318 | } | 
| 319 | 319 | $recordsimportedarray[$recording['recordID']] = $recording; | 
| 320 | 320 | } | 
| @@ -344,21 +344,21 @@ discard block | ||
| 344 | 344 | // Add formats. | 
| 345 | 345 | $playbackarray = array(); | 
| 346 | 346 |      foreach ($recording->playback->format as $format) { | 
| 347 | -        $playbackarray[(string) $format->type] = array('type' => (string) $format->type, | |
| 348 | - 'url' => trim((string) $format->url), 'length' => (string) $format->length); | |
| 347 | +        $playbackarray[(string)$format->type] = array('type' => (string)$format->type, | |
| 348 | + 'url' => trim((string)$format->url), 'length' => (string)$format->length); | |
| 349 | 349 | // Add preview per format when existing. | 
| 350 | 350 |          if ($format->preview) { | 
| 351 | - $playbackarray[(string) $format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview); | |
| 351 | + $playbackarray[(string)$format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview); | |
| 352 | 352 | } | 
| 353 | 353 | } | 
| 354 | 354 | // Add the metadata to the recordings array. | 
| 355 | 355 | $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata)); | 
| 356 | -    $recordingarray = array('recordID' => (string) $recording->recordID, | |
| 357 | - 'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name, | |
| 358 | - 'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime, | |
| 359 | - 'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray); | |
| 356 | +    $recordingarray = array('recordID' => (string)$recording->recordID, | |
| 357 | + 'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name, | |
| 358 | + 'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime, | |
| 359 | + 'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray); | |
| 360 | 360 |      if (isset($recording->protected)) { | 
| 361 | - $recordingarray['protected'] = (string) $recording->protected; | |
| 361 | + $recordingarray['protected'] = (string)$recording->protected; | |
| 362 | 362 | } | 
| 363 | 363 | return $recordingarray + $metadataarray; | 
| 364 | 364 | } | 
| @@ -373,9 +373,9 @@ discard block | ||
| 373 | 373 |  function bigbluebuttonbn_get_recording_preview_images($preview) { | 
| 374 | 374 | $imagesarray = array(); | 
| 375 | 375 |      foreach ($preview->images->image as $image) { | 
| 376 | -        $imagearray = array('url' => trim((string) $image)); | |
| 376 | +        $imagearray = array('url' => trim((string)$image)); | |
| 377 | 377 |          foreach ($image->attributes() as $attkey => $attvalue) { | 
| 378 | - $imagearray[$attkey] = (string) $attvalue; | |
| 378 | + $imagearray[$attkey] = (string)$attvalue; | |
| 379 | 379 | } | 
| 380 | 380 | array_push($imagesarray, $imagearray); | 
| 381 | 381 | } | 
| @@ -395,7 +395,7 @@ discard block | ||
| 395 | 395 |          if (is_object($value)) { | 
| 396 | 396 | $value = ''; | 
| 397 | 397 | } | 
| 398 | - $metadataarray['meta_'.$key] = $value; | |
| 398 | + $metadataarray['meta_' . $key] = $value; | |
| 399 | 399 | } | 
| 400 | 400 | return $metadataarray; | 
| 401 | 401 | } | 
| @@ -470,7 +470,7 @@ discard block | ||
| 470 | 470 |      $ids = explode(',', $recordids); | 
| 471 | 471 |      foreach ($ids as $id) { | 
| 472 | 472 | $xml = bigbluebuttonbn_wrap_xml_load_file( | 
| 473 | -            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params) | |
| 473 | +            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params) | |
| 474 | 474 | ); | 
| 475 | 475 |          if ($xml && $xml->returncode != 'SUCCESS') { | 
| 476 | 476 | return false; | 
| @@ -535,7 +535,7 @@ discard block | ||
| 535 | 535 | return $xml; | 
| 536 | 536 |          } catch (Exception $e) { | 
| 537 | 537 | libxml_use_internal_errors($previous); | 
| 538 | - $error = 'Caught exception: '.$e->getMessage(); | |
| 538 | + $error = 'Caught exception: ' . $e->getMessage(); | |
| 539 | 539 | debugging($error, DEBUG_DEVELOPER); | 
| 540 | 540 | return null; | 
| 541 | 541 | } | 
| @@ -546,7 +546,7 @@ discard block | ||
| 546 | 546 | $response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS); | 
| 547 | 547 | return $response; | 
| 548 | 548 |      } catch (Exception $e) { | 
| 549 | - $error = 'Caught exception: '.$e->getMessage(); | |
| 549 | + $error = 'Caught exception: ' . $e->getMessage(); | |
| 550 | 550 | debugging($error, DEBUG_DEVELOPER); | 
| 551 | 551 | libxml_use_internal_errors($previous); | 
| 552 | 552 | return null; | 
| @@ -572,8 +572,8 @@ discard block | ||
| 572 | 572 | } | 
| 573 | 573 | $options = array(); | 
| 574 | 574 | $options['CURLOPT_HTTPHEADER'] = array( | 
| 575 | - 'Content-Type: '.$contenttype, | |
| 576 | - 'Content-Length: '.strlen($data), | |
| 575 | + 'Content-Type: ' . $contenttype, | |
| 576 | + 'Content-Length: ' . strlen($data), | |
| 577 | 577 | 'Content-Language: en-US', | 
| 578 | 578 | ); | 
| 579 | 579 | |
| @@ -594,7 +594,7 @@ discard block | ||
| 594 | 594 | * @return void | 
| 595 | 595 | */ | 
| 596 | 596 |  function bigbluebuttonbn_end_meeting_if_running($bigbluebuttonbn) { | 
| 597 | - $meetingid = $bigbluebuttonbn->meetingid.'-'.$bigbluebuttonbn->course.'-'.$bigbluebuttonbn->id; | |
| 597 | + $meetingid = $bigbluebuttonbn->meetingid . '-' . $bigbluebuttonbn->course . '-' . $bigbluebuttonbn->id; | |
| 598 | 598 |      if (bigbluebuttonbn_is_meeting_running($meetingid)) { | 
| 599 | 599 | bigbluebuttonbn_end_meeting($meetingid, $bigbluebuttonbn->moderatorpass); | 
| 600 | 600 | } | 
| @@ -614,9 +614,9 @@ discard block | ||
| 614 | 614 |      if ($userroles) { | 
| 615 | 615 | $where = ''; | 
| 616 | 616 |          foreach ($userroles as $userrole) { | 
| 617 | - $where .= (empty($where) ? ' WHERE' : ' OR').' id=' . $userrole->roleid; | |
| 617 | + $where .= (empty($where) ? ' WHERE' : ' OR') . ' id=' . $userrole->roleid; | |
| 618 | 618 | } | 
| 619 | -        $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where); | |
| 619 | +        $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where); | |
| 620 | 620 | } | 
| 621 | 621 | return $userroles; | 
| 622 | 622 | } | 
| @@ -639,7 +639,7 @@ discard block | ||
| 639 | 639 | * @return array $users | 
| 640 | 640 | */ | 
| 641 | 641 |  function bigbluebuttonbn_get_users(context $context = null) { | 
| 642 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); | |
| 642 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); | |
| 643 | 643 |      foreach ($users as $key => $value) { | 
| 644 | 644 | $users[$key] = fullname($value); | 
| 645 | 645 | } | 
| @@ -654,7 +654,7 @@ discard block | ||
| 654 | 654 | * @return array $users | 
| 655 | 655 | */ | 
| 656 | 656 |  function bigbluebuttonbn_get_users_select(context $context = null) { | 
| 657 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); | |
| 657 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); | |
| 658 | 658 |      foreach ($users as $key => $value) { | 
| 659 | 659 |          $users[$key] = array('id' => $value->id, 'name' => fullname($value)); | 
| 660 | 660 | } | 
| @@ -669,7 +669,7 @@ discard block | ||
| 669 | 669 | * @return array $roles | 
| 670 | 670 | */ | 
| 671 | 671 |  function bigbluebuttonbn_get_roles(context $context = null) { | 
| 672 | - $roles = (array) role_get_names($context); | |
| 672 | + $roles = (array)role_get_names($context); | |
| 673 | 673 |      foreach ($roles as $key => $value) { | 
| 674 | 674 | $roles[$key] = $value->localname; | 
| 675 | 675 | } | 
| @@ -684,7 +684,7 @@ discard block | ||
| 684 | 684 | * @return array $users | 
| 685 | 685 | */ | 
| 686 | 686 |  function bigbluebuttonbn_get_roles_select(context $context = null) { | 
| 687 | - $roles = (array) role_get_names($context); | |
| 687 | + $roles = (array)role_get_names($context); | |
| 688 | 688 |      foreach ($roles as $key => $value) { | 
| 689 | 689 |          $roles[$key] = array('id' => $value->id, 'name' => $value->localname); | 
| 690 | 690 | } | 
| @@ -699,7 +699,7 @@ discard block | ||
| 699 | 699 | * @return object $role | 
| 700 | 700 | */ | 
| 701 | 701 |  function bigbluebuttonbn_get_role($id) { | 
| 702 | - $roles = (array) role_get_names(); | |
| 702 | + $roles = (array)role_get_names(); | |
| 703 | 703 |      if (is_numeric($id) && isset($roles[$id])) { | 
| 704 | 704 | return (object)$roles[$id]; | 
| 705 | 705 | } | 
| @@ -856,7 +856,7 @@ discard block | ||
| 856 | 856 |      if (!isguestuser()) { | 
| 857 | 857 | $userroles = bigbluebuttonbn_get_user_roles($context, $userid); | 
| 858 | 858 | } | 
| 859 | - return bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles); | |
| 859 | + return bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles); | |
| 860 | 860 | } | 
| 861 | 861 | |
| 862 | 862 | /** | 
| @@ -1056,7 +1056,7 @@ discard block | ||
| 1056 | 1056 |  function bigbluebuttonbn_generate_nonce() { | 
| 1057 | 1057 | $mt = microtime(); | 
| 1058 | 1058 | $rand = mt_rand(); | 
| 1059 | - return md5($mt.$rand); | |
| 1059 | + return md5($mt . $rand); | |
| 1060 | 1060 | } | 
| 1061 | 1061 | |
| 1062 | 1062 | /** | 
| @@ -1146,10 +1146,10 @@ discard block | ||
| 1146 | 1146 | $now = time(); | 
| 1147 | 1147 |      if (!$updatecache && isset($result) && $now < ($result['creation_time'] + $cachettl)) { | 
| 1148 | 1148 | // Use the value in the cache. | 
| 1149 | - return (array) json_decode($result['meeting_info']); | |
| 1149 | + return (array)json_decode($result['meeting_info']); | |
| 1150 | 1150 | } | 
| 1151 | 1151 | // Ping again and refresh the cache. | 
| 1152 | - $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file( | |
| 1152 | + $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file( | |
| 1153 | 1153 |          \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) | 
| 1154 | 1154 | ); | 
| 1155 | 1155 |      $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); | 
| @@ -1260,7 +1260,7 @@ discard block | ||
| 1260 | 1260 | * @return object | 
| 1261 | 1261 | */ | 
| 1262 | 1262 |  function bigbluebuttonbn_set_config_xml($meetingid, $configxml) { | 
| 1263 | -    $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?'; | |
| 1263 | +    $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?'; | |
| 1264 | 1264 | $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml); | 
| 1265 | 1265 | $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, 'POST', | 
| 1266 | 1266 | $configxmlparams, 'application/x-www-form-urlencoded'); | 
| @@ -1276,8 +1276,8 @@ discard block | ||
| 1276 | 1276 | * @return string | 
| 1277 | 1277 | */ | 
| 1278 | 1278 |  function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) { | 
| 1279 | - $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid); | |
| 1280 | -    $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.\mod_bigbluebuttonbn\locallib\config::get('shared_secret')); | |
| 1279 | + $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid); | |
| 1280 | +    $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . \mod_bigbluebuttonbn\locallib\config::get('shared_secret')); | |
| 1281 | 1281 | return $configxmlparams; | 
| 1282 | 1282 | } | 
| 1283 | 1283 | |
| @@ -1291,7 +1291,7 @@ discard block | ||
| 1291 | 1291 | */ | 
| 1292 | 1292 |  function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) { | 
| 1293 | 1293 | $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml); | 
| 1294 | - $configxmlarray = (array) $configxml; | |
| 1294 | + $configxmlarray = (array)$configxml; | |
| 1295 | 1295 |      if ($configxmlarray['returncode'] != 'SUCCESS') { | 
| 1296 | 1296 |          debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER); | 
| 1297 | 1297 | return ''; | 
| @@ -1385,7 +1385,7 @@ discard block | ||
| 1385 | 1385 | global $USER; | 
| 1386 | 1386 | $starttime = $starttime - ($starttime % 1000); | 
| 1387 | 1387 | // Set formatted date. | 
| 1388 | -    $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z'; | |
| 1388 | +    $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z'; | |
| 1389 | 1389 | return userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone)); | 
| 1390 | 1390 | } | 
| 1391 | 1391 | |
| @@ -1501,7 +1501,7 @@ discard block | ||
| 1501 | 1501 | * @return string | 
| 1502 | 1502 | */ | 
| 1503 | 1503 |  function bigbluebuttonbn_get_recording_data_row_preview($recording) { | 
| 1504 | -    $options = array('id' => 'preview-'.$recording['recordID']); | |
| 1504 | +    $options = array('id' => 'preview-' . $recording['recordID']); | |
| 1505 | 1505 |      if ($recording['published'] === 'false') { | 
| 1506 | 1506 | $options['hidden'] = 'hidden'; | 
| 1507 | 1507 | } | 
| @@ -1563,7 +1563,7 @@ discard block | ||
| 1563 | 1563 |      if ($recording['published'] === 'false') { | 
| 1564 | 1564 | $visibility = 'hidden '; | 
| 1565 | 1565 | } | 
| 1566 | - $id = 'playbacks-'.$recording['recordID']; | |
| 1566 | + $id = 'playbacks-' . $recording['recordID']; | |
| 1567 | 1567 |      $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported, | 
| 1568 | 1568 | 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], | 
| 1569 | 1569 | 'title' => $title, $visibility => $visibility)); | 
| @@ -1588,11 +1588,11 @@ discard block | ||
| 1588 | 1588 |      if (!bigbluebuttonbn_include_recording_data_row_type($recording, $bbbsession, $playback)) { | 
| 1589 | 1589 | return ''; | 
| 1590 | 1590 | } | 
| 1591 | -    $text = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'); | |
| 1591 | +    $text = get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn'); | |
| 1592 | 1592 | $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bbbsession['bigbluebuttonbn']->id . | 
| 1593 | - '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; | |
| 1593 | + '&mid=' . $recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; | |
| 1594 | 1594 |      if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') { | 
| 1595 | - $href .= '&href='.urlencode(trim($playback['url'])); | |
| 1595 | + $href .= '&href=' . urlencode(trim($playback['url'])); | |
| 1596 | 1596 | } | 
| 1597 | 1597 | $linkattributes = array( | 
| 1598 | 1598 | 'id' => 'recording-play-' . $playback['type'] . '-' . $recording['recordID'], | 
| @@ -1776,7 +1776,7 @@ discard block | ||
| 1776 | 1776 | $linkattributes['class'] = 'disabled'; | 
| 1777 | 1777 | unset($linkattributes['onclick']); | 
| 1778 | 1778 | } | 
| 1779 | -        $icon = new pix_icon('i/'.$data['tag'], | |
| 1779 | +        $icon = new pix_icon('i/' . $data['tag'], | |
| 1780 | 1780 |              get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'), | 
| 1781 | 1781 | 'moodle', $iconattributes); | 
| 1782 | 1782 |          return $OUTPUT->action_icon('#', $icon, null, $linkattributes, false); | 
| @@ -1939,7 +1939,7 @@ discard block | ||
| 1939 | 1939 | */ | 
| 1940 | 1940 |  function bigbluebuttonbn_get_recording_table_row($bbbsession, $recording, $rowdata) { | 
| 1941 | 1941 | $row = new html_table_row(); | 
| 1942 | - $row->id = 'recording-tr-'.$recording['recordID']; | |
| 1942 | + $row->id = 'recording-tr-' . $recording['recordID']; | |
| 1943 | 1943 | $row->attributes['data-imported'] = 'false'; | 
| 1944 | 1944 | $texthead = ''; | 
| 1945 | 1945 | $texttail = ''; | 
| @@ -1952,7 +1952,7 @@ discard block | ||
| 1952 | 1952 |      $rowdata->date_formatted = str_replace(' ', ' ', $rowdata->date_formatted); | 
| 1953 | 1953 | $row->cells = array(); | 
| 1954 | 1954 | $row->cells[] = $texthead . $rowdata->recording . $texttail; | 
| 1955 | - $row->cells[] = $texthead . $rowdata->meeting . $texttail;; | |
| 1955 | + $row->cells[] = $texthead . $rowdata->meeting . $texttail; ; | |
| 1956 | 1956 | $row->cells[] = $texthead . $rowdata->activity . $texttail; | 
| 1957 | 1957 | $row->cells[] = $texthead . $rowdata->description . $texttail; | 
| 1958 | 1958 |      if (bigbluebuttonbn_get_recording_data_preview_enabled($bbbsession)) { | 
| @@ -2000,9 +2000,9 @@ discard block | ||
| 2000 | 2000 |  function bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn) { | 
| 2001 | 2001 | $sender = get_admin(); | 
| 2002 | 2002 | // Prepare message. | 
| 2003 | -    $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn'). | |
| 2004 | - ' "' . $bigbluebuttonbn->name . '" '. | |
| 2005 | -        get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>'; | |
| 2003 | +    $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . | |
| 2004 | + ' "' . $bigbluebuttonbn->name . '" ' . | |
| 2005 | +        get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>'; | |
| 2006 | 2006 | $context = context_course::instance($bigbluebuttonbn->course); | 
| 2007 | 2007 | \mod_bigbluebuttonbn\locallib\notifier::notification_send($sender, $bigbluebuttonbn, $messagetext); | 
| 2008 | 2008 | } | 
| @@ -2224,7 +2224,7 @@ discard block | ||
| 2224 | 2224 | } | 
| 2225 | 2225 | // Prepare select for loading records based on existent bigbluebuttonbns. | 
| 2226 | 2226 |      $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE '; | 
| 2227 | -    $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')'; | |
| 2227 | +    $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')'; | |
| 2228 | 2228 | // Include only Create events and exclude those with record not true. | 
| 2229 | 2229 | $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?'; | 
| 2230 | 2230 | // Execute select for loading records based on existent bigbluebuttonbns. | 
| @@ -2398,8 +2398,8 @@ discard block | ||
| 2398 | 2398 |  function bigbluebuttonbn_format_activity_time($time) { | 
| 2399 | 2399 | $activitytime = ''; | 
| 2400 | 2400 |      if ($time) { | 
| 2401 | - $activitytime = calendar_day_representation($time).' '. | |
| 2402 | -          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. | |
| 2401 | + $activitytime = calendar_day_representation($time) . ' ' . | |
| 2402 | +          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' . | |
| 2403 | 2403 | calendar_time_representation($time); | 
| 2404 | 2404 | } | 
| 2405 | 2405 | return $activitytime; | 
| @@ -2858,7 +2858,7 @@ discard block | ||
| 2858 | 2858 | * | 
| 2859 | 2859 | * @return string | 
| 2860 | 2860 | */ | 
| 2861 | -function bigbluebuttonbn_render_warning($message, $type='info', $href='', $text='', $class='') { | |
| 2861 | +function bigbluebuttonbn_render_warning($message, $type = 'info', $href = '', $text = '', $class = '') { | |
| 2862 | 2862 | global $OUTPUT; | 
| 2863 | 2863 | $output = "\n"; | 
| 2864 | 2864 | // Evaluates if config_warning is enabled. | 
| @@ -2897,11 +2897,11 @@ discard block | ||
| 2897 | 2897 |      if ($class == '') { | 
| 2898 | 2898 | $class = 'btn btn-secondary'; | 
| 2899 | 2899 | } | 
| 2900 | - $output = ' <form method="post" action="' . $href . '" class="form-inline">'."\n"; | |
| 2901 | - $output .= ' <button type="submit" class="' . $class . '"'."\n"; | |
| 2902 | - $output .= ' title="' . $title . '"'."\n"; | |
| 2903 | - $output .= ' >' . $text . '</button>'."\n"; | |
| 2904 | - $output .= ' </form>'."\n"; | |
| 2900 | + $output = ' <form method="post" action="' . $href . '" class="form-inline">' . "\n"; | |
| 2901 | + $output .= ' <button type="submit" class="' . $class . '"' . "\n"; | |
| 2902 | + $output .= ' title="' . $title . '"' . "\n"; | |
| 2903 | + $output .= ' >' . $text . '</button>' . "\n"; | |
| 2904 | + $output .= ' </form>' . "\n"; | |
| 2905 | 2905 | return $output; | 
| 2906 | 2906 | } | 
| 2907 | 2907 | |
| @@ -3066,7 +3066,7 @@ discard block | ||
| 3066 | 3066 | $bbbsession['modPW'] = $bbbsession['bigbluebuttonbn']->moderatorpass; | 
| 3067 | 3067 | $bbbsession['viewerPW'] = $bbbsession['bigbluebuttonbn']->viewerpass; | 
| 3068 | 3068 | // Database info related to the activity. | 
| 3069 | - $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'. | |
| 3069 | + $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' . | |
| 3070 | 3070 | $bbbsession['bigbluebuttonbn']->id; | 
| 3071 | 3071 | $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name; | 
| 3072 | 3072 | $bbbsession['meetingdescription'] = $bbbsession['bigbluebuttonbn']->intro; | 
| @@ -3098,10 +3098,10 @@ discard block | ||
| 3098 | 3098 |      if ($bbbsession['bigbluebuttonbn']->record) { | 
| 3099 | 3099 | // Check if is enable record all from start. | 
| 3100 | 3100 |          if ($bbbsession['recordallfromstart']) { | 
| 3101 | -            $bbbsession['welcome'] .= '<br><br>'.get_string('bbbrecordallfromstartwarning', | |
| 3101 | +            $bbbsession['welcome'] .= '<br><br>' . get_string('bbbrecordallfromstartwarning', | |
| 3102 | 3102 | 'bigbluebuttonbn'); | 
| 3103 | 3103 |          } else { | 
| 3104 | -            $bbbsession['welcome'] .= '<br><br>'.get_string('bbbrecordwarning', 'bigbluebuttonbn'); | |
| 3104 | +            $bbbsession['welcome'] .= '<br><br>' . get_string('bbbrecordwarning', 'bigbluebuttonbn'); | |
| 3105 | 3105 | } | 
| 3106 | 3106 | } | 
| 3107 | 3107 | $bbbsession['openingtime'] = $bbbsession['bigbluebuttonbn']->openingtime; | 
| @@ -3116,7 +3116,7 @@ discard block | ||
| 3116 | 3116 | $bbbsession['originServerName'] = $parsedurl['host']; | 
| 3117 | 3117 | $bbbsession['originServerUrl'] = $CFG->wwwroot; | 
| 3118 | 3118 | $bbbsession['originServerCommonName'] = ''; | 
| 3119 | -    $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn ('.get_config('mod_bigbluebuttonbn', 'version').')'; | |
| 3119 | +    $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn (' . get_config('mod_bigbluebuttonbn', 'version') . ')'; | |
| 3120 | 3120 | $bbbsession['bnserver'] = bigbluebuttonbn_is_bn_server(); | 
| 3121 | 3121 | // Setting for clienttype, assign flash if not enabled, or default if not editable. | 
| 3122 | 3122 | $bbbsession['clienttype'] = BIGBLUEBUTTON_CLIENTTYPE_FLASH; | 
| @@ -3178,7 +3178,7 @@ discard block | ||
| 3178 | 3178 | ); | 
| 3179 | 3179 | |
| 3180 | 3180 | // Check status and set extra values. | 
| 3181 | - $activitystatus = bigbluebuttonbn_view_get_activity_status($bbbsession); // In locallib. | |
| 3181 | + $activitystatus = bigbluebuttonbn_view_get_activity_status($bbbsession); // In locallib. | |
| 3182 | 3182 |      if ($activitystatus == 'ended') { | 
| 3183 | 3183 | $bbbsession['presentation'] = bigbluebuttonbn_get_presentation_array( | 
| 3184 | 3184 | $bbbsession['context'], $bbbsession['bigbluebuttonbn']->presentation); |