@@ -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,33 +206,33 @@ 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 | $playbackArray = array(); |
| 223 | - foreach ( $recording->playback->format as $format ) { |
|
| 224 | - $playbackArray[(string) $format->type] = array( 'type' => (string) $format->type, 'url' => (string) $format->url, 'length' => (string) $format->length ); |
|
| 223 | + foreach ($recording->playback->format as $format) { |
|
| 224 | + $playbackArray[(string)$format->type] = array('type' => (string)$format->type, 'url' => (string)$format->url, 'length' => (string)$format->length); |
|
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | //Add the metadata to the recordings array |
| 228 | 228 | $metadataArray = array(); |
| 229 | 229 | $metadata = get_object_vars($recording->metadata); |
| 230 | - foreach ( $metadata as $key => $value ) { |
|
| 231 | - if ( is_object($value) ) $value = ''; |
|
| 232 | - $metadataArray['meta_'.$key] = $value; |
|
| 230 | + foreach ($metadata as $key => $value) { |
|
| 231 | + if (is_object($value)) $value = ''; |
|
| 232 | + $metadataArray['meta_' . $key] = $value; |
|
| 233 | 233 | } |
| 234 | 234 | |
| 235 | - $recordings[] = array( 'recordID' => (string) $recording->recordID, 'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name, 'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime, 'endTime' => (string) $recording->endTime, 'playbacks' => $playbackArray ) + $metadataArray; |
|
| 235 | + $recordings[] = array('recordID' => (string)$recording->recordID, 'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name, 'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime, 'endTime' => (string)$recording->endTime, 'playbacks' => $playbackArray) + $metadataArray; |
|
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | usort($recordings, 'bigbluebuttonbn_recordingBuildSorter'); |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | return $recordings; |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | -function bigbluebuttonbn_index_recordings($recordings, $index_key='recordID') { |
|
| 244 | +function bigbluebuttonbn_index_recordings($recordings, $index_key = 'recordID') { |
|
| 245 | 245 | $indexed_recordings = array(); |
| 246 | 246 | |
| 247 | 247 | foreach ($recordings as $recording) { |
@@ -251,28 +251,28 @@ discard block |
||
| 251 | 251 | return $indexed_recordings; |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | -function bigbluebuttonbn_getRecordingArray( $recordingID, $meetingID, $URL, $SALT ) { |
|
| 254 | +function bigbluebuttonbn_getRecordingArray($recordingID, $meetingID, $URL, $SALT) { |
|
| 255 | 255 | $recording = array(); |
| 256 | 256 | |
| 257 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getRecordingsURL( $URL, $SALT, $meetingID ) ); |
|
| 257 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getRecordingsURL($URL, $SALT, $meetingID)); |
|
| 258 | 258 | |
| 259 | - if ( $xml && $xml->returncode == 'SUCCESS' && isset($xml->recordings) ) { //If there were meetings already created |
|
| 259 | + if ($xml && $xml->returncode == 'SUCCESS' && isset($xml->recordings)) { //If there were meetings already created |
|
| 260 | 260 | foreach ($xml->recordings->recording as $recording) { |
| 261 | - if( $recording->recordID == $recordingID ) { |
|
| 261 | + if ($recording->recordID == $recordingID) { |
|
| 262 | 262 | $playbackArray = array(); |
| 263 | - foreach ( $recording->playback->format as $format ){ |
|
| 264 | - $playbackArray[(string) $format->type] = array( 'type' => (string) $format->type, 'url' => (string) $format->url ); |
|
| 263 | + foreach ($recording->playback->format as $format) { |
|
| 264 | + $playbackArray[(string)$format->type] = array('type' => (string)$format->type, 'url' => (string)$format->url); |
|
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 | //Add the metadata to the recordings array |
| 268 | 268 | $metadataArray = array(); |
| 269 | 269 | $metadata = get_object_vars($recording->metadata); |
| 270 | 270 | foreach ($metadata as $key => $value) { |
| 271 | - if(is_object($value)) $value = ''; |
|
| 272 | - $metadataArray['meta_'.$key] = $value; |
|
| 271 | + if (is_object($value)) $value = ''; |
|
| 272 | + $metadataArray['meta_' . $key] = $value; |
|
| 273 | 273 | } |
| 274 | 274 | |
| 275 | - $recording = array( 'recordID' => (string) $recording->recordID, 'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name, 'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime, 'endTime' => (string) $recording->endTime, 'playbacks' => $playbackArray ) + $metadataArray; |
|
| 275 | + $recording = array('recordID' => (string)$recording->recordID, 'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name, 'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime, 'endTime' => (string)$recording->endTime, 'playbacks' => $playbackArray) + $metadataArray; |
|
| 276 | 276 | break; |
| 277 | 277 | } |
| 278 | 278 | } |
@@ -281,36 +281,36 @@ discard block |
||
| 281 | 281 | return $recording; |
| 282 | 282 | } |
| 283 | 283 | |
| 284 | -function bigbluebuttonbn_recordingBuildSorter($a, $b){ |
|
| 285 | - if( $a['startTime'] < $b['startTime']) return -1; |
|
| 286 | - else if( $a['startTime'] == $b['startTime']) return 0; |
|
| 284 | +function bigbluebuttonbn_recordingBuildSorter($a, $b) { |
|
| 285 | + if ($a['startTime'] < $b['startTime']) return -1; |
|
| 286 | + else if ($a['startTime'] == $b['startTime']) return 0; |
|
| 287 | 287 | else return 1; |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | -function bigbluebuttonbn_doDeleteRecordings( $recordIDs, $URL, $SALT ) { |
|
| 291 | - $ids = explode(",", $recordIDs); |
|
| 292 | - foreach( $ids as $id){ |
|
| 293 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getDeleteRecordingsURL($id, $URL, $SALT) ); |
|
| 294 | - if( $xml && $xml->returncode != 'SUCCESS' ) |
|
| 290 | +function bigbluebuttonbn_doDeleteRecordings($recordIDs, $URL, $SALT) { |
|
| 291 | + $ids = explode(",", $recordIDs); |
|
| 292 | + foreach ($ids as $id) { |
|
| 293 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getDeleteRecordingsURL($id, $URL, $SALT)); |
|
| 294 | + if ($xml && $xml->returncode != 'SUCCESS') |
|
| 295 | 295 | return false; |
| 296 | 296 | } |
| 297 | 297 | return true; |
| 298 | 298 | } |
| 299 | 299 | |
| 300 | -function bigbluebuttonbn_doPublishRecordings( $recordIDs, $set, $URL, $SALT ) { |
|
| 301 | - $ids = explode(",", $recordIDs); |
|
| 302 | - foreach( $ids as $id){ |
|
| 303 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getPublishRecordingsURL($id, $set, $URL, $SALT) ); |
|
| 304 | - if( $xml && $xml->returncode != 'SUCCESS' ) |
|
| 300 | +function bigbluebuttonbn_doPublishRecordings($recordIDs, $set, $URL, $SALT) { |
|
| 301 | + $ids = explode(",", $recordIDs); |
|
| 302 | + foreach ($ids as $id) { |
|
| 303 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getPublishRecordingsURL($id, $set, $URL, $SALT)); |
|
| 304 | + if ($xml && $xml->returncode != 'SUCCESS') |
|
| 305 | 305 | return false; |
| 306 | 306 | } |
| 307 | 307 | return true; |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | -function bigbluebuttonbn_doEndMeeting( $meetingID, $modPW, $URL, $SALT ) { |
|
| 311 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getEndMeetingURL( $meetingID, $modPW, $URL, $SALT ) ); |
|
| 310 | +function bigbluebuttonbn_doEndMeeting($meetingID, $modPW, $URL, $SALT) { |
|
| 311 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getEndMeetingURL($meetingID, $modPW, $URL, $SALT)); |
|
| 312 | 312 | |
| 313 | - if( $xml ) { //If the xml packet returned failure it displays the message to the user |
|
| 313 | + if ($xml) { //If the xml packet returned failure it displays the message to the user |
|
| 314 | 314 | return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); |
| 315 | 315 | } |
| 316 | 316 | else { //If the server is unreachable, then prompts the user of the necessary action |
@@ -318,46 +318,46 @@ discard block |
||
| 318 | 318 | } |
| 319 | 319 | } |
| 320 | 320 | |
| 321 | -function bigbluebuttonbn_isMeetingRunning( $meetingID, $URL, $SALT ) { |
|
| 322 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getIsMeetingRunningURL( $meetingID, $URL, $SALT ) ); |
|
| 323 | - if ( $xml && $xml->returncode == 'SUCCESS' ) { |
|
| 324 | - return ( ( $xml->running == 'true' ) ? true : false); |
|
| 321 | +function bigbluebuttonbn_isMeetingRunning($meetingID, $URL, $SALT) { |
|
| 322 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getIsMeetingRunningURL($meetingID, $URL, $SALT)); |
|
| 323 | + if ($xml && $xml->returncode == 'SUCCESS') { |
|
| 324 | + return (($xml->running == 'true') ? true : false); |
|
| 325 | 325 | } else { |
| 326 | - return ( false ); |
|
| 326 | + return (false); |
|
| 327 | 327 | } |
| 328 | 328 | } |
| 329 | 329 | |
| 330 | 330 | |
| 331 | -function bigbluebuttonbn_getServerVersion( $URL ){ |
|
| 332 | - $xml = bigbluebuttonbn_wrap_xml_load_file( $URL."api" ); |
|
| 333 | - if ( $xml && $xml->returncode == 'SUCCESS' ) { |
|
| 331 | +function bigbluebuttonbn_getServerVersion($URL) { |
|
| 332 | + $xml = bigbluebuttonbn_wrap_xml_load_file($URL . "api"); |
|
| 333 | + if ($xml && $xml->returncode == 'SUCCESS') { |
|
| 334 | 334 | return $xml->version; |
| 335 | 335 | } else { |
| 336 | 336 | return NULL; |
| 337 | 337 | } |
| 338 | 338 | } |
| 339 | 339 | |
| 340 | -function bigbluebuttonbn_getMeetingXML( $meetingID, $URL, $SALT ) { |
|
| 341 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getIsMeetingRunningURL( $meetingID, $URL, $SALT ) ); |
|
| 342 | - if ( $xml && $xml->returncode == 'SUCCESS') { |
|
| 343 | - return ( str_replace('</response>', '', str_replace("<?xml version=\"1.0\"?>\n<response>", '', $xml->asXML()))); |
|
| 340 | +function bigbluebuttonbn_getMeetingXML($meetingID, $URL, $SALT) { |
|
| 341 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getIsMeetingRunningURL($meetingID, $URL, $SALT)); |
|
| 342 | + if ($xml && $xml->returncode == 'SUCCESS') { |
|
| 343 | + return (str_replace('</response>', '', str_replace("<?xml version=\"1.0\"?>\n<response>", '', $xml->asXML()))); |
|
| 344 | 344 | } else { |
| 345 | 345 | return 'false'; |
| 346 | 346 | } |
| 347 | 347 | } |
| 348 | 348 | |
| 349 | -function bigbluebuttonbn_wrap_xml_load_file($url, $method=BIGBLUEBUTTONBN_METHOD_GET, $data=null) { |
|
| 350 | - if ( bigbluebuttonbn_debugdisplay() ) error_log("Request to: ".$url); |
|
| 349 | +function bigbluebuttonbn_wrap_xml_load_file($url, $method = BIGBLUEBUTTONBN_METHOD_GET, $data = null) { |
|
| 350 | + if (bigbluebuttonbn_debugdisplay()) error_log("Request to: " . $url); |
|
| 351 | 351 | |
| 352 | 352 | if (extension_loaded('curl')) { |
| 353 | 353 | $c = new curl(); |
| 354 | - $c->setopt( Array( "SSL_VERIFYPEER" => true)); |
|
| 355 | - if( $method == BIGBLUEBUTTONBN_METHOD_POST ) { |
|
| 356 | - if( !is_null($data) ) { |
|
| 357 | - if( !is_array($data) ) { |
|
| 354 | + $c->setopt(Array("SSL_VERIFYPEER" => true)); |
|
| 355 | + if ($method == BIGBLUEBUTTONBN_METHOD_POST) { |
|
| 356 | + if (!is_null($data)) { |
|
| 357 | + if (!is_array($data)) { |
|
| 358 | 358 | $options['CURLOPT_HTTPHEADER'] = array( |
| 359 | 359 | 'Content-Type: text/xml', |
| 360 | - 'Content-Length: '.strlen($data), |
|
| 360 | + 'Content-Length: ' . strlen($data), |
|
| 361 | 361 | 'Content-Language: en-US' |
| 362 | 362 | ); |
| 363 | 363 | $response = $c->post($url, $data, $options); |
@@ -379,9 +379,9 @@ discard block |
||
| 379 | 379 | try { |
| 380 | 380 | $xml = new SimpleXMLElement($response, LIBXML_NOCDATA); |
| 381 | 381 | return $xml; |
| 382 | - } catch (Exception $e){ |
|
| 382 | + } catch (Exception $e) { |
|
| 383 | 383 | libxml_use_internal_errors($previous); |
| 384 | - $error = 'Caught exception: '.$e->getMessage(); |
|
| 384 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
| 385 | 385 | error_log($error); |
| 386 | 386 | return NULL; |
| 387 | 387 | } |
@@ -393,18 +393,18 @@ discard block |
||
| 393 | 393 | } else { |
| 394 | 394 | $previous = libxml_use_internal_errors(true); |
| 395 | 395 | try { |
| 396 | - $xml = simplexml_load_file($url,'SimpleXMLElement', LIBXML_NOCDATA); |
|
| 396 | + $xml = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA); |
|
| 397 | 397 | return $xml; |
| 398 | - } catch (Exception $e){ |
|
| 398 | + } catch (Exception $e) { |
|
| 399 | 399 | libxml_use_internal_errors($previous); |
| 400 | 400 | return NULL; |
| 401 | 401 | } |
| 402 | 402 | } |
| 403 | 403 | } |
| 404 | 404 | |
| 405 | -function bigbluebuttonbn_get_role_name($role_shortname){ |
|
| 405 | +function bigbluebuttonbn_get_role_name($role_shortname) { |
|
| 406 | 406 | $role = bigbluebuttonbn_get_db_moodle_roles($role_shortname); |
| 407 | - if( $role != null && $role->name != "") { |
|
| 407 | + if ($role != null && $role->name != "") { |
|
| 408 | 408 | $role_name = $role->name; |
| 409 | 409 | } else { |
| 410 | 410 | switch ($role_shortname) { |
@@ -424,13 +424,13 @@ discard block |
||
| 424 | 424 | return $role_name; |
| 425 | 425 | } |
| 426 | 426 | |
| 427 | -function bigbluebuttonbn_get_roles($rolename='all', $format='json'){ |
|
| 427 | +function bigbluebuttonbn_get_roles($rolename = 'all', $format = 'json') { |
|
| 428 | 428 | $roles = bigbluebuttonbn_get_db_moodle_roles($rolename); |
| 429 | 429 | $roles_array = array(); |
| 430 | - foreach($roles as $role){ |
|
| 431 | - if( $format=='json' ) { |
|
| 430 | + foreach ($roles as $role) { |
|
| 431 | + if ($format == 'json') { |
|
| 432 | 432 | array_push($roles_array, |
| 433 | - array( "id" => $role->shortname, |
|
| 433 | + array("id" => $role->shortname, |
|
| 434 | 434 | "name" => bigbluebuttonbn_get_role_name($role->shortname) |
| 435 | 435 | ) |
| 436 | 436 | ); |
@@ -441,19 +441,19 @@ discard block |
||
| 441 | 441 | return $roles_array; |
| 442 | 442 | } |
| 443 | 443 | |
| 444 | -function bigbluebuttonbn_get_roles_json($rolename='all'){ |
|
| 444 | +function bigbluebuttonbn_get_roles_json($rolename = 'all') { |
|
| 445 | 445 | return json_encode(bigbluebuttonbn_get_roles($rolename)); |
| 446 | 446 | } |
| 447 | 447 | |
| 448 | -function bigbluebuttonbn_get_users_json($users, $full=false) { |
|
| 449 | - if( $full ) { |
|
| 448 | +function bigbluebuttonbn_get_users_json($users, $full = false) { |
|
| 449 | + if ($full) { |
|
| 450 | 450 | return json_encode($users); |
| 451 | 451 | } else { |
| 452 | 452 | $users_array = array(); |
| 453 | - foreach($users as $user){ |
|
| 453 | + foreach ($users as $user) { |
|
| 454 | 454 | array_push($users_array, |
| 455 | - array( "id" => $user->id, |
|
| 456 | - "name" => $user->firstname.' '.$user->lastname |
|
| 455 | + array("id" => $user->id, |
|
| 456 | + "name" => $user->firstname . ' ' . $user->lastname |
|
| 457 | 457 | ) |
| 458 | 458 | ); |
| 459 | 459 | } |
@@ -461,15 +461,15 @@ discard block |
||
| 461 | 461 | } |
| 462 | 462 | } |
| 463 | 463 | |
| 464 | -function bigbluebuttonbn_get_participant_list($bigbluebuttonbn=null, $context=null){ |
|
| 464 | +function bigbluebuttonbn_get_participant_list($bigbluebuttonbn = null, $context = null) { |
|
| 465 | 465 | global $CFG, $USER; |
| 466 | 466 | |
| 467 | 467 | $participant_list_array = array(); |
| 468 | 468 | |
| 469 | - if( $bigbluebuttonbn != null ) { |
|
| 469 | + if ($bigbluebuttonbn != null) { |
|
| 470 | 470 | $participant_list = json_decode($bigbluebuttonbn->participants); |
| 471 | 471 | if (is_array($participant_list)) { |
| 472 | - foreach($participant_list as $participant){ |
|
| 472 | + foreach ($participant_list as $participant) { |
|
| 473 | 473 | array_push($participant_list_array, |
| 474 | 474 | array( |
| 475 | 475 | "selectiontype" => $participant->selectiontype, |
@@ -489,16 +489,16 @@ discard block |
||
| 489 | 489 | ); |
| 490 | 490 | |
| 491 | 491 | $moderator_defaults = bigbluebuttonbn_get_cfg_moderator_default(); |
| 492 | - if ( !isset($moderator_defaults) ) { |
|
| 492 | + if (!isset($moderator_defaults)) { |
|
| 493 | 493 | $moderator_defaults = array('owner'); |
| 494 | 494 | } else { |
| 495 | 495 | $moderator_defaults = explode(',', $moderator_defaults); |
| 496 | 496 | } |
| 497 | - foreach( $moderator_defaults as $moderator_default ) { |
|
| 498 | - if( $moderator_default == 'owner' ) { |
|
| 497 | + foreach ($moderator_defaults as $moderator_default) { |
|
| 498 | + if ($moderator_default == 'owner') { |
|
| 499 | 499 | $users = bigbluebuttonbn_get_users($context); |
| 500 | - foreach( $users as $user ){ |
|
| 501 | - if( $user->id == $USER->id ){ |
|
| 500 | + foreach ($users as $user) { |
|
| 501 | + if ($user->id == $USER->id) { |
|
| 502 | 502 | array_push($participant_list_array, |
| 503 | 503 | array( |
| 504 | 504 | "selectiontype" => "user", |
@@ -524,7 +524,7 @@ discard block |
||
| 524 | 524 | return $participant_list_array; |
| 525 | 525 | } |
| 526 | 526 | |
| 527 | -function bigbluebuttonbn_get_participant_list_json($bigbluebuttonbnid=null){ |
|
| 527 | +function bigbluebuttonbn_get_participant_list_json($bigbluebuttonbnid = null) { |
|
| 528 | 528 | return json_encode(bigbluebuttonbn_get_participant_list($bigbluebuttonbnid)); |
| 529 | 529 | } |
| 530 | 530 | |
@@ -533,21 +533,21 @@ discard block |
||
| 533 | 533 | |
| 534 | 534 | if (is_array($participant_list)) { |
| 535 | 535 | // Iterate looking for all configuration |
| 536 | - foreach($participant_list as $participant){ |
|
| 537 | - if( $participant->selectiontype == 'all' ) { |
|
| 538 | - if ( $participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR ) |
|
| 536 | + foreach ($participant_list as $participant) { |
|
| 537 | + if ($participant->selectiontype == 'all') { |
|
| 538 | + if ($participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR) |
|
| 539 | 539 | return true; |
| 540 | 540 | } |
| 541 | 541 | } |
| 542 | 542 | |
| 543 | 543 | //Iterate looking for roles |
| 544 | 544 | $db_moodle_roles = bigbluebuttonbn_get_db_moodle_roles(); |
| 545 | - foreach($participant_list as $participant){ |
|
| 546 | - if( $participant->selectiontype == 'role' ) { |
|
| 547 | - foreach( $roles as $role ) { |
|
| 545 | + foreach ($participant_list as $participant) { |
|
| 546 | + if ($participant->selectiontype == 'role') { |
|
| 547 | + foreach ($roles as $role) { |
|
| 548 | 548 | $db_moodle_role = bigbluebuttonbn_moodle_db_role_lookup($db_moodle_roles, $role->roleid); |
| 549 | - if( $participant->selectionid == $db_moodle_role->shortname ) { |
|
| 550 | - if ( $participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR ) |
|
| 549 | + if ($participant->selectionid == $db_moodle_role->shortname) { |
|
| 550 | + if ($participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR) |
|
| 551 | 551 | return true; |
| 552 | 552 | } |
| 553 | 553 | } |
@@ -555,10 +555,10 @@ discard block |
||
| 555 | 555 | } |
| 556 | 556 | |
| 557 | 557 | //Iterate looking for users |
| 558 | - foreach($participant_list as $participant){ |
|
| 559 | - if( $participant->selectiontype == 'user' ) { |
|
| 560 | - if( $participant->selectionid == $user ) { |
|
| 561 | - if ( $participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR ) |
|
| 558 | + foreach ($participant_list as $participant) { |
|
| 559 | + if ($participant->selectiontype == 'user') { |
|
| 560 | + if ($participant->selectionid == $user) { |
|
| 561 | + if ($participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR) |
|
| 562 | 562 | return true; |
| 563 | 563 | } |
| 564 | 564 | } |
@@ -569,8 +569,8 @@ discard block |
||
| 569 | 569 | } |
| 570 | 570 | |
| 571 | 571 | function bigbluebuttonbn_moodle_db_role_lookup($db_moodle_roles, $role_id) { |
| 572 | - foreach( $db_moodle_roles as $db_moodle_role ){ |
|
| 573 | - if( $role_id == $db_moodle_role->id ) { |
|
| 572 | + foreach ($db_moodle_roles as $db_moodle_role) { |
|
| 573 | + if ($role_id == $db_moodle_role->id) { |
|
| 574 | 574 | return $db_moodle_role; |
| 575 | 575 | } |
| 576 | 576 | } |
@@ -578,23 +578,23 @@ discard block |
||
| 578 | 578 | |
| 579 | 579 | function bigbluebuttonbn_get_error_key($messageKey, $defaultKey = null) { |
| 580 | 580 | $key = $defaultKey; |
| 581 | - if ( $messageKey == "checksumError" ){ |
|
| 581 | + if ($messageKey == "checksumError") { |
|
| 582 | 582 | $key = 'index_error_checksum'; |
| 583 | - } else if ( $messageKey == 'maxConcurrent' ) { |
|
| 583 | + } else if ($messageKey == 'maxConcurrent') { |
|
| 584 | 584 | $key = 'view_error_max_concurrent'; |
| 585 | 585 | } |
| 586 | 586 | return $key; |
| 587 | 587 | } |
| 588 | 588 | |
| 589 | -function bigbluebuttonbn_voicebridge_unique($voicebridge, $id=null) { |
|
| 589 | +function bigbluebuttonbn_voicebridge_unique($voicebridge, $id = null) { |
|
| 590 | 590 | global $DB; |
| 591 | 591 | |
| 592 | 592 | $is_unique = true; |
| 593 | - if( $voicebridge != 0 ) { |
|
| 593 | + if ($voicebridge != 0) { |
|
| 594 | 594 | $table = "bigbluebuttonbn"; |
| 595 | - $select = "voicebridge = ".$voicebridge; |
|
| 596 | - if( $id ) $select .= " AND id <> ".$id; |
|
| 597 | - if ( $rooms = $DB->get_records_select($table, $select) ) { |
|
| 595 | + $select = "voicebridge = " . $voicebridge; |
|
| 596 | + if ($id) $select .= " AND id <> " . $id; |
|
| 597 | + if ($rooms = $DB->get_records_select($table, $select)) { |
|
| 598 | 598 | $is_unique = false; |
| 599 | 599 | } |
| 600 | 600 | } |
@@ -607,8 +607,8 @@ discard block |
||
| 607 | 607 | |
| 608 | 608 | $duration = 0; |
| 609 | 609 | $now = time(); |
| 610 | - if( $closingtime > 0 && $now < $closingtime ) { |
|
| 611 | - $duration = ceil(($closingtime - $now)/60); |
|
| 610 | + if ($closingtime > 0 && $now < $closingtime) { |
|
| 611 | + $duration = ceil(($closingtime - $now) / 60); |
|
| 612 | 612 | $compensation_time = intval(bigbluebuttonbn_get_cfg_scheduled_duration_compensation()); |
| 613 | 613 | $duration = intval($duration) + $compensation_time; |
| 614 | 614 | } |
@@ -616,13 +616,13 @@ discard block |
||
| 616 | 616 | return $duration; |
| 617 | 617 | } |
| 618 | 618 | |
| 619 | -function bigbluebuttonbn_get_presentation_array($context, $presentation, $id=null) { |
|
| 619 | +function bigbluebuttonbn_get_presentation_array($context, $presentation, $id = null) { |
|
| 620 | 620 | $presentation_name = null; |
| 621 | 621 | $presentation_url = null; |
| 622 | 622 | $presentation_icon = null; |
| 623 | 623 | $presentation_mimetype_description = null; |
| 624 | 624 | |
| 625 | - if( !empty($presentation) ) { |
|
| 625 | + if (!empty($presentation)) { |
|
| 626 | 626 | $fs = get_file_storage(); |
| 627 | 627 | $files = $fs->get_area_files($context->id, 'mod_bigbluebuttonbn', 'presentation', 0, 'itemid, filepath, filename', false); |
| 628 | 628 | if (count($files) < 1) { |
@@ -636,12 +636,12 @@ discard block |
||
| 636 | 636 | $presentation_icon = file_file_icon($file, 24); |
| 637 | 637 | $presentation_mimetype_description = get_mimetype_description($file); |
| 638 | 638 | |
| 639 | - if( !is_null($id) ) { |
|
| 639 | + if (!is_null($id)) { |
|
| 640 | 640 | //Create the nonce component for granting a temporary public access |
| 641 | 641 | $cache = cache::make_from_params(cache_store::MODE_APPLICATION, 'mod_bigbluebuttonbn', 'presentation_cache'); |
| 642 | 642 | $presentation_nonce_key = sha1($id); |
| 643 | 643 | $presentation_nonce_value = bigbluebuttonbn_generate_nonce(); |
| 644 | - $cache->set($presentation_nonce_key, array( "value" => $presentation_nonce_value, "counter" => 0 )); |
|
| 644 | + $cache->set($presentation_nonce_key, array("value" => $presentation_nonce_value, "counter" => 0)); |
|
| 645 | 645 | |
| 646 | 646 | //The item id was adapted for granting public access to the presentation once in order to allow BigBlueButton to gather the file |
| 647 | 647 | $url = moodle_url::make_pluginfile_url($file->get_contextid(), $file->get_component(), $file->get_filearea(), $presentation_nonce_value, $file->get_filepath(), $file->get_filename()); |
@@ -652,7 +652,7 @@ discard block |
||
| 652 | 652 | } |
| 653 | 653 | } |
| 654 | 654 | |
| 655 | - $presentation_array = array( "url" => $presentation_url, "name" => $presentation_name, "icon" => $presentation_icon, "mimetype_description" => $presentation_mimetype_description); |
|
| 655 | + $presentation_array = array("url" => $presentation_url, "name" => $presentation_name, "icon" => $presentation_icon, "mimetype_description" => $presentation_mimetype_description); |
|
| 656 | 656 | |
| 657 | 657 | return $presentation_array; |
| 658 | 658 | } |
@@ -662,13 +662,13 @@ discard block |
||
| 662 | 662 | $mt = microtime(); |
| 663 | 663 | $rand = mt_rand(); |
| 664 | 664 | |
| 665 | - return md5($mt.$rand); |
|
| 665 | + return md5($mt . $rand); |
|
| 666 | 666 | } |
| 667 | 667 | |
| 668 | -function bigbluebuttonbn_random_password( $length = 8 ) { |
|
| 668 | +function bigbluebuttonbn_random_password($length = 8) { |
|
| 669 | 669 | |
| 670 | 670 | $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_-=+;:,.?"; |
| 671 | - $password = substr( str_shuffle( $chars ), 0, $length ); |
|
| 671 | + $password = substr(str_shuffle($chars), 0, $length); |
|
| 672 | 672 | |
| 673 | 673 | return $password; |
| 674 | 674 | } |
@@ -760,7 +760,7 @@ discard block |
||
| 760 | 760 | global $CFG; |
| 761 | 761 | |
| 762 | 762 | $version_major = bigbluebuttonbn_get_moodle_version_major(); |
| 763 | - if ( $version_major < '2014051200' ) { |
|
| 763 | + if ($version_major < '2014051200') { |
|
| 764 | 764 | //This is valid before v2.7 |
| 765 | 765 | bigbluebuttonbn_event_log_legacy($event_type, $bigbluebuttonbn, $context, $cm); |
| 766 | 766 | |
@@ -770,7 +770,7 @@ discard block |
||
| 770 | 770 | } |
| 771 | 771 | } |
| 772 | 772 | |
| 773 | -function bigbluebuttonbn_bbb_broker_get_recordings($meetingid, $password, $forced=false) { |
|
| 773 | +function bigbluebuttonbn_bbb_broker_get_recordings($meetingid, $password, $forced = false) { |
|
| 774 | 774 | global $CFG; |
| 775 | 775 | |
| 776 | 776 | $recordings = array(); |
@@ -786,19 +786,19 @@ discard block |
||
| 786 | 786 | $result = $cache->get($meetingid); |
| 787 | 787 | $meeting_info = json_decode($result['meeting_info']); |
| 788 | 788 | $meeting_info->participantCount += 1; |
| 789 | - if( $is_moderator ) { |
|
| 789 | + if ($is_moderator) { |
|
| 790 | 790 | $meeting_info->moderatorCount += 1; |
| 791 | 791 | } |
| 792 | - $cache->set($meetingid, array('creation_time' => $result['creation_time'], 'meeting_info' => json_encode($meeting_info) )); |
|
| 792 | + $cache->set($meetingid, array('creation_time' => $result['creation_time'], 'meeting_info' => json_encode($meeting_info))); |
|
| 793 | 793 | } |
| 794 | 794 | |
| 795 | 795 | function bigbluebuttonbn_bbb_broker_is_meeting_running($meeting_info) { |
| 796 | - $meeting_running = ( isset($meeting_info) && isset($meeting_info->returncode) && $meeting_info->returncode == 'SUCCESS' ); |
|
| 796 | + $meeting_running = (isset($meeting_info) && isset($meeting_info->returncode) && $meeting_info->returncode == 'SUCCESS'); |
|
| 797 | 797 | |
| 798 | 798 | return $meeting_running; |
| 799 | 799 | } |
| 800 | 800 | |
| 801 | -function bigbluebuttonbn_bbb_broker_get_meeting_info($meetingid, $password, $forced=false) { |
|
| 801 | +function bigbluebuttonbn_bbb_broker_get_meeting_info($meetingid, $password, $forced = false) { |
|
| 802 | 802 | global $CFG; |
| 803 | 803 | |
| 804 | 804 | $meeting_info = array(); |
@@ -809,19 +809,19 @@ discard block |
||
| 809 | 809 | $cache = cache::make_from_params(cache_store::MODE_APPLICATION, 'mod_bigbluebuttonbn', 'meetings_cache'); |
| 810 | 810 | $result = $cache->get($meetingid); |
| 811 | 811 | $now = time(); |
| 812 | - if( isset($result) && $now < ($result['creation_time'] + $cache_ttl) && !$forced ) { |
|
| 812 | + if (isset($result) && $now < ($result['creation_time'] + $cache_ttl) && !$forced) { |
|
| 813 | 813 | //Use the value in the cache |
| 814 | 814 | $meeting_info = json_decode($result['meeting_info']); |
| 815 | 815 | } else { |
| 816 | 816 | //Ping again and refresh the cache |
| 817 | - $meeting_info = (array) bigbluebuttonbn_getMeetingInfo( $meetingid, $password, $endpoint, $shared_secret ); |
|
| 818 | - $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meeting_info) )); |
|
| 817 | + $meeting_info = (array)bigbluebuttonbn_getMeetingInfo($meetingid, $password, $endpoint, $shared_secret); |
|
| 818 | + $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meeting_info))); |
|
| 819 | 819 | } |
| 820 | 820 | |
| 821 | 821 | return $meeting_info; |
| 822 | 822 | } |
| 823 | 823 | |
| 824 | -function bigbluebuttonbn_bbb_broker_do_end_meeting($meetingid, $password){ |
|
| 824 | +function bigbluebuttonbn_bbb_broker_do_end_meeting($meetingid, $password) { |
|
| 825 | 825 | global $CFG; |
| 826 | 826 | |
| 827 | 827 | $endpoint = bigbluebuttonbn_get_cfg_server_url(); |
@@ -830,16 +830,16 @@ discard block |
||
| 830 | 830 | bigbluebuttonbn_doEndMeeting($meetingid, $password, $endpoint, $shared_secret); |
| 831 | 831 | } |
| 832 | 832 | |
| 833 | -function bigbluebuttonbn_bbb_broker_do_publish_recording($recordingid, $publish=true){ |
|
| 833 | +function bigbluebuttonbn_bbb_broker_do_publish_recording($recordingid, $publish = true) { |
|
| 834 | 834 | global $CFG; |
| 835 | 835 | |
| 836 | 836 | $endpoint = bigbluebuttonbn_get_cfg_server_url(); |
| 837 | 837 | $shared_secret = bigbluebuttonbn_get_cfg_shared_secret(); |
| 838 | 838 | |
| 839 | - bigbluebuttonbn_doPublishRecordings($recordingid, ($publish)? 'true': 'false', $endpoint, $shared_secret); |
|
| 839 | + bigbluebuttonbn_doPublishRecordings($recordingid, ($publish) ? 'true' : 'false', $endpoint, $shared_secret); |
|
| 840 | 840 | } |
| 841 | 841 | |
| 842 | -function bigbluebuttonbn_bbb_broker_do_publish_recording_imported($recordingid, $courseID, $bigbluebuttonbnID, $publish=true){ |
|
| 842 | +function bigbluebuttonbn_bbb_broker_do_publish_recording_imported($recordingid, $courseID, $bigbluebuttonbnID, $publish = true) { |
|
| 843 | 843 | global $DB; |
| 844 | 844 | |
| 845 | 845 | //Locate the record to be updated |
@@ -848,9 +848,9 @@ discard block |
||
| 848 | 848 | $recordings_imported = array(); |
| 849 | 849 | foreach ($records as $key => $record) { |
| 850 | 850 | $meta = json_decode($record->meta, true); |
| 851 | - if( $recordingid == $meta['recording']['recordID'] ) { |
|
| 851 | + if ($recordingid == $meta['recording']['recordID']) { |
|
| 852 | 852 | // Found, prepare data for the update |
| 853 | - $meta['recording']['published'] = ($publish)? 'true': 'false'; |
|
| 853 | + $meta['recording']['published'] = ($publish) ? 'true' : 'false'; |
|
| 854 | 854 | $records[$key]->meta = json_encode($meta); |
| 855 | 855 | |
| 856 | 856 | // Proceed with the update |
@@ -859,7 +859,7 @@ discard block |
||
| 859 | 859 | } |
| 860 | 860 | } |
| 861 | 861 | |
| 862 | -function bigbluebuttonbn_bbb_broker_do_delete_recording($recordingid){ |
|
| 862 | +function bigbluebuttonbn_bbb_broker_do_delete_recording($recordingid) { |
|
| 863 | 863 | global $CFG; |
| 864 | 864 | |
| 865 | 865 | $endpoint = bigbluebuttonbn_get_cfg_server_url(); |
@@ -868,7 +868,7 @@ discard block |
||
| 868 | 868 | bigbluebuttonbn_doDeleteRecordings($recordingid, $endpoint, $shared_secret); |
| 869 | 869 | } |
| 870 | 870 | |
| 871 | -function bigbluebuttonbn_bbb_broker_do_delete_recording_imported($recordingid, $courseID, $bigbluebuttonbnID){ |
|
| 871 | +function bigbluebuttonbn_bbb_broker_do_delete_recording_imported($recordingid, $courseID, $bigbluebuttonbnID) { |
|
| 872 | 872 | global $DB; |
| 873 | 873 | |
| 874 | 874 | //Locate the record to be updated |
@@ -877,7 +877,7 @@ discard block |
||
| 877 | 877 | $recordings_imported = array(); |
| 878 | 878 | foreach ($records as $key => $record) { |
| 879 | 879 | $meta = json_decode($record->meta, true); |
| 880 | - if( $recordingid == $meta['recording']['recordID'] ) { |
|
| 880 | + if ($recordingid == $meta['recording']['recordID']) { |
|
| 881 | 881 | // Execute delete |
| 882 | 882 | $DB->delete_records("bigbluebuttonbn_logs", array('id' => $key)); |
| 883 | 883 | } |
@@ -887,18 +887,18 @@ discard block |
||
| 887 | 887 | function bigbluebuttonbn_bbb_broker_validate_parameters($params) { |
| 888 | 888 | $error = ''; |
| 889 | 889 | |
| 890 | - if ( !isset($params['callback']) ) { |
|
| 890 | + if (!isset($params['callback'])) { |
|
| 891 | 891 | $error = $bigbluebuttonbn_bbb_broker_add_error($error, 'This call must include a javascript callback.'); |
| 892 | 892 | } |
| 893 | 893 | |
| 894 | - if ( !isset($params['action']) ) { |
|
| 894 | + if (!isset($params['action'])) { |
|
| 895 | 895 | $error = $bigbluebuttonbn_bbb_broker_add_error($error, 'Action parameter must be included.'); |
| 896 | 896 | } else { |
| 897 | - switch ( strtolower($params['action']) ){ |
|
| 897 | + switch (strtolower($params['action'])) { |
|
| 898 | 898 | case 'server_ping': |
| 899 | 899 | case 'meeting_info': |
| 900 | 900 | case 'meeting_end': |
| 901 | - if ( !isset($params['id']) ) { |
|
| 901 | + if (!isset($params['id'])) { |
|
| 902 | 902 | $error = $bigbluebuttonbn_bbb_broker_add_error($error, 'The meetingID must be specified.'); |
| 903 | 903 | } |
| 904 | 904 | break; |
@@ -908,79 +908,79 @@ discard block |
||
| 908 | 908 | case 'recording_unpublish': |
| 909 | 909 | case 'recording_delete': |
| 910 | 910 | case 'recording_import': |
| 911 | - if ( !isset($params['id']) ) { |
|
| 911 | + if (!isset($params['id'])) { |
|
| 912 | 912 | $error = bigbluebuttonbn_bbb_broker_add_error($error, 'The recordingID must be specified.'); |
| 913 | 913 | } |
| 914 | 914 | break; |
| 915 | 915 | case 'recording_ready': |
| 916 | - if( empty($params['signed_parameters']) ) { |
|
| 916 | + if (empty($params['signed_parameters'])) { |
|
| 917 | 917 | $error = bigbluebuttonbn_bbb_broker_add_error($error, 'A JWT encoded string must be included as [signed_parameters].'); |
| 918 | 918 | } |
| 919 | 919 | break; |
| 920 | 920 | default: |
| 921 | - $error = bigbluebuttonbn_bbb_broker_add_error($error, 'Action '.$params['action'].' can not be performed.'); |
|
| 921 | + $error = bigbluebuttonbn_bbb_broker_add_error($error, 'Action ' . $params['action'] . ' can not be performed.'); |
|
| 922 | 922 | } |
| 923 | 923 | } |
| 924 | 924 | |
| 925 | 925 | return $error; |
| 926 | 926 | } |
| 927 | 927 | |
| 928 | -function bigbluebuttonbn_bbb_broker_add_error($org_msg, $new_msg='') { |
|
| 928 | +function bigbluebuttonbn_bbb_broker_add_error($org_msg, $new_msg = '') { |
|
| 929 | 929 | $error = $org_msg; |
| 930 | 930 | |
| 931 | - if( !empty($new_msg) ) { |
|
| 932 | - if( !empty($error) ) $error .= ' '; |
|
| 931 | + if (!empty($new_msg)) { |
|
| 932 | + if (!empty($error)) $error .= ' '; |
|
| 933 | 933 | $error .= $new_msg; |
| 934 | 934 | } |
| 935 | 935 | |
| 936 | 936 | return $error; |
| 937 | 937 | } |
| 938 | 938 | |
| 939 | -function bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools=["publishing", "deleting"]) { |
|
| 939 | +function bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools = ["publishing", "deleting"]) { |
|
| 940 | 940 | global $OUTPUT, $CFG, $USER; |
| 941 | 941 | |
| 942 | 942 | $row = null; |
| 943 | 943 | |
| 944 | - if ( $bbbsession['managerecordings'] || $recording['published'] == 'true' ) { |
|
| 944 | + if ($bbbsession['managerecordings'] || $recording['published'] == 'true') { |
|
| 945 | 945 | $length = 0; |
| 946 | - $startTime = isset($recording['startTime'])? floatval($recording['startTime']):0; |
|
| 946 | + $startTime = isset($recording['startTime']) ? floatval($recording['startTime']) : 0; |
|
| 947 | 947 | $startTime = $startTime - ($startTime % 1000); |
| 948 | - $endTime = isset($recording['endTime'])? floatval($recording['endTime']):0; |
|
| 948 | + $endTime = isset($recording['endTime']) ? floatval($recording['endTime']) : 0; |
|
| 949 | 949 | $endTime = $endTime - ($endTime % 1000); |
| 950 | 950 | $duration = intval(array_values($recording['playbacks'])[0]['length']); |
| 951 | 951 | |
| 952 | 952 | //For backward compatibility |
| 953 | - if( isset($recording['meta_contextactivity']) ) { |
|
| 953 | + if (isset($recording['meta_contextactivity'])) { |
|
| 954 | 954 | $meta_activity = str_replace('"', '\"', $recording['meta_contextactivity']); |
| 955 | - } if( isset($recording['meta_bbb-recording-name']) ) { |
|
| 955 | + } if (isset($recording['meta_bbb-recording-name'])) { |
|
| 956 | 956 | $meta_activity = str_replace('"', '\"', $recording['meta_bbb-recording-name']); |
| 957 | 957 | } else { |
| 958 | 958 | $meta_activity = str_replace('"', '\"', $recording['meetingName']); |
| 959 | 959 | } |
| 960 | 960 | |
| 961 | - if( isset($recording['meta_contextactivitydescription']) ) { |
|
| 961 | + if (isset($recording['meta_contextactivitydescription'])) { |
|
| 962 | 962 | $meta_description = str_replace('"', '\"', $recording['meta_contextactivitydescription']); |
| 963 | - } else if( isset($recording['meta_bbb-recording-description']) ) { |
|
| 963 | + } else if (isset($recording['meta_bbb-recording-description'])) { |
|
| 964 | 964 | $meta_description = str_replace('"', '\"', $recording['meta_bbb-recording-description']); |
| 965 | 965 | } else { |
| 966 | 966 | $meta_description = ''; |
| 967 | 967 | } |
| 968 | 968 | |
| 969 | 969 | //Set recording_types |
| 970 | - if ( isset($recording['imported']) ) { |
|
| 971 | - $attributes = 'data-imported="true" title='.get_string('view_recording_link_warning', 'bigbluebuttonbn'); |
|
| 970 | + if (isset($recording['imported'])) { |
|
| 971 | + $attributes = 'data-imported="true" title=' . get_string('view_recording_link_warning', 'bigbluebuttonbn'); |
|
| 972 | 972 | } else { |
| 973 | 973 | $attributes = 'data-imported="false"'; |
| 974 | 974 | } |
| 975 | 975 | |
| 976 | 976 | $recording_types = ''; |
| 977 | 977 | if ($recording['published'] == 'true') { |
| 978 | - $recording_types .= '<div id="playbacks-'.$recording['recordID'].'" '.$attributes.'>'; |
|
| 978 | + $recording_types .= '<div id="playbacks-' . $recording['recordID'] . '" ' . $attributes . '>'; |
|
| 979 | 979 | } else { |
| 980 | - $recording_types .= '<div id="playbacks-'.$recording['recordID'].'" '.$attributes.'" hidden>'; |
|
| 980 | + $recording_types .= '<div id="playbacks-' . $recording['recordID'] . '" ' . $attributes . '" hidden>'; |
|
| 981 | 981 | } |
| 982 | - foreach ( $recording['playbacks'] as $playback ) { |
|
| 983 | - $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') ).' '; |
|
| 982 | + foreach ($recording['playbacks'] as $playback) { |
|
| 983 | + $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')) . ' '; |
|
| 984 | 984 | } |
| 985 | 985 | $recording_types .= '</div>'; |
| 986 | 986 | |
@@ -989,11 +989,11 @@ discard block |
||
| 989 | 989 | |
| 990 | 990 | //Set actionbar, if user is allowed to manage recordings |
| 991 | 991 | $actionbar = ''; |
| 992 | - if ( $bbbsession['managerecordings'] ) { |
|
| 992 | + if ($bbbsession['managerecordings']) { |
|
| 993 | 993 | // Set style for imported links |
| 994 | - if( isset($recording['imported']) ) { |
|
| 994 | + if (isset($recording['imported'])) { |
|
| 995 | 995 | $recordings_imported_count = 0; |
| 996 | - $tag_tail = ' '.get_string('view_recording_link', 'bigbluebuttonbn'); |
|
| 996 | + $tag_tail = ' ' . get_string('view_recording_link', 'bigbluebuttonbn'); |
|
| 997 | 997 | $head = '<i>'; |
| 998 | 998 | $tail = '</i>'; |
| 999 | 999 | } else { |
@@ -1007,53 +1007,53 @@ discard block |
||
| 1007 | 1007 | |
| 1008 | 1008 | if (in_array("publishing", $tools)) { |
| 1009 | 1009 | ///Set action [show|hide] |
| 1010 | - if ( $recording['published'] == 'true' ){ |
|
| 1010 | + if ($recording['published'] == 'true') { |
|
| 1011 | 1011 | $manage_tag = 'hide'; |
| 1012 | 1012 | $manage_action = 'unpublish'; |
| 1013 | 1013 | } else { |
| 1014 | 1014 | $manage_tag = 'show'; |
| 1015 | 1015 | $manage_action = 'publish'; |
| 1016 | 1016 | } |
| 1017 | - $onclick = 'M.mod_bigbluebuttonbn.broker_manageRecording("'.$manage_action.'", "'.$recording['recordID'].'", "'.$recording['meetingID'].'");'; |
|
| 1017 | + $onclick = 'M.mod_bigbluebuttonbn.broker_manageRecording("' . $manage_action . '", "' . $recording['recordID'] . '", "' . $recording['meetingID'] . '");'; |
|
| 1018 | 1018 | |
| 1019 | - if ( bigbluebuttonbn_get_cfg_recording_icons_enabled() ) { |
|
| 1019 | + if (bigbluebuttonbn_get_cfg_recording_icons_enabled()) { |
|
| 1020 | 1020 | //With icon for publish/unpublish |
| 1021 | - $icon_attributes = array('id' => 'recording-btn-'.$manage_action.'-'.$recording['recordID']); |
|
| 1022 | - $icon = new pix_icon('t/'.$manage_tag, get_string($manage_tag).$tag_tail, 'moodle', $icon_attributes); |
|
| 1023 | - $link_attributes = array('id' => 'recording-link-'.$manage_action.'-'.$recording['recordID'], 'onclick' => $onclick, 'data-links' => $recordings_imported_count); |
|
| 1021 | + $icon_attributes = array('id' => 'recording-btn-' . $manage_action . '-' . $recording['recordID']); |
|
| 1022 | + $icon = new pix_icon('t/' . $manage_tag, get_string($manage_tag) . $tag_tail, 'moodle', $icon_attributes); |
|
| 1023 | + $link_attributes = array('id' => 'recording-link-' . $manage_action . '-' . $recording['recordID'], 'onclick' => $onclick, 'data-links' => $recordings_imported_count); |
|
| 1024 | 1024 | $actionbar .= $OUTPUT->action_icon($url, $icon, $action, $link_attributes, false); |
| 1025 | 1025 | } else { |
| 1026 | 1026 | //With text for publish/unpublish |
| 1027 | - $link_attributes = array('title' => get_string($manage_tag).$tag_tail, 'class' => 'btn btn-xs', 'onclick' => $onclick, 'data-links' => $recordings_imported_count); |
|
| 1028 | - $actionbar .= $OUTPUT->action_link($url, get_string($manage_tag).$tag_tail, $action, $link_attributes); |
|
| 1027 | + $link_attributes = array('title' => get_string($manage_tag) . $tag_tail, 'class' => 'btn btn-xs', 'onclick' => $onclick, 'data-links' => $recordings_imported_count); |
|
| 1028 | + $actionbar .= $OUTPUT->action_link($url, get_string($manage_tag) . $tag_tail, $action, $link_attributes); |
|
| 1029 | 1029 | $actionbar .= " "; |
| 1030 | 1030 | } |
| 1031 | 1031 | } |
| 1032 | 1032 | |
| 1033 | 1033 | if (in_array("deleting", $tools)) { |
| 1034 | - $onclick = 'M.mod_bigbluebuttonbn.broker_manageRecording("delete", "'.$recording['recordID'].'", "'.$recording['meetingID'].'");'; |
|
| 1034 | + $onclick = 'M.mod_bigbluebuttonbn.broker_manageRecording("delete", "' . $recording['recordID'] . '", "' . $recording['meetingID'] . '");'; |
|
| 1035 | 1035 | |
| 1036 | - if ( bigbluebuttonbn_get_cfg_recording_icons_enabled() ) { |
|
| 1036 | + if (bigbluebuttonbn_get_cfg_recording_icons_enabled()) { |
|
| 1037 | 1037 | //With icon for delete |
| 1038 | - $icon_attributes = array('id' => 'recording-btn-delete-'.$recording['recordID']); |
|
| 1039 | - $icon = new pix_icon('t/delete', get_string('delete').$tag_tail, 'moodle', $icon_attributes); |
|
| 1040 | - $link_attributes = array('id' => 'recording-link-delete-'.$recording['recordID'], 'onclick' => $onclick, 'data-links' => $recordings_imported_count); |
|
| 1038 | + $icon_attributes = array('id' => 'recording-btn-delete-' . $recording['recordID']); |
|
| 1039 | + $icon = new pix_icon('t/delete', get_string('delete') . $tag_tail, 'moodle', $icon_attributes); |
|
| 1040 | + $link_attributes = array('id' => 'recording-link-delete-' . $recording['recordID'], 'onclick' => $onclick, 'data-links' => $recordings_imported_count); |
|
| 1041 | 1041 | $actionbar .= $OUTPUT->action_icon($url, $icon, $action, $link_attributes, false); |
| 1042 | 1042 | } else { |
| 1043 | 1043 | //With text for delete |
| 1044 | - $link_attributes = array('title' => get_string('delete').$tag_tail, 'class' => 'btn btn-xs btn-danger', 'onclick' => $onclick, 'data-links' => $recordings_imported_count); |
|
| 1045 | - $actionbar .= $OUTPUT->action_link($url, get_string('delete').$tag_tail, $action, $link_attributes); |
|
| 1044 | + $link_attributes = array('title' => get_string('delete') . $tag_tail, 'class' => 'btn btn-xs btn-danger', 'onclick' => $onclick, 'data-links' => $recordings_imported_count); |
|
| 1045 | + $actionbar .= $OUTPUT->action_link($url, get_string('delete') . $tag_tail, $action, $link_attributes); |
|
| 1046 | 1046 | } |
| 1047 | 1047 | } |
| 1048 | 1048 | |
| 1049 | 1049 | if (in_array("importing", $tools)) { |
| 1050 | - $onclick = 'M.mod_bigbluebuttonbn.broker_manageRecording("import", "'.$recording['recordID'].'", "'.$recording['meetingID'].'");'; |
|
| 1050 | + $onclick = 'M.mod_bigbluebuttonbn.broker_manageRecording("import", "' . $recording['recordID'] . '", "' . $recording['meetingID'] . '");'; |
|
| 1051 | 1051 | |
| 1052 | - if ( bigbluebuttonbn_get_cfg_recording_icons_enabled() ) { |
|
| 1052 | + if (bigbluebuttonbn_get_cfg_recording_icons_enabled()) { |
|
| 1053 | 1053 | //With icon for import |
| 1054 | - $icon_attributes = array('id' => 'recording-btn-import-'.$recording['recordID']); |
|
| 1054 | + $icon_attributes = array('id' => 'recording-btn-import-' . $recording['recordID']); |
|
| 1055 | 1055 | $icon = new pix_icon('i/import', get_string('import'), 'moodle', $icon_attributes); |
| 1056 | - $link_attributes = array('id' => 'recording-link-import-'.$recording['recordID'], 'onclick' => $onclick); |
|
| 1056 | + $link_attributes = array('id' => 'recording-link-import-' . $recording['recordID'], 'onclick' => $onclick); |
|
| 1057 | 1057 | $actionbar .= $OUTPUT->action_icon($url, $icon, $action, $link_attributes, false); |
| 1058 | 1058 | } else { |
| 1059 | 1059 | //With text for import |
@@ -1075,7 +1075,7 @@ discard block |
||
| 1075 | 1075 | $row->date_formatted = "{$head}{$formattedStartDate}{$tail}"; |
| 1076 | 1076 | $row->duration = "{$duration}"; |
| 1077 | 1077 | $row->duration_formatted = "{$head}{$duration}{$tail}"; |
| 1078 | - if ( $bbbsession['managerecordings'] ) { |
|
| 1078 | + if ($bbbsession['managerecordings']) { |
|
| 1079 | 1079 | $row->actionbar = $actionbar; |
| 1080 | 1080 | } |
| 1081 | 1081 | } |
@@ -1101,21 +1101,21 @@ discard block |
||
| 1101 | 1101 | array("key" =>"duration", "label" => $view_recording_duration, "width" => "50px") |
| 1102 | 1102 | ); |
| 1103 | 1103 | |
| 1104 | - if ( $bbbsession['managerecordings'] ) { |
|
| 1104 | + if ($bbbsession['managerecordings']) { |
|
| 1105 | 1105 | array_push($recordingsbn_columns, array("key" =>"actionbar", "label" => $view_recording_actionbar, "width" => "75px", "allowHTML" => true)); |
| 1106 | 1106 | } |
| 1107 | 1107 | |
| 1108 | 1108 | return $recordingsbn_columns; |
| 1109 | 1109 | } |
| 1110 | 1110 | |
| 1111 | -function bigbluebuttonbn_get_recording_data($bbbsession, $recordings, $tools=["publishing", "deleting"]) { |
|
| 1111 | +function bigbluebuttonbn_get_recording_data($bbbsession, $recordings, $tools = ["publishing", "deleting"]) { |
|
| 1112 | 1112 | $table_data = array(); |
| 1113 | 1113 | |
| 1114 | 1114 | ///Build table content |
| 1115 | - if ( isset($recordings) && !array_key_exists('messageKey', $recordings)) { // There are recordings for this meeting |
|
| 1116 | - foreach ( $recordings as $recording ) { |
|
| 1115 | + if (isset($recordings) && !array_key_exists('messageKey', $recordings)) { // There are recordings for this meeting |
|
| 1116 | + foreach ($recordings as $recording) { |
|
| 1117 | 1117 | $row = bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools); |
| 1118 | - if( $row != null ) { |
|
| 1118 | + if ($row != null) { |
|
| 1119 | 1119 | array_push($table_data, $row); |
| 1120 | 1120 | } |
| 1121 | 1121 | } |
@@ -1124,7 +1124,7 @@ discard block |
||
| 1124 | 1124 | return $table_data; |
| 1125 | 1125 | } |
| 1126 | 1126 | |
| 1127 | -function bigbluebuttonbn_get_recording_table($bbbsession, $recordings, $tools=['publishing','deleting']) { |
|
| 1127 | +function bigbluebuttonbn_get_recording_table($bbbsession, $recordings, $tools = ['publishing', 'deleting']) { |
|
| 1128 | 1128 | global $OUTPUT, $CFG; |
| 1129 | 1129 | |
| 1130 | 1130 | ///Set strings to show |
@@ -1143,20 +1143,20 @@ discard block |
||
| 1143 | 1143 | $table->data = array(); |
| 1144 | 1144 | |
| 1145 | 1145 | ///Initialize table headers |
| 1146 | - if ( $bbbsession['managerecordings'] ) { |
|
| 1147 | - $table->head = array ($view_recording_recording, $view_recording_activity, $view_recording_description, $view_recording_date, $view_recording_duration, $view_recording_actionbar); |
|
| 1148 | - $table->align = array ('left', 'left', 'left', 'left', 'center', 'left'); |
|
| 1146 | + if ($bbbsession['managerecordings']) { |
|
| 1147 | + $table->head = array($view_recording_recording, $view_recording_activity, $view_recording_description, $view_recording_date, $view_recording_duration, $view_recording_actionbar); |
|
| 1148 | + $table->align = array('left', 'left', 'left', 'left', 'center', 'left'); |
|
| 1149 | 1149 | } else { |
| 1150 | - $table->head = array ($view_recording_recording, $view_recording_activity, $view_recording_description, $view_recording_date, $view_recording_duration); |
|
| 1151 | - $table->align = array ('left', 'left', 'left', 'left', 'center'); |
|
| 1150 | + $table->head = array($view_recording_recording, $view_recording_activity, $view_recording_description, $view_recording_date, $view_recording_duration); |
|
| 1151 | + $table->align = array('left', 'left', 'left', 'left', 'center'); |
|
| 1152 | 1152 | } |
| 1153 | 1153 | |
| 1154 | 1154 | ///Build table content |
| 1155 | - if ( isset($recordings) && !array_key_exists('messageKey', $recordings)) { // There are recordings for this meeting |
|
| 1156 | - foreach ( $recordings as $recording ){ |
|
| 1155 | + if (isset($recordings) && !array_key_exists('messageKey', $recordings)) { // There are recordings for this meeting |
|
| 1156 | + foreach ($recordings as $recording) { |
|
| 1157 | 1157 | $row = new html_table_row(); |
| 1158 | - $row->id = 'recording-td-'.$recording['recordID']; |
|
| 1159 | - if ( isset($recording['imported']) ) { |
|
| 1158 | + $row->id = 'recording-td-' . $recording['recordID']; |
|
| 1159 | + if (isset($recording['imported'])) { |
|
| 1160 | 1160 | $row->attributes['data-imported'] = 'true'; |
| 1161 | 1161 | $row->attributes['title'] = get_string('view_recording_link_warning', 'bigbluebuttonbn'); |
| 1162 | 1162 | } else { |
@@ -1164,12 +1164,12 @@ discard block |
||
| 1164 | 1164 | } |
| 1165 | 1165 | |
| 1166 | 1166 | $row_data = bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools); |
| 1167 | - if( $row_data != null ) { |
|
| 1167 | + if ($row_data != null) { |
|
| 1168 | 1168 | $row_data->date_formatted = str_replace(" ", " ", $row_data->date_formatted); |
| 1169 | - if ( $bbbsession['managerecordings'] ) { |
|
| 1170 | - $row->cells = array ($row_data->recording, $row_data->activity, $row_data->description, $row_data->date_formatted, $row_data->duration_formatted, $row_data->actionbar ); |
|
| 1169 | + if ($bbbsession['managerecordings']) { |
|
| 1170 | + $row->cells = array($row_data->recording, $row_data->activity, $row_data->description, $row_data->date_formatted, $row_data->duration_formatted, $row_data->actionbar); |
|
| 1171 | 1171 | } else { |
| 1172 | - $row->cells = array ($row_data->recording, $row_data->activity, $row_data->description, $row_data->date_formatted, $row_data->duration_formatted ); |
|
| 1172 | + $row->cells = array($row_data->recording, $row_data->activity, $row_data->description, $row_data->date_formatted, $row_data->duration_formatted); |
|
| 1173 | 1173 | } |
| 1174 | 1174 | |
| 1175 | 1175 | array_push($table->data, $row); |
@@ -1189,12 +1189,12 @@ discard block |
||
| 1189 | 1189 | /// Build the message_body |
| 1190 | 1190 | $msg->activity_type = ""; |
| 1191 | 1191 | $msg->activity_title = $bigbluebuttonbn->name; |
| 1192 | - $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>'; |
|
| 1192 | + $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>'; |
|
| 1193 | 1193 | |
| 1194 | 1194 | bigbluebuttonbn_send_notification($sender, $bigbluebuttonbn, $message_text); |
| 1195 | 1195 | } |
| 1196 | 1196 | |
| 1197 | -function bigbluebuttonbn_server_offers($capability_name){ |
|
| 1197 | +function bigbluebuttonbn_server_offers($capability_name) { |
|
| 1198 | 1198 | global $CFG; |
| 1199 | 1199 | |
| 1200 | 1200 | $capability_offered = null; |
@@ -1208,12 +1208,12 @@ discard block |
||
| 1208 | 1208 | $host_ends = explode(".", $host); |
| 1209 | 1209 | $host_ends_length = count($host_ends); |
| 1210 | 1210 | |
| 1211 | - if( $host_ends_length > 0 && $host_ends[$host_ends_length -1] == 'com' && $host_ends[$host_ends_length -2] == 'blindsidenetworks' ) { |
|
| 1211 | + if ($host_ends_length > 0 && $host_ends[$host_ends_length - 1] == 'com' && $host_ends[$host_ends_length - 2] == 'blindsidenetworks') { |
|
| 1212 | 1212 | //Validate the capabilities offered |
| 1213 | - $capabilities = bigbluebuttonbn_getCapabilitiesArray( $endpoint, $shared_secret ); |
|
| 1214 | - if( $capabilities ) { |
|
| 1213 | + $capabilities = bigbluebuttonbn_getCapabilitiesArray($endpoint, $shared_secret); |
|
| 1214 | + if ($capabilities) { |
|
| 1215 | 1215 | foreach ($capabilities as $capability) { |
| 1216 | - if( $capability["name"] == $capability_name) |
|
| 1216 | + if ($capability["name"] == $capability_name) |
|
| 1217 | 1217 | $capability_offered = $capability; |
| 1218 | 1218 | } |
| 1219 | 1219 | } |
@@ -1222,14 +1222,14 @@ discard block |
||
| 1222 | 1222 | return $capability_offered; |
| 1223 | 1223 | } |
| 1224 | 1224 | |
| 1225 | -function bigbluebuttonbn_server_offers_bn_capabilities(){ |
|
| 1225 | +function bigbluebuttonbn_server_offers_bn_capabilities() { |
|
| 1226 | 1226 | //Validates if the server may have extended capabilities |
| 1227 | 1227 | $parsed_url = parse_url(bigbluebuttonbn_get_cfg_server_url()); |
| 1228 | 1228 | $host = isset($parsed_url['host']) ? $parsed_url['host'] : ''; |
| 1229 | 1229 | $host_ends = explode(".", $host); |
| 1230 | 1230 | $host_ends_length = count($host_ends); |
| 1231 | 1231 | |
| 1232 | - return ( $host_ends_length > 0 && $host_ends[$host_ends_length -1] == 'com' && $host_ends[$host_ends_length -2] == 'blindsidenetworks' ); |
|
| 1232 | + return ($host_ends_length > 0 && $host_ends[$host_ends_length - 1] == 'com' && $host_ends[$host_ends_length - 2] == 'blindsidenetworks'); |
|
| 1233 | 1233 | } |
| 1234 | 1234 | |
| 1235 | 1235 | function bigbluebuttonbn_get_locales_for_ui() { |
@@ -1272,89 +1272,89 @@ discard block |
||
| 1272 | 1272 | |
| 1273 | 1273 | function bigbluebuttonbn_get_cfg_server_url_default() { |
| 1274 | 1274 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1275 | - 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/'))); |
|
| 1275 | + 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/'))); |
|
| 1276 | 1276 | } |
| 1277 | 1277 | |
| 1278 | 1278 | function bigbluebuttonbn_get_cfg_shared_secret_default() { |
| 1279 | 1279 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1280 | - 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'))); |
|
| 1280 | + 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'))); |
|
| 1281 | 1281 | } |
| 1282 | 1282 | |
| 1283 | 1283 | function bigbluebuttonbn_get_cfg_voicebridge_editable() { |
| 1284 | 1284 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1285 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_voicebridge_editable)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_voicebridge_editable: (isset($CFG->bigbluebuttonbn_voicebridge_editable)? $CFG->bigbluebuttonbn_voicebridge_editable: false)); |
|
| 1285 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_voicebridge_editable) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_voicebridge_editable : (isset($CFG->bigbluebuttonbn_voicebridge_editable) ? $CFG->bigbluebuttonbn_voicebridge_editable : false)); |
|
| 1286 | 1286 | } |
| 1287 | 1287 | |
| 1288 | 1288 | function bigbluebuttonbn_get_cfg_recording_default() { |
| 1289 | 1289 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1290 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_default)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_default: (isset($CFG->bigbluebuttonbn_recording_default)? $CFG->bigbluebuttonbn_recording_default: true)); |
|
| 1290 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_default) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_default : (isset($CFG->bigbluebuttonbn_recording_default) ? $CFG->bigbluebuttonbn_recording_default : true)); |
|
| 1291 | 1291 | } |
| 1292 | 1292 | |
| 1293 | 1293 | function bigbluebuttonbn_get_cfg_recording_editable() { |
| 1294 | 1294 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1295 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_editable)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_editable: (isset($CFG->bigbluebuttonbn_recording_editable)? $CFG->bigbluebuttonbn_recording_editable: true)); |
|
| 1295 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_editable) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_editable : (isset($CFG->bigbluebuttonbn_recording_editable) ? $CFG->bigbluebuttonbn_recording_editable : true)); |
|
| 1296 | 1296 | } |
| 1297 | 1297 | |
| 1298 | 1298 | function bigbluebuttonbn_get_cfg_recording_tagging_default() { |
| 1299 | 1299 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1300 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_default)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_default: (isset($CFG->bigbluebuttonbn_recordingtagging_default)? $CFG->bigbluebuttonbn_recordingtagging_default: false)); |
|
| 1300 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_default) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_default : (isset($CFG->bigbluebuttonbn_recordingtagging_default) ? $CFG->bigbluebuttonbn_recordingtagging_default : false)); |
|
| 1301 | 1301 | } |
| 1302 | 1302 | |
| 1303 | 1303 | function bigbluebuttonbn_get_cfg_recording_tagging_editable() { |
| 1304 | 1304 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1305 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_editable)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_editable: (isset($CFG->bigbluebuttonbn_recordingtagging_editable)? $CFG->bigbluebuttonbn_recordingtagging_editable: false)); |
|
| 1305 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_editable) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_editable : (isset($CFG->bigbluebuttonbn_recordingtagging_editable) ? $CFG->bigbluebuttonbn_recordingtagging_editable : false)); |
|
| 1306 | 1306 | } |
| 1307 | 1307 | |
| 1308 | 1308 | function bigbluebuttonbn_get_cfg_recording_icons_enabled() { |
| 1309 | 1309 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1310 | - 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)); |
|
| 1310 | + 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)); |
|
| 1311 | 1311 | } |
| 1312 | 1312 | |
| 1313 | 1313 | function bigbluebuttonbn_get_cfg_importrecordings_enabled() { |
| 1314 | 1314 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1315 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_enabled)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_enabled: (isset($CFG->bigbluebuttonbn_importrecordings_enabled)? $CFG->bigbluebuttonbn_importrecordings_enabled: false)); |
|
| 1315 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_enabled) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_enabled : (isset($CFG->bigbluebuttonbn_importrecordings_enabled) ? $CFG->bigbluebuttonbn_importrecordings_enabled : false)); |
|
| 1316 | 1316 | } |
| 1317 | 1317 | |
| 1318 | 1318 | function bigbluebuttonbn_get_cfg_importrecordings_from_deleted_activities_enabled() { |
| 1319 | 1319 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1320 | - 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)); |
|
| 1320 | + 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)); |
|
| 1321 | 1321 | } |
| 1322 | 1322 | |
| 1323 | 1323 | function bigbluebuttonbn_get_cfg_waitformoderator_default() { |
| 1324 | 1324 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1325 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_default)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_default: (isset($CFG->bigbluebuttonbn_waitformoderator_default)? $CFG->bigbluebuttonbn_waitformoderator_default: false)); |
|
| 1325 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_default) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_default : (isset($CFG->bigbluebuttonbn_waitformoderator_default) ? $CFG->bigbluebuttonbn_waitformoderator_default : false)); |
|
| 1326 | 1326 | } |
| 1327 | 1327 | |
| 1328 | 1328 | function bigbluebuttonbn_get_cfg_waitformoderator_editable() { |
| 1329 | 1329 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1330 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_editable)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_editable: (isset($CFG->bigbluebuttonbn_waitformoderator_editable)? $CFG->bigbluebuttonbn_waitformoderator_editable: true)); |
|
| 1330 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_editable) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_editable : (isset($CFG->bigbluebuttonbn_waitformoderator_editable) ? $CFG->bigbluebuttonbn_waitformoderator_editable : true)); |
|
| 1331 | 1331 | } |
| 1332 | 1332 | |
| 1333 | 1333 | function bigbluebuttonbn_get_cfg_waitformoderator_ping_interval() { |
| 1334 | 1334 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1335 | - 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)); |
|
| 1335 | + 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)); |
|
| 1336 | 1336 | } |
| 1337 | 1337 | |
| 1338 | 1338 | function bigbluebuttonbn_get_cfg_waitformoderator_cache_ttl() { |
| 1339 | 1339 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1340 | - 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)); |
|
| 1340 | + 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)); |
|
| 1341 | 1341 | } |
| 1342 | 1342 | |
| 1343 | 1343 | function bigbluebuttonbn_get_cfg_userlimit_default() { |
| 1344 | 1344 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1345 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_default)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_default: (isset($CFG->bigbluebuttonbn_userlimit_default)? $CFG->bigbluebuttonbn_userlimit_default: 0)); |
|
| 1345 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_default) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_default : (isset($CFG->bigbluebuttonbn_userlimit_default) ? $CFG->bigbluebuttonbn_userlimit_default : 0)); |
|
| 1346 | 1346 | } |
| 1347 | 1347 | |
| 1348 | 1348 | function bigbluebuttonbn_get_cfg_userlimit_editable() { |
| 1349 | 1349 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1350 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_editable)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_editable: (isset($CFG->bigbluebuttonbn_userlimit_editable)? $CFG->bigbluebuttonbn_userlimit_editable: false)); |
|
| 1350 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_editable) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_editable : (isset($CFG->bigbluebuttonbn_userlimit_editable) ? $CFG->bigbluebuttonbn_userlimit_editable : false)); |
|
| 1351 | 1351 | } |
| 1352 | 1352 | |
| 1353 | 1353 | function bigbluebuttonbn_get_cfg_preuploadpresentation_enabled() { |
| 1354 | 1354 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1355 | 1355 | if (extension_loaded('curl')) { |
| 1356 | 1356 | // This feature only works if curl is installed |
| 1357 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_preuploadpresentation_enabled)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_preuploadpresentation_enabled: (isset($CFG->bigbluebuttonbn_preuploadpresentation_enabled)? $CFG->bigbluebuttonbn_preuploadpresentation_enabled: false)); |
|
| 1357 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_preuploadpresentation_enabled) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_preuploadpresentation_enabled : (isset($CFG->bigbluebuttonbn_preuploadpresentation_enabled) ? $CFG->bigbluebuttonbn_preuploadpresentation_enabled : false)); |
|
| 1358 | 1358 | } else { |
| 1359 | 1359 | return false; |
| 1360 | 1360 | } |
@@ -1362,37 +1362,37 @@ discard block |
||
| 1362 | 1362 | |
| 1363 | 1363 | function bigbluebuttonbn_get_cfg_sendnotifications_enabled() { |
| 1364 | 1364 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1365 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_sendnotifications_enabled)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_sendnotifications_enabled: (isset($CFG->bigbluebuttonbn_sendnotifications_enabled)? $CFG->bigbluebuttonbn_sendnotifications_enabled: false)); |
|
| 1365 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_sendnotifications_enabled) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_sendnotifications_enabled : (isset($CFG->bigbluebuttonbn_sendnotifications_enabled) ? $CFG->bigbluebuttonbn_sendnotifications_enabled : false)); |
|
| 1366 | 1366 | } |
| 1367 | 1367 | |
| 1368 | 1368 | function bigbluebuttonbn_get_cfg_recordingready_enabled() { |
| 1369 | 1369 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1370 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingready_enabled)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingready_enabled: (isset($CFG->bigbluebuttonbn_recordingready_enabled)? $CFG->bigbluebuttonbn_recordingready_enabled: false)); |
|
| 1370 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingready_enabled) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingready_enabled : (isset($CFG->bigbluebuttonbn_recordingready_enabled) ? $CFG->bigbluebuttonbn_recordingready_enabled : false)); |
|
| 1371 | 1371 | } |
| 1372 | 1372 | |
| 1373 | 1373 | function bigbluebuttonbn_get_cfg_moderator_default() { |
| 1374 | 1374 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1375 | - return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_moderator_default)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_moderator_default: (isset($CFG->bigbluebuttonbn_moderator_default)? $CFG->bigbluebuttonbn_moderator_default: 'owner')); |
|
| 1375 | + return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_moderator_default) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_moderator_default : (isset($CFG->bigbluebuttonbn_moderator_default) ? $CFG->bigbluebuttonbn_moderator_default : 'owner')); |
|
| 1376 | 1376 | } |
| 1377 | 1377 | |
| 1378 | 1378 | function bigbluebuttonbn_get_cfg_scheduled_duration_enabled() { |
| 1379 | 1379 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1380 | - 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)); |
|
| 1380 | + 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)); |
|
| 1381 | 1381 | } |
| 1382 | 1382 | |
| 1383 | 1383 | function bigbluebuttonbn_get_cfg_scheduled_duration_compensation() { |
| 1384 | 1384 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1385 | - 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)); |
|
| 1385 | + 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)); |
|
| 1386 | 1386 | } |
| 1387 | 1387 | |
| 1388 | 1388 | function bigbluebuttonbn_get_cfg_scheduled_pre_opening() { |
| 1389 | 1389 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
| 1390 | - 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)); |
|
| 1390 | + 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)); |
|
| 1391 | 1391 | } |
| 1392 | 1392 | |
| 1393 | 1393 | function bigbluebuttonbn_import_get_courses_for_select(array $bbbsession) { |
| 1394 | 1394 | |
| 1395 | - if( $bbbsession['administrator'] ) { |
|
| 1395 | + if ($bbbsession['administrator']) { |
|
| 1396 | 1396 | $courses = get_courses('all', 'c.id ASC', 'c.id,c.shortname,c.fullname'); |
| 1397 | 1397 | //It includes the name of the site as a course (category 0), so remove the first one |
| 1398 | 1398 | unset($courses["1"]); |
@@ -1401,21 +1401,21 @@ discard block |
||
| 1401 | 1401 | } |
| 1402 | 1402 | |
| 1403 | 1403 | $courses_for_select = []; |
| 1404 | - foreach($courses as $course) { |
|
| 1405 | - if( $course->id != $bbbsession['course']->id ) { |
|
| 1404 | + foreach ($courses as $course) { |
|
| 1405 | + if ($course->id != $bbbsession['course']->id) { |
|
| 1406 | 1406 | $courses_for_select[$course->id] = $course->fullname; |
| 1407 | 1407 | } |
| 1408 | 1408 | } |
| 1409 | 1409 | return $courses_for_select; |
| 1410 | 1410 | } |
| 1411 | 1411 | |
| 1412 | -function bigbluebuttonbn_getRecordedMeetingsDeleted($courseID, $bigbluebuttonbnID=NULL) { |
|
| 1412 | +function bigbluebuttonbn_getRecordedMeetingsDeleted($courseID, $bigbluebuttonbnID = NULL) { |
|
| 1413 | 1413 | global $DB; |
| 1414 | 1414 | |
| 1415 | 1415 | $records_deleted = array(); |
| 1416 | 1416 | |
| 1417 | - $filter = array('courseid' => $courseID, 'log' => BIGBLUEBUTTONBN_LOG_EVENT_DELETE ); |
|
| 1418 | - if ( $bigbluebuttonbnID != NULL ) { |
|
| 1417 | + $filter = array('courseid' => $courseID, 'log' => BIGBLUEBUTTONBN_LOG_EVENT_DELETE); |
|
| 1418 | + if ($bigbluebuttonbnID != NULL) { |
|
| 1419 | 1419 | $filter['id'] = $bigbluebuttonbnID; |
| 1420 | 1420 | } |
| 1421 | 1421 | |
@@ -1424,17 +1424,17 @@ discard block |
||
| 1424 | 1424 | foreach ($bigbluebuttonbns_deleted as $key => $bigbluebuttonbn_deleted) { |
| 1425 | 1425 | $records = $DB->get_records('bigbluebuttonbn_logs', array('courseid' => $courseID, 'log' => BIGBLUEBUTTONBN_LOG_EVENT_CREATE)); |
| 1426 | 1426 | |
| 1427 | - if( !empty($records) ) { |
|
| 1427 | + if (!empty($records)) { |
|
| 1428 | 1428 | //Remove duplicates |
| 1429 | 1429 | $unique_records = array(); |
| 1430 | 1430 | foreach ($records as $key => $record) { |
| 1431 | - if (array_key_exists($record->meetingid, $unique_records) ) { |
|
| 1431 | + if (array_key_exists($record->meetingid, $unique_records)) { |
|
| 1432 | 1432 | unset($records[$key]); |
| 1433 | 1433 | } else { |
| 1434 | 1434 | $meta = json_decode($record->meta); |
| 1435 | - if ( !$meta->record ) { |
|
| 1435 | + if (!$meta->record) { |
|
| 1436 | 1436 | unset($records[$key]); |
| 1437 | - } else if ( $bigbluebuttonbn_deleted->meetingid != substr($record->meetingid, 0, strlen($bigbluebuttonbn_deleted->meetingid))) { |
|
| 1437 | + } else if ($bigbluebuttonbn_deleted->meetingid != substr($record->meetingid, 0, strlen($bigbluebuttonbn_deleted->meetingid))) { |
|
| 1438 | 1438 | unset($records[$key]); |
| 1439 | 1439 | } else { |
| 1440 | 1440 | array_push($unique_records, $record->meetingid); |
@@ -1449,27 +1449,27 @@ discard block |
||
| 1449 | 1449 | return $records_deleted; |
| 1450 | 1450 | } |
| 1451 | 1451 | |
| 1452 | -function bigbluebuttonbn_getRecordedMeetings($courseID, $bigbluebuttonbnID=NULL) { |
|
| 1452 | +function bigbluebuttonbn_getRecordedMeetings($courseID, $bigbluebuttonbnID = NULL) { |
|
| 1453 | 1453 | global $DB; |
| 1454 | 1454 | |
| 1455 | 1455 | $records = Array(); |
| 1456 | 1456 | |
| 1457 | 1457 | $filter = array('course' => $courseID); |
| 1458 | - if ( $bigbluebuttonbnID != NULL ) { |
|
| 1458 | + if ($bigbluebuttonbnID != NULL) { |
|
| 1459 | 1459 | $filter['id'] = $bigbluebuttonbnID; |
| 1460 | 1460 | } |
| 1461 | 1461 | $bigbluebuttonbns = $DB->get_records('bigbluebuttonbn', $filter); |
| 1462 | 1462 | |
| 1463 | - if ( !empty($bigbluebuttonbns) ) { |
|
| 1463 | + if (!empty($bigbluebuttonbns)) { |
|
| 1464 | 1464 | $table = 'bigbluebuttonbn_logs'; |
| 1465 | 1465 | |
| 1466 | 1466 | //Prepare select for loading records based on existent bigbluebuttonbns |
| 1467 | 1467 | $select = ""; |
| 1468 | 1468 | foreach ($bigbluebuttonbns as $key => $bigbluebuttonbn) { |
| 1469 | - $select .= strlen($select) == 0? "(": " OR "; |
|
| 1470 | - $select .= "bigbluebuttonbnid=".$bigbluebuttonbn->id; |
|
| 1469 | + $select .= strlen($select) == 0 ? "(" : " OR "; |
|
| 1470 | + $select .= "bigbluebuttonbnid=" . $bigbluebuttonbn->id; |
|
| 1471 | 1471 | } |
| 1472 | - $select .= ") AND log='".BIGBLUEBUTTONBN_LOG_EVENT_CREATE."'"; |
|
| 1472 | + $select .= ") AND log='" . BIGBLUEBUTTONBN_LOG_EVENT_CREATE . "'"; |
|
| 1473 | 1473 | |
| 1474 | 1474 | //Execute select for loading records based on existent bigbluebuttonbns |
| 1475 | 1475 | $records = $DB->get_records_select($table, $select); |
@@ -1477,8 +1477,8 @@ discard block |
||
| 1477 | 1477 | //Remove duplicates |
| 1478 | 1478 | $unique_records = array(); |
| 1479 | 1479 | foreach ($records as $key => $record) { |
| 1480 | - $record_key = $record->meetingid.','.$record->bigbluebuttonbnid.','.$record->meta; |
|
| 1481 | - if( array_search($record_key, $unique_records) === false ) { |
|
| 1480 | + $record_key = $record->meetingid . ',' . $record->bigbluebuttonbnid . ',' . $record->meta; |
|
| 1481 | + if (array_search($record_key, $unique_records) === false) { |
|
| 1482 | 1482 | array_push($unique_records, $record_key); |
| 1483 | 1483 | } else { |
| 1484 | 1484 | unset($records[$key]); |
@@ -1488,7 +1488,7 @@ discard block |
||
| 1488 | 1488 | //Remove the ones with record=false |
| 1489 | 1489 | foreach ($records as $key => $record) { |
| 1490 | 1490 | $meta = json_decode($record->meta); |
| 1491 | - if ( !$meta || !$meta->record ) { |
|
| 1491 | + if (!$meta || !$meta->record) { |
|
| 1492 | 1492 | unset($records[$key]); |
| 1493 | 1493 | } |
| 1494 | 1494 | } |
@@ -1502,15 +1502,15 @@ discard block |
||
| 1502 | 1502 | |
| 1503 | 1503 | // Load the meetingIDs to be used in the getRecordings request |
| 1504 | 1504 | $meetingID = ''; |
| 1505 | - if ( is_numeric($courseID) ) { |
|
| 1505 | + if (is_numeric($courseID)) { |
|
| 1506 | 1506 | $results = bigbluebuttonbn_getRecordedMeetings($courseID); |
| 1507 | 1507 | |
| 1508 | - if( bigbluebuttonbn_get_cfg_importrecordings_from_deleted_activities_enabled() ) { |
|
| 1508 | + if (bigbluebuttonbn_get_cfg_importrecordings_from_deleted_activities_enabled()) { |
|
| 1509 | 1509 | $results_deleted = bigbluebuttonbn_getRecordedMeetingsDeleted($courseID); |
| 1510 | 1510 | $results = array_merge($results, $results_deleted); |
| 1511 | 1511 | } |
| 1512 | 1512 | |
| 1513 | - if( $results ) { |
|
| 1513 | + if ($results) { |
|
| 1514 | 1514 | //Eliminates duplicates |
| 1515 | 1515 | $mIDs = array(); |
| 1516 | 1516 | foreach ($results as $result) { |
@@ -1525,7 +1525,7 @@ discard block |
||
| 1525 | 1525 | } |
| 1526 | 1526 | |
| 1527 | 1527 | // If there were meetingIDs excecute the getRecordings request |
| 1528 | - if ( $meetingID != '' ) { |
|
| 1528 | + if ($meetingID != '') { |
|
| 1529 | 1529 | $recordings = bigbluebuttonbn_getRecordingsArray($meetingID, $URL, $SALT); |
| 1530 | 1530 | } |
| 1531 | 1531 | |
@@ -1548,37 +1548,37 @@ discard block |
||
| 1548 | 1548 | $recordings_already_imported_indexed = bigbluebuttonbn_index_recordings($recordings_already_imported); |
| 1549 | 1549 | |
| 1550 | 1550 | foreach ($recordings as $key => $recording) { |
| 1551 | - if( isset($recordings_already_imported_indexed[$recording['recordID']]) ) { |
|
| 1551 | + if (isset($recordings_already_imported_indexed[$recording['recordID']])) { |
|
| 1552 | 1552 | unset($recordings[$key]); |
| 1553 | 1553 | } |
| 1554 | 1554 | } |
| 1555 | 1555 | return $recordings; |
| 1556 | 1556 | } |
| 1557 | 1557 | |
| 1558 | -function bigbluebutton_output_recording_table($bbbsession, $recordings, $tools=['publishing','deleting']) { |
|
| 1558 | +function bigbluebutton_output_recording_table($bbbsession, $recordings, $tools = ['publishing', 'deleting']) { |
|
| 1559 | 1559 | |
| 1560 | - if ( isset($recordings) && !empty($recordings) ) { // There are recordings for this meeting |
|
| 1560 | + if (isset($recordings) && !empty($recordings)) { // There are recordings for this meeting |
|
| 1561 | 1561 | $table = bigbluebuttonbn_get_recording_table($bbbsession, $recordings, $tools); |
| 1562 | 1562 | } |
| 1563 | 1563 | |
| 1564 | 1564 | $output = ''; |
| 1565 | - if( isset($table->data) ) { |
|
| 1565 | + if (isset($table->data)) { |
|
| 1566 | 1566 | //Print the table |
| 1567 | - $output .= '<div id="bigbluebuttonbn_html_table">'."\n"; |
|
| 1568 | - $output .= html_writer::table($table)."\n"; |
|
| 1569 | - $output .= '</div>'."\n"; |
|
| 1567 | + $output .= '<div id="bigbluebuttonbn_html_table">' . "\n"; |
|
| 1568 | + $output .= html_writer::table($table) . "\n"; |
|
| 1569 | + $output .= '</div>' . "\n"; |
|
| 1570 | 1570 | |
| 1571 | 1571 | } else { |
| 1572 | - $output .= get_string('view_message_norecordings', 'bigbluebuttonbn').'<br>'."\n"; |
|
| 1572 | + $output .= get_string('view_message_norecordings', 'bigbluebuttonbn') . '<br>' . "\n"; |
|
| 1573 | 1573 | } |
| 1574 | 1574 | |
| 1575 | 1575 | return $output; |
| 1576 | 1576 | } |
| 1577 | 1577 | |
| 1578 | -function bigbluebuttonbn_getRecordingsImported($courseID, $bigbluebuttonbnID=NULL) { |
|
| 1578 | +function bigbluebuttonbn_getRecordingsImported($courseID, $bigbluebuttonbnID = NULL) { |
|
| 1579 | 1579 | global $DB; |
| 1580 | 1580 | |
| 1581 | - if ( $bigbluebuttonbnID != NULL ) { |
|
| 1581 | + if ($bigbluebuttonbnID != NULL) { |
|
| 1582 | 1582 | // Fetch only those related to the $courseID and $bigbluebuttonbnID requested |
| 1583 | 1583 | $recordings_imported = $DB->get_records('bigbluebuttonbn_logs', array('courseid' => $courseID, 'bigbluebuttonbnid' => $bigbluebuttonbnID, 'log' => BIGBLUEBUTTONBN_LOG_EVENT_IMPORT)); |
| 1584 | 1584 | } else { |
@@ -1588,7 +1588,7 @@ discard block |
||
| 1588 | 1588 | return $recordings_imported; |
| 1589 | 1589 | } |
| 1590 | 1590 | |
| 1591 | -function bigbluebuttonbn_getRecordingsImportedArray($courseID, $bigbluebuttonbnID=NULL) { |
|
| 1591 | +function bigbluebuttonbn_getRecordingsImportedArray($courseID, $bigbluebuttonbnID = NULL) { |
|
| 1592 | 1592 | $recordings_imported = bigbluebuttonbn_getRecordingsImported($courseID, $bigbluebuttonbnID); |
| 1593 | 1593 | $recordings_imported_array = bigbluebuttonbn_import_get_recordings_imported($recordings_imported); |
| 1594 | 1594 | return $recordings_imported_array; |
@@ -1597,7 +1597,7 @@ discard block |
||
| 1597 | 1597 | function bigbluebuttonbn_getRecordingsImportedAllInstances($recordID) { |
| 1598 | 1598 | global $DB, $CFG; |
| 1599 | 1599 | |
| 1600 | - $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.'%' )); |
|
| 1600 | + $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 . '%')); |
|
| 1601 | 1601 | return $recordings_imported; |
| 1602 | 1602 | } |
| 1603 | 1603 | |
@@ -1616,8 +1616,8 @@ discard block |
||
| 1616 | 1616 | function bigbluebuttonbn_html2text($html, $len) { |
| 1617 | 1617 | $text = strip_tags($html); |
| 1618 | 1618 | $text = str_replace(" ", ' ', $text); |
| 1619 | - if( strlen($text) > $len ) |
|
| 1620 | - $text = substr($text, 0, $len)."..."; |
|
| 1619 | + if (strlen($text) > $len) |
|
| 1620 | + $text = substr($text, 0, $len) . "..."; |
|
| 1621 | 1621 | else |
| 1622 | 1622 | $text = substr($text, 0, $len); |
| 1623 | 1623 | return $text; |
@@ -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 | |