@@ -27,7 +27,7 @@ |
||
| 27 | 27 | |
| 28 | 28 | global $CFG; |
| 29 | 29 | |
| 30 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
| 30 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
| 31 | 31 | |
| 32 | 32 | if ($ADMIN->fulltree) { |
| 33 | 33 | // Configuration for BigBlueButton. |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | defined('MOODLE_INTERNAL') || die; |
| 27 | 27 | |
| 28 | -require_once($CFG->dirroot.'/mod/bigbluebuttonbn/backup/moodle2/backup_bigbluebuttonbn_stepslib.php'); |
|
| 28 | +require_once($CFG->dirroot . '/mod/bigbluebuttonbn/backup/moodle2/backup_bigbluebuttonbn_stepslib.php'); |
|
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | 31 | * Backup task that provides all the settings and steps to perform one complete backup of the activity. |
@@ -62,14 +62,14 @@ discard block |
||
| 62 | 62 | public static function encode_content_links($content) { |
| 63 | 63 | global $CFG; |
| 64 | 64 | |
| 65 | - $base = preg_quote($CFG->wwwroot.'/mod/bigbluebuttonbn', '#'); |
|
| 65 | + $base = preg_quote($CFG->wwwroot . '/mod/bigbluebuttonbn', '#'); |
|
| 66 | 66 | |
| 67 | 67 | // Link to the list of bigbluebuttonbns. |
| 68 | - $pattern = '#('.$base."\/index.php\?id\=)([0-9]+)#"; |
|
| 68 | + $pattern = '#(' . $base . "\/index.php\?id\=)([0-9]+)#"; |
|
| 69 | 69 | $content = preg_replace($pattern, '$@BIGBLUEBUTTONBNINDEX*$2@$', $content); |
| 70 | 70 | |
| 71 | 71 | // Link to bigbluebuttonbn view by moduleid. |
| 72 | - $pattern = '#('.$base."\/view.php\?id\=)([0-9]+)#"; |
|
| 72 | + $pattern = '#(' . $base . "\/view.php\?id\=)([0-9]+)#"; |
|
| 73 | 73 | $content = preg_replace($pattern, '$@BIGBLUEBUTTONBNVIEWBYID*$2@$', $content); |
| 74 | 74 | |
| 75 | 75 | return $content; |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | $logs = new backup_nested_element('logs'); |
| 49 | 49 | |
| 50 | 50 | $log = new backup_nested_element('log', array('id'), array( |
| 51 | - 'courseid', 'bigbluebuttonbnid', 'userid', 'timecreated', 'meetingid', 'log', 'meta', )); |
|
| 51 | + 'courseid', 'bigbluebuttonbnid', 'userid', 'timecreated', 'meetingid', 'log', 'meta',)); |
|
| 52 | 52 | |
| 53 | 53 | // Build the tree. |
| 54 | 54 | $bigbluebuttonbn->add_child($logs); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | protected function process_bigbluebuttonbn($data) { |
| 51 | 51 | global $DB; |
| 52 | - $data = (object) $data; |
|
| 52 | + $data = (object)$data; |
|
| 53 | 53 | $data->course = $this->get_courseid(); |
| 54 | 54 | $data->timemodified = $this->apply_date_offset($data->timemodified); |
| 55 | 55 | // Insert the bigbluebuttonbn record. |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | protected function process_bigbluebuttonbn_logs($data) { |
| 67 | 67 | global $DB; |
| 68 | - $data = (object) $data; |
|
| 68 | + $data = (object)$data; |
|
| 69 | 69 | // Apply modifications. |
| 70 | 70 | $data->courseid = $this->get_mappingid('course', $data->courseid); |
| 71 | 71 | $data->bigbluebuttonbnid = $this->get_new_parentid('bigbluebuttonbn'); |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | |
| 26 | 26 | defined('MOODLE_INTERNAL') || die(); |
| 27 | 27 | |
| 28 | -require_once($CFG->dirroot.'/mod/bigbluebuttonbn/backup/moodle2/restore_bigbluebuttonbn_stepslib.php'); |
|
| 28 | +require_once($CFG->dirroot . '/mod/bigbluebuttonbn/backup/moodle2/restore_bigbluebuttonbn_stepslib.php'); |
|
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | 31 | * Restore task that provides all the settings and steps to perform one complete restore of the activity. |
@@ -198,10 +198,10 @@ discard block |
||
| 198 | 198 | */ |
| 199 | 199 | function bigbluebutton_bbb_view_create_meeting_data(&$bbbsession) { |
| 200 | 200 | $data = ['meetingID' => $bbbsession['meetingid'], |
| 201 | - 'name' => bigbluebuttonbn_html2text($bbbsession['meetingname'], 64), |
|
| 202 | - 'attendeePW' => $bbbsession['viewerPW'], |
|
| 203 | - 'moderatorPW' => $bbbsession['modPW'], |
|
| 204 | - 'logoutURL' => $bbbsession['logoutURL'], |
|
| 201 | + 'name' => bigbluebuttonbn_html2text($bbbsession['meetingname'], 64), |
|
| 202 | + 'attendeePW' => $bbbsession['viewerPW'], |
|
| 203 | + 'moderatorPW' => $bbbsession['modPW'], |
|
| 204 | + 'logoutURL' => $bbbsession['logoutURL'], |
|
| 205 | 205 | ]; |
| 206 | 206 | $data['record'] = bigbluebutton_bbb_view_create_meeting_data_record($bbbsession['record']); |
| 207 | 207 | $data['welcome'] = trim($bbbsession['welcome']); |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | '%duration%', |
| 215 | 215 | (string) $durationtime, |
| 216 | 216 | get_string('bbbdurationwarning', 'bigbluebuttonbn') |
| 217 | - ); |
|
| 217 | + ); |
|
| 218 | 218 | } |
| 219 | 219 | $voicebridge = intval($bbbsession['voicebridge']); |
| 220 | 220 | if ($voicebridge > 0 && $voicebridge < 79999) { |
@@ -253,22 +253,22 @@ discard block |
||
| 253 | 253 | function bigbluebutton_bbb_view_create_meeting_metadata(&$bbbsession) { |
| 254 | 254 | global $USER; |
| 255 | 255 | $metadata = ['bbb-origin' => $bbbsession['origin'], |
| 256 | - 'bbb-origin-version' => $bbbsession['originVersion'], |
|
| 257 | - 'bbb-origin-server-name' => $bbbsession['originServerName'], |
|
| 258 | - 'bbb-origin-server-common-name' => $bbbsession['originServerCommonName'], |
|
| 259 | - 'bbb-origin-tag' => $bbbsession['originTag'], |
|
| 260 | - 'bbb-context' => $bbbsession['course']->fullname, |
|
| 261 | - 'bbb-recording-name' => bigbluebuttonbn_html2text($bbbsession['meetingname'], 64), |
|
| 262 | - 'bbb-recording-description' => bigbluebuttonbn_html2text($bbbsession['meetingdescription'], 64), |
|
| 263 | - 'bbb-recording-tags' => bigbluebuttonbn_get_tags($bbbsession['cm']->id), // Same as $id. |
|
| 256 | + 'bbb-origin-version' => $bbbsession['originVersion'], |
|
| 257 | + 'bbb-origin-server-name' => $bbbsession['originServerName'], |
|
| 258 | + 'bbb-origin-server-common-name' => $bbbsession['originServerCommonName'], |
|
| 259 | + 'bbb-origin-tag' => $bbbsession['originTag'], |
|
| 260 | + 'bbb-context' => $bbbsession['course']->fullname, |
|
| 261 | + 'bbb-recording-name' => bigbluebuttonbn_html2text($bbbsession['meetingname'], 64), |
|
| 262 | + 'bbb-recording-description' => bigbluebuttonbn_html2text($bbbsession['meetingdescription'], 64), |
|
| 263 | + 'bbb-recording-tags' => bigbluebuttonbn_get_tags($bbbsession['cm']->id), // Same as $id. |
|
| 264 | 264 | ]; |
| 265 | 265 | if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recordingstatus_enabled')) { |
| 266 | 266 | $metadata["bn-recording-status"] = json_encode( |
| 267 | 267 | array( |
| 268 | 268 | 'email' => array('"' . fullname($USER) . '" <' . $USER->email . '>'), |
| 269 | 269 | 'context' => $bbbsession['bigbluebuttonbnURL'] |
| 270 | - ) |
|
| 271 | - ); |
|
| 270 | + ) |
|
| 271 | + ); |
|
| 272 | 272 | } |
| 273 | 273 | if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recordingready_enabled')) { |
| 274 | 274 | $metadata['bn-recording-ready-url'] = $bbbsession['recordingReadyURL']; |
@@ -62,93 +62,93 @@ |
||
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | switch (strtolower($action)) { |
| 65 | - case 'logout': |
|
| 66 | - if (isset($errors) && $errors != '') { |
|
| 67 | - bigbluebutton_bbb_view_errors($errors, $id); |
|
| 68 | - break; |
|
| 69 | - } |
|
| 70 | - if (is_null($bbbsession)) { |
|
| 71 | - bigbluebutton_bbb_view_close_window_manually(); |
|
| 72 | - break; |
|
| 73 | - } |
|
| 74 | - // Moodle event logger: Create an event for meeting left. |
|
| 75 | - bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_LEFT, $bigbluebuttonbn, $cm); |
|
| 76 | - // Update the cache. |
|
| 77 | - $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_UPDATE_CACHE); |
|
| 78 | - // Close the tab or window where BBB was opened. |
|
| 79 | - bigbluebutton_bbb_view_close_window(); |
|
| 80 | - break; |
|
| 81 | - case 'join': |
|
| 82 | - if (is_null($bbbsession)) { |
|
| 83 | - print_error('view_error_unable_join', 'bigbluebuttonbn'); |
|
| 84 | - break; |
|
| 85 | - } |
|
| 86 | - // See if the session is in progress. |
|
| 87 | - if (bigbluebuttonbn_is_meeting_running($bbbsession['meetingid'])) { |
|
| 88 | - // Since the meeting is already running, we just join the session. |
|
| 89 | - bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn); |
|
| 90 | - break; |
|
| 91 | - } |
|
| 92 | - // If user is not administrator nor moderator (user is steudent) and waiting is required. |
|
| 93 | - if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) { |
|
| 94 | - header('Location: '.$bbbsession['logoutURL']); |
|
| 65 | + case 'logout': |
|
| 66 | + if (isset($errors) && $errors != '') { |
|
| 67 | + bigbluebutton_bbb_view_errors($errors, $id); |
|
| 68 | + break; |
|
| 69 | + } |
|
| 70 | + if (is_null($bbbsession)) { |
|
| 71 | + bigbluebutton_bbb_view_close_window_manually(); |
|
| 72 | + break; |
|
| 73 | + } |
|
| 74 | + // Moodle event logger: Create an event for meeting left. |
|
| 75 | + bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_LEFT, $bigbluebuttonbn, $cm); |
|
| 76 | + // Update the cache. |
|
| 77 | + $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_UPDATE_CACHE); |
|
| 78 | + // Close the tab or window where BBB was opened. |
|
| 79 | + bigbluebutton_bbb_view_close_window(); |
|
| 95 | 80 | break; |
| 96 | - } |
|
| 97 | - // As the meeting doesn't exist, try to create it. |
|
| 98 | - $response = bigbluebuttonbn_get_create_meeting_array( |
|
| 99 | - bigbluebutton_bbb_view_create_meeting_data($bbbsession), |
|
| 100 | - bigbluebutton_bbb_view_create_meeting_metadata($bbbsession), |
|
| 101 | - $bbbsession['presentation']['name'], |
|
| 102 | - $bbbsession['presentation']['url'] |
|
| 103 | - ); |
|
| 104 | - if (empty($response)) { |
|
| 105 | - // The server is unreachable. |
|
| 106 | - if ($bbbsession['administrator']) { |
|
| 107 | - print_error('view_error_unable_join', 'bigbluebuttonbn', |
|
| 108 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 81 | + case 'join': |
|
| 82 | + if (is_null($bbbsession)) { |
|
| 83 | + print_error('view_error_unable_join', 'bigbluebuttonbn'); |
|
| 84 | + break; |
|
| 85 | + } |
|
| 86 | + // See if the session is in progress. |
|
| 87 | + if (bigbluebuttonbn_is_meeting_running($bbbsession['meetingid'])) { |
|
| 88 | + // Since the meeting is already running, we just join the session. |
|
| 89 | + bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn); |
|
| 109 | 90 | break; |
| 110 | 91 | } |
| 111 | - if ($bbbsession['moderator']) { |
|
| 112 | - print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', |
|
| 92 | + // If user is not administrator nor moderator (user is steudent) and waiting is required. |
|
| 93 | + if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) { |
|
| 94 | + header('Location: '.$bbbsession['logoutURL']); |
|
| 95 | + break; |
|
| 96 | + } |
|
| 97 | + // As the meeting doesn't exist, try to create it. |
|
| 98 | + $response = bigbluebuttonbn_get_create_meeting_array( |
|
| 99 | + bigbluebutton_bbb_view_create_meeting_data($bbbsession), |
|
| 100 | + bigbluebutton_bbb_view_create_meeting_metadata($bbbsession), |
|
| 101 | + $bbbsession['presentation']['name'], |
|
| 102 | + $bbbsession['presentation']['url'] |
|
| 103 | + ); |
|
| 104 | + if (empty($response)) { |
|
| 105 | + // The server is unreachable. |
|
| 106 | + if ($bbbsession['administrator']) { |
|
| 107 | + print_error('view_error_unable_join', 'bigbluebuttonbn', |
|
| 108 | + $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 109 | + break; |
|
| 110 | + } |
|
| 111 | + if ($bbbsession['moderator']) { |
|
| 112 | + print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', |
|
| 113 | + $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 114 | + break; |
|
| 115 | + } |
|
| 116 | + print_error('view_error_unable_join_student', 'bigbluebuttonbn', |
|
| 113 | 117 | $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
| 114 | 118 | break; |
| 115 | 119 | } |
| 116 | - print_error('view_error_unable_join_student', 'bigbluebuttonbn', |
|
| 117 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 118 | - break; |
|
| 119 | - } |
|
| 120 | - if ($response['returncode'] == 'FAILED') { |
|
| 121 | - // The meeting was not created. |
|
| 122 | - if (!$printerrorkey) { |
|
| 123 | - print_error($response['message'], 'bigbluebuttonbn'); |
|
| 120 | + if ($response['returncode'] == 'FAILED') { |
|
| 121 | + // The meeting was not created. |
|
| 122 | + if (!$printerrorkey) { |
|
| 123 | + print_error($response['message'], 'bigbluebuttonbn'); |
|
| 124 | + break; |
|
| 125 | + } |
|
| 126 | + $printerrorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create'); |
|
| 127 | + print_error($printerrorkey, 'bigbluebuttonbn'); |
|
| 128 | + break; |
|
| 129 | + } |
|
| 130 | + if ($response['hasBeenForciblyEnded'] == 'true') { |
|
| 131 | + print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn')); |
|
| 124 | 132 | break; |
| 125 | 133 | } |
| 126 | - $printerrorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create'); |
|
| 127 | - print_error($printerrorkey, 'bigbluebuttonbn'); |
|
| 134 | + // Moodle event logger: Create an event for meeting created. |
|
| 135 | + bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_CREATED, $bigbluebuttonbn, $cm); |
|
| 136 | + // Internal logger: Insert a record with the meeting created. |
|
| 137 | + $overrides = array('meetingid' => $bbbsession['meetingid']); |
|
| 138 | + $meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}'; |
|
| 139 | + bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_CREATE, $overrides, $meta); |
|
| 140 | + // Since the meeting is already running, we just join the session. |
|
| 141 | + bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn); |
|
| 128 | 142 | break; |
| 129 | - } |
|
| 130 | - if ($response['hasBeenForciblyEnded'] == 'true') { |
|
| 131 | - print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn')); |
|
| 143 | + case 'play': |
|
| 144 | + $href = bigbluebutton_bbb_view_playback_href($href, $mid, $rid, $rtype); |
|
| 145 | + // Moodle event logger: Create an event for meeting left. |
|
| 146 | + bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_VIEWED, $bigbluebuttonbn, $cm, ['other' => $rid]); |
|
| 147 | + // Execute the redirect. |
|
| 148 | + header('Location: '.urldecode($href)); |
|
| 132 | 149 | break; |
| 133 | - } |
|
| 134 | - // Moodle event logger: Create an event for meeting created. |
|
| 135 | - bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_CREATED, $bigbluebuttonbn, $cm); |
|
| 136 | - // Internal logger: Insert a record with the meeting created. |
|
| 137 | - $overrides = array('meetingid' => $bbbsession['meetingid']); |
|
| 138 | - $meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}'; |
|
| 139 | - bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_CREATE, $overrides, $meta); |
|
| 140 | - // Since the meeting is already running, we just join the session. |
|
| 141 | - bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn); |
|
| 142 | - break; |
|
| 143 | - case 'play': |
|
| 144 | - $href = bigbluebutton_bbb_view_playback_href($href, $mid, $rid, $rtype); |
|
| 145 | - // Moodle event logger: Create an event for meeting left. |
|
| 146 | - bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_VIEWED, $bigbluebuttonbn, $cm, ['other' => $rid]); |
|
| 147 | - // Execute the redirect. |
|
| 148 | - header('Location: '.urldecode($href)); |
|
| 149 | - break; |
|
| 150 | - default: |
|
| 151 | - bigbluebutton_bbb_view_close_window(); |
|
| 150 | + default: |
|
| 151 | + bigbluebutton_bbb_view_close_window(); |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | /** |
@@ -23,8 +23,8 @@ discard block |
||
| 23 | 23 | * @author Jesus Federico (jesus [at] blindsidenetworks [dt] com) |
| 24 | 24 | */ |
| 25 | 25 | |
| 26 | -require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); |
|
| 27 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
| 26 | +require_once(dirname(dirname(dirname(__FILE__))) . '/config.php'); |
|
| 27 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
| 28 | 28 | |
| 29 | 29 | $action = required_param('action', PARAM_TEXT); |
| 30 | 30 | $id = optional_param('id', 0, PARAM_INT); |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | } |
| 92 | 92 | // If user is not administrator nor moderator (user is steudent) and waiting is required. |
| 93 | 93 | if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) { |
| 94 | - header('Location: '.$bbbsession['logoutURL']); |
|
| 94 | + header('Location: ' . $bbbsession['logoutURL']); |
|
| 95 | 95 | break; |
| 96 | 96 | } |
| 97 | 97 | // As the meeting doesn't exist, try to create it. |
@@ -105,16 +105,16 @@ discard block |
||
| 105 | 105 | // The server is unreachable. |
| 106 | 106 | if ($bbbsession['administrator']) { |
| 107 | 107 | print_error('view_error_unable_join', 'bigbluebuttonbn', |
| 108 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 108 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 109 | 109 | break; |
| 110 | 110 | } |
| 111 | 111 | if ($bbbsession['moderator']) { |
| 112 | 112 | print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', |
| 113 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 113 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 114 | 114 | break; |
| 115 | 115 | } |
| 116 | 116 | print_error('view_error_unable_join_student', 'bigbluebuttonbn', |
| 117 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 117 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 118 | 118 | break; |
| 119 | 119 | } |
| 120 | 120 | if ($response['returncode'] == 'FAILED') { |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_CREATED, $bigbluebuttonbn, $cm); |
| 136 | 136 | // Internal logger: Insert a record with the meeting created. |
| 137 | 137 | $overrides = array('meetingid' => $bbbsession['meetingid']); |
| 138 | - $meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}'; |
|
| 138 | + $meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}'; |
|
| 139 | 139 | bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_CREATE, $overrides, $meta); |
| 140 | 140 | // Since the meeting is already running, we just join the session. |
| 141 | 141 | bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn); |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | // Moodle event logger: Create an event for meeting left. |
| 146 | 146 | bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_VIEWED, $bigbluebuttonbn, $cm, ['other' => $rid]); |
| 147 | 147 | // Execute the redirect. |
| 148 | - header('Location: '.urldecode($href)); |
|
| 148 | + header('Location: ' . urldecode($href)); |
|
| 149 | 149 | break; |
| 150 | 150 | default: |
| 151 | 151 | bigbluebutton_bbb_view_close_window(); |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | $data['welcome'] .= '<br><br>'; |
| 231 | 231 | $data['welcome'] .= str_replace( |
| 232 | 232 | '%duration%', |
| 233 | - (string) $durationtime, |
|
| 233 | + (string)$durationtime, |
|
| 234 | 234 | get_string('bbbdurationwarning', 'bigbluebuttonbn') |
| 235 | 235 | ); |
| 236 | 236 | } |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_UPDATE_CACHE); |
| 319 | 319 | if ($bbbsession['userlimit'] > 0 && intval($meetinginfo['participantCount']) >= $bbbsession['userlimit']) { |
| 320 | 320 | // No more users allowed to join. |
| 321 | - header('Location: '.$bbbsession['logoutURL']); |
|
| 321 | + header('Location: ' . $bbbsession['logoutURL']); |
|
| 322 | 322 | return; |
| 323 | 323 | } |
| 324 | 324 | // Build the URL. |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | bigbluebuttonbn_participant_joined($bbbsession['meetingid'], |
| 338 | 338 | ($bbbsession['administrator'] || $bbbsession['moderator'])); |
| 339 | 339 | // Execute the redirect. |
| 340 | - header('Location: '.$joinurl); |
|
| 340 | + header('Location: ' . $joinurl); |
|
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | /** |
@@ -349,13 +349,13 @@ discard block |
||
| 349 | 349 | */ |
| 350 | 350 | function bigbluebutton_bbb_view_errors($serrors, $id) { |
| 351 | 351 | global $CFG, $OUTPUT; |
| 352 | - $errors = (array) json_decode(urldecode($serrors)); |
|
| 352 | + $errors = (array)json_decode(urldecode($serrors)); |
|
| 353 | 353 | $msgerrors = ''; |
| 354 | 354 | foreach ($errors as $error) { |
| 355 | - $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger'))."\n"; |
|
| 355 | + $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger')) . "\n"; |
|
| 356 | 356 | } |
| 357 | 357 | echo $OUTPUT->header(); |
| 358 | 358 | print_error('view_error_bigbluebutton', 'bigbluebuttonbn', |
| 359 | - $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$id, $msgerrors, $serrors); |
|
| 359 | + $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $id, $msgerrors, $serrors); |
|
| 360 | 360 | echo $OUTPUT->footer(); |
| 361 | 361 | } |
@@ -77,8 +77,8 @@ |
||
| 77 | 77 | $body .= html_writer::start_tag('br'); |
| 78 | 78 | $body .= html_writer::tag('input', '', |
| 79 | 79 | array('type' => 'button', 'class' => 'btn btn-secondary', |
| 80 | - 'value' => get_string('view_recording_button_return', 'bigbluebuttonbn'), |
|
| 81 | - 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$cm->id.'\'')); |
|
| 80 | + 'value' => get_string('view_recording_button_return', 'bigbluebuttonbn'), |
|
| 81 | + 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$cm->id.'\'')); |
|
| 82 | 82 | // JavaScript for locales. |
| 83 | 83 | $PAGE->requires->strings_for_js(array_keys(bigbluebuttonbn_get_strings_for_js()), 'bigbluebuttonbn'); |
| 84 | 84 | // Require JavaScript modules. |
@@ -23,8 +23,8 @@ discard block |
||
| 23 | 23 | * @author Jesus Federico (jesus [at] blindsidenetworks [dt] com) |
| 24 | 24 | */ |
| 25 | 25 | |
| 26 | -require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); |
|
| 27 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
| 26 | +require_once(dirname(dirname(dirname(__FILE__))) . '/config.php'); |
|
| 27 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
| 28 | 28 | |
| 29 | 29 | $bn = required_param('bn', PARAM_INT); |
| 30 | 30 | $tc = optional_param('tc', 0, PARAM_INT); |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $body .= html_writer::tag('input', '', |
| 79 | 79 | array('type' => 'button', 'class' => 'btn btn-secondary', |
| 80 | 80 | 'value' => get_string('view_recording_button_return', 'bigbluebuttonbn'), |
| 81 | - 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$cm->id.'\'')); |
|
| 81 | + 'onclick' => 'window.location=\'' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $cm->id . '\'')); |
|
| 82 | 82 | // JavaScript for locales. |
| 83 | 83 | $PAGE->requires->strings_for_js(array_keys(bigbluebuttonbn_get_strings_for_js()), 'bigbluebuttonbn'); |
| 84 | 84 | // Require JavaScript modules. |
@@ -26,8 +26,8 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | defined('MOODLE_INTERNAL') || die(); |
| 28 | 28 | |
| 29 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
| 30 | -require_once($CFG->dirroot.'/course/moodleform_mod.php'); |
|
| 29 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
| 30 | +require_once($CFG->dirroot . '/course/moodleform_mod.php'); |
|
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | 33 | * Moodle class for mod_form. |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | $serverversion = bigbluebuttonbn_get_server_version(); |
| 49 | 49 | if (is_null($serverversion)) { |
| 50 | 50 | print_error('general_error_unable_connect', 'bigbluebuttonbn', |
| 51 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 51 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 52 | 52 | return; |
| 53 | 53 | } |
| 54 | 54 | // Context. |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | ); |
| 128 | 128 | $defaultvalues['presentation'] = $draftitemid; |
| 129 | 129 | } catch (Exception $e) { |
| 130 | - debugging('Presentation could not be loaded: '.$e->getMessage(), DEBUG_DEVELOPER); |
|
| 130 | + debugging('Presentation could not be loaded: ' . $e->getMessage(), DEBUG_DEVELOPER); |
|
| 131 | 131 | return; |
| 132 | 132 | } |
| 133 | 133 | } |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | return; |
| 424 | 424 | } |
| 425 | 425 | $mform->addElement($type, $name, get_string($descriptionkey, 'bigbluebuttonbn'), $options); |
| 426 | - if (get_string_manager()->string_exists($descriptionkey.'_help', 'bigbluebuttonbn')) { |
|
| 426 | + if (get_string_manager()->string_exists($descriptionkey . '_help', 'bigbluebuttonbn')) { |
|
| 427 | 427 | $mform->addHelpButton($name, $descriptionkey, 'bigbluebuttonbn'); |
| 428 | 428 | } |
| 429 | 429 | if (!empty($rule)) { |
@@ -215,8 +215,8 @@ discard block |
||
| 215 | 215 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
| 216 | 216 | $field['description_key'], 0, ['maxlength' => 4, 'size' => 6], |
| 217 | 217 | ['message' => get_string('mod_form_field_voicebridge_format_error', 'bigbluebuttonbn'), |
| 218 | - 'type' => 'numeric', 'rule' => '####', 'validator' => 'server'] |
|
| 219 | - ); |
|
| 218 | + 'type' => 'numeric', 'rule' => '####', 'validator' => 'server'] |
|
| 219 | + ); |
|
| 220 | 220 | } else { |
| 221 | 221 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
| 222 | 222 | $field['description_key'], 0, ['maxlength' => 4, 'size' => 6]); |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | private function bigbluebuttonbn_mform_add_block_room_recordings(&$mform, $cfg) { |
| 256 | 256 | $recordingsettings = false; |
| 257 | 257 | $field = ['type' => 'hidden', 'name' => 'recordings_html', 'data_type' => PARAM_INT, |
| 258 | - 'description_key' => null]; |
|
| 258 | + 'description_key' => null]; |
|
| 259 | 259 | if ($cfg['recordings_html_editable']) { |
| 260 | 260 | $field['type'] = 'checkbox'; |
| 261 | 261 | $field['description_key'] = 'mod_form_field_recordings_html'; |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
| 265 | 265 | $field['description_key'], $cfg['recordings_html_default']); |
| 266 | 266 | $field = ['type' => 'hidden', 'name' => 'recordings_deleted', 'data_type' => PARAM_INT, |
| 267 | - 'description_key' => null]; |
|
| 267 | + 'description_key' => null]; |
|
| 268 | 268 | if ($cfg['recordings_deleted_editable']) { |
| 269 | 269 | $field['type'] = 'checkbox'; |
| 270 | 270 | $field['description_key'] = 'mod_form_field_recordings_deleted'; |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
| 274 | 274 | $field['description_key'], $cfg['recordings_deleted_default']); |
| 275 | 275 | $field = ['type' => 'hidden', 'name' => 'recordings_imported', 'data_type' => PARAM_INT, |
| 276 | - 'description_key' => null]; |
|
| 276 | + 'description_key' => null]; |
|
| 277 | 277 | if ($cfg['importrecordings_enabled'] && $cfg['recordings_imported_editable']) { |
| 278 | 278 | $field['type'] = 'checkbox'; |
| 279 | 279 | $field['description_key'] = 'mod_form_field_recordings_imported'; |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
| 283 | 283 | $field['description_key'], $cfg['recordings_imported_default']); |
| 284 | 284 | $field = ['type' => 'hidden', 'name' => 'recordings_preview', 'data_type' => PARAM_INT, |
| 285 | - 'description_key' => null]; |
|
| 285 | + 'description_key' => null]; |
|
| 286 | 286 | if ($cfg['recordings_preview_editable']) { |
| 287 | 287 | $field['type'] = 'checkbox'; |
| 288 | 288 | $field['description_key'] = 'mod_form_field_recordings_preview'; |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | $htmlselectiontype = html_writer::select($participantselection['type_options'], |
| 360 | 360 | 'bigbluebuttonbn_participant_selection_type', $participantselection['type_selected'], array(), |
| 361 | 361 | array('id' => 'bigbluebuttonbn_participant_selection_type', |
| 362 | - 'onchange' => 'M.mod_bigbluebuttonbn.modform.participantSelectionSet(); return 0;')); |
|
| 362 | + 'onchange' => 'M.mod_bigbluebuttonbn.modform.participantSelectionSet(); return 0;')); |
|
| 363 | 363 | $htmlselectionoptions = html_writer::select($participantselection['options'], 'bigbluebuttonbn_participant_selection', |
| 364 | 364 | $participantselection['selected'], array(), |
| 365 | 365 | array('id' => 'bigbluebuttonbn_participant_selection', 'disabled' => 'disabled')); |
@@ -367,7 +367,7 @@ discard block |
||
| 367 | 367 | 'type' => 'button', 'class' => 'btn btn-secondary', |
| 368 | 368 | 'value' => get_string('mod_form_field_participant_list_action_add', 'bigbluebuttonbn'), |
| 369 | 369 | 'onclick' => 'M.mod_bigbluebuttonbn.modform.participantAdd(); return 0;' |
| 370 | - )); |
|
| 370 | + )); |
|
| 371 | 371 | $htmladdparticipant = html_writer::tag('div', |
| 372 | 372 | $htmlselectiontype . ' ' . $htmlselectionoptions . ' ' . $htmlselectioninput, null); |
| 373 | 373 | $mform->addElement('html', "\n\n"); |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | $field['description_key'] = 'mod_form_field_block_clienttype'; |
| 412 | 412 | |
| 413 | 413 | $choices = array(BIGBLUEBUTTON_CLIENTTYPE_FLASH => get_string('mod_form_block_clienttype_flash', 'bigbluebuttonbn'), |
| 414 | - BIGBLUEBUTTON_CLIENTTYPE_HTML5 => get_string('mod_form_block_clienttype_html5', 'bigbluebuttonbn')); |
|
| 414 | + BIGBLUEBUTTON_CLIENTTYPE_HTML5 => get_string('mod_form_block_clienttype_html5', 'bigbluebuttonbn')); |
|
| 415 | 415 | |
| 416 | 416 | $mform->addElement('header', 'clienttypeselection', get_string('mod_form_block_clienttype', 'bigbluebuttonbn')); |
| 417 | 417 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | * Remove this block when restored |
| 69 | 69 | */ |
| 70 | 70 | |
| 71 | - /** @var BIGBLUEBUTTONBN_DEFAULT_SERVER_URL string of default bigbluebutton server url */ |
|
| 71 | + /** @var BIGBLUEBUTTONBN_DEFAULT_SERVER_URL string of default bigbluebutton server url */ |
|
| 72 | 72 | const BIGBLUEBUTTONBN_DEFAULT_SERVER_URL = 'http://test-install.blindsidenetworks.com/bigbluebutton/'; |
| 73 | 73 | /** @var BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET string of default bigbluebutton server shared secret */ |
| 74 | 74 | const BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET = '8cd8ef52e8e101574e400365b55e11a6'; |
@@ -345,12 +345,12 @@ discard block |
||
| 345 | 345 | $str = '<div class="bigbluebuttonbn overview">'."\n"; |
| 346 | 346 | $str .= ' <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; |
| 347 | 347 | $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule. |
| 348 | - '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
| 348 | + '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
| 349 | 349 | $str .= ' </div>'."\n"; |
| 350 | 350 | $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime). |
| 351 | 351 | '</div>'."\n"; |
| 352 | 352 | $str .= ' <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) |
| 353 | - .'</div>'."\n"; |
|
| 353 | + .'</div>'."\n"; |
|
| 354 | 354 | $str .= '</div>'."\n"; |
| 355 | 355 | return $str; |
| 356 | 356 | } |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | * @uses FEATURE_GRADE_OUTCOMES |
| 107 | 107 | * @uses FEATURE_SHOW_DESCRIPTION |
| 108 | 108 | * @param string $feature |
| 109 | - * @return mixed True if yes (some features may use other values) |
|
| 109 | + * @return null|boolean True if yes (some features may use other values) |
|
| 110 | 110 | */ |
| 111 | 111 | function bigbluebuttonbn_supports($feature) { |
| 112 | 112 | if (!$feature) { |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | * |
| 227 | 227 | * @param object $bigbluebuttonbn Id of the module instance |
| 228 | 228 | * |
| 229 | - * @return bool Success/Failure |
|
| 229 | + * @return boolean|null Success/Failure |
|
| 230 | 230 | */ |
| 231 | 231 | function bigbluebuttonbn_delete_instance_log($bigbluebuttonbn) { |
| 232 | 232 | global $DB; |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | * @param object $mod |
| 250 | 250 | * @param object $bigbluebuttonbn |
| 251 | 251 | * |
| 252 | - * @return bool |
|
| 252 | + * @return string |
|
| 253 | 253 | */ |
| 254 | 254 | function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) { |
| 255 | 255 | global $DB; |
@@ -757,7 +757,7 @@ discard block |
||
| 757 | 757 | * @param stdClass $context context object |
| 758 | 758 | * @param string $filearea file area |
| 759 | 759 | * |
| 760 | - * @return false|null false if file not valid |
|
| 760 | + * @return boolean false if file not valid |
|
| 761 | 761 | */ |
| 762 | 762 | function bigbluebuttonbn_pluginfile_valid($context, $filearea) { |
| 763 | 763 | if ($context->contextlevel != CONTEXT_MODULE) { |
@@ -28,23 +28,23 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | global $CFG; |
| 30 | 30 | |
| 31 | -require_once($CFG->dirroot.'/calendar/lib.php'); |
|
| 32 | -require_once($CFG->dirroot.'/message/lib.php'); |
|
| 33 | -require_once($CFG->dirroot.'/mod/lti/OAuth.php'); |
|
| 34 | -require_once($CFG->dirroot.'/tag/lib.php'); |
|
| 35 | -require_once($CFG->libdir.'/accesslib.php'); |
|
| 36 | -require_once($CFG->libdir.'/completionlib.php'); |
|
| 37 | -require_once($CFG->libdir.'/datalib.php'); |
|
| 38 | -require_once($CFG->libdir.'/enrollib.php'); |
|
| 39 | -require_once($CFG->libdir.'/filelib.php'); |
|
| 40 | -require_once($CFG->libdir.'/formslib.php'); |
|
| 31 | +require_once($CFG->dirroot . '/calendar/lib.php'); |
|
| 32 | +require_once($CFG->dirroot . '/message/lib.php'); |
|
| 33 | +require_once($CFG->dirroot . '/mod/lti/OAuth.php'); |
|
| 34 | +require_once($CFG->dirroot . '/tag/lib.php'); |
|
| 35 | +require_once($CFG->libdir . '/accesslib.php'); |
|
| 36 | +require_once($CFG->libdir . '/completionlib.php'); |
|
| 37 | +require_once($CFG->libdir . '/datalib.php'); |
|
| 38 | +require_once($CFG->libdir . '/enrollib.php'); |
|
| 39 | +require_once($CFG->libdir . '/filelib.php'); |
|
| 40 | +require_once($CFG->libdir . '/formslib.php'); |
|
| 41 | 41 | |
| 42 | 42 | // JWT is included in Moodle 3.7 core, but a local package is still needed for backward compatibility. |
| 43 | 43 | if (!class_exists('\Firebase\JWT\JWT')) { |
| 44 | 44 | if (file_exists($CFG->libdir . '/php-jwt/src/JWT.php')) { |
| 45 | 45 | require_once($CFG->libdir . '/php-jwt/src/JWT.php'); |
| 46 | 46 | } else { |
| 47 | - require_once($CFG->dirroot.'/mod/bigbluebuttonbn/vendor/firebase/php-jwt/src/JWT.php'); |
|
| 47 | + require_once($CFG->dirroot . '/mod/bigbluebuttonbn/vendor/firebase/php-jwt/src/JWT.php'); |
|
| 48 | 48 | } |
| 49 | 49 | } |
| 50 | 50 | |
@@ -52,12 +52,12 @@ discard block |
||
| 52 | 52 | $CFG->bigbluebuttonbn = array(); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | -if (file_exists(dirname(__FILE__).'/config.php')) { |
|
| 56 | - require_once(dirname(__FILE__).'/config.php'); |
|
| 55 | +if (file_exists(dirname(__FILE__) . '/config.php')) { |
|
| 56 | + require_once(dirname(__FILE__) . '/config.php'); |
|
| 57 | 57 | // Old BigBlueButtonBN cfg schema. For backward compatibility. |
| 58 | 58 | global $BIGBLUEBUTTONBN_CFG; |
| 59 | 59 | if (isset($BIGBLUEBUTTONBN_CFG)) { |
| 60 | - foreach ((array) $BIGBLUEBUTTONBN_CFG as $key => $value) { |
|
| 60 | + foreach ((array)$BIGBLUEBUTTONBN_CFG as $key => $value) { |
|
| 61 | 61 | $cfgkey = str_replace("bigbluebuttonbn_", "", $key); |
| 62 | 62 | $CFG->bigbluebuttonbn[$cfgkey] = $value; |
| 63 | 63 | } |
@@ -113,18 +113,18 @@ discard block |
||
| 113 | 113 | return null; |
| 114 | 114 | } |
| 115 | 115 | $features = array( |
| 116 | - (string) FEATURE_IDNUMBER => true, |
|
| 117 | - (string) FEATURE_GROUPS => true, |
|
| 118 | - (string) FEATURE_GROUPINGS => true, |
|
| 119 | - (string) FEATURE_GROUPMEMBERSONLY => true, |
|
| 120 | - (string) FEATURE_MOD_INTRO => true, |
|
| 121 | - (string) FEATURE_BACKUP_MOODLE2 => true, |
|
| 122 | - (string) FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
| 123 | - (string) FEATURE_GRADE_HAS_GRADE => false, |
|
| 124 | - (string) FEATURE_GRADE_OUTCOMES => false, |
|
| 125 | - (string) FEATURE_SHOW_DESCRIPTION => true, |
|
| 116 | + (string)FEATURE_IDNUMBER => true, |
|
| 117 | + (string)FEATURE_GROUPS => true, |
|
| 118 | + (string)FEATURE_GROUPINGS => true, |
|
| 119 | + (string)FEATURE_GROUPMEMBERSONLY => true, |
|
| 120 | + (string)FEATURE_MOD_INTRO => true, |
|
| 121 | + (string)FEATURE_BACKUP_MOODLE2 => true, |
|
| 122 | + (string)FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
| 123 | + (string)FEATURE_GRADE_HAS_GRADE => false, |
|
| 124 | + (string)FEATURE_GRADE_OUTCOMES => false, |
|
| 125 | + (string)FEATURE_SHOW_DESCRIPTION => true, |
|
| 126 | 126 | ); |
| 127 | - if (isset($features[(string) $feature])) { |
|
| 127 | + if (isset($features[(string)$feature])) { |
|
| 128 | 128 | return $features[$feature]; |
| 129 | 129 | } |
| 130 | 130 | return null; |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | function bigbluebuttonbn_delete_instance_log($bigbluebuttonbn) { |
| 232 | 232 | global $DB; |
| 233 | 233 | $sql = "SELECT * FROM {bigbluebuttonbn_logs} "; |
| 234 | - $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND ". $DB->sql_compare_text('meta') . " = ?"; |
|
| 234 | + $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND " . $DB->sql_compare_text('meta') . " = ?"; |
|
| 235 | 235 | $logs = $DB->get_records_sql($sql, array($bigbluebuttonbn->id, BIGBLUEBUTTONBN_LOG_EVENT_CREATE, "{\"record\":true}")); |
| 236 | 236 | $meta = "{\"has_recordings\":" . empty($logs) ? "true" : "false" . "}"; |
| 237 | 237 | bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTONBN_LOG_EVENT_DELETE, [], $meta); |
@@ -254,10 +254,10 @@ discard block |
||
| 254 | 254 | function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) { |
| 255 | 255 | global $DB; |
| 256 | 256 | $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id, |
| 257 | - 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join', ), '*'); |
|
| 257 | + 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join',), '*'); |
|
| 258 | 258 | if ($completed > 0) { |
| 259 | - return fullname($user).' '.get_string('view_message_has_joined', 'bigbluebuttonbn').' '. |
|
| 260 | - get_string('view_message_session_for', 'bigbluebuttonbn').' '.(string) $completed.' '. |
|
| 259 | + return fullname($user) . ' ' . get_string('view_message_has_joined', 'bigbluebuttonbn') . ' ' . |
|
| 260 | + get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string)$completed . ' ' . |
|
| 261 | 261 | get_string('view_message_times', 'bigbluebuttonbn'); |
| 262 | 262 | } |
| 263 | 263 | return ''; |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | function bigbluebuttonbn_user_complete($course, $user, $mod, $bigbluebuttonbn) { |
| 278 | 278 | global $DB; |
| 279 | 279 | $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id, |
| 280 | - 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join', ), |
|
| 280 | + 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join',), |
|
| 281 | 281 | '*', IGNORE_MULTIPLE); |
| 282 | 282 | return $completed > 0; |
| 283 | 283 | } |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | * @return array status array |
| 437 | 437 | */ |
| 438 | 438 | function bigbluebuttonbn_reset_recordings($courseid) { |
| 439 | - require_once(__DIR__.'/locallib.php'); |
|
| 439 | + require_once(__DIR__ . '/locallib.php'); |
|
| 440 | 440 | // Criteria for search [courseid | bigbluebuttonbn=null | subset=false | includedeleted=true]. |
| 441 | 441 | $recordings = bigbluebuttonbn_get_recordings($courseid, null, false, true); |
| 442 | 442 | // Remove all the recordings. |
@@ -504,16 +504,16 @@ discard block |
||
| 504 | 504 | if ($bigbluebuttonbn->visible) { |
| 505 | 505 | $classes = 'class="dimmed" '; |
| 506 | 506 | } |
| 507 | - $str = '<div class="bigbluebuttonbn overview">'."\n"; |
|
| 508 | - $str .= ' <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; |
|
| 509 | - $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule. |
|
| 510 | - '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
| 511 | - $str .= ' </div>'."\n"; |
|
| 512 | - $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime). |
|
| 513 | - '</div>'."\n"; |
|
| 514 | - $str .= ' <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) |
|
| 515 | - .'</div>'."\n"; |
|
| 516 | - $str .= '</div>'."\n"; |
|
| 507 | + $str = '<div class="bigbluebuttonbn overview">' . "\n"; |
|
| 508 | + $str .= ' <div class="name">' . get_string('modulename', 'bigbluebuttonbn') . ': ' . "\n"; |
|
| 509 | + $str .= ' <a ' . $classes . 'href="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bigbluebuttonbn->coursemodule . |
|
| 510 | + '">' . $bigbluebuttonbn->name . '</a>' . "\n"; |
|
| 511 | + $str .= ' </div>' . "\n"; |
|
| 512 | + $str .= ' <div class="info">' . get_string($start, 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->openingtime) . |
|
| 513 | + '</div>' . "\n"; |
|
| 514 | + $str .= ' <div class="info">' . get_string('ends_at', 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->closingtime) |
|
| 515 | + .'</div>' . "\n"; |
|
| 516 | + $str .= '</div>' . "\n"; |
|
| 517 | 517 | return $str; |
| 518 | 518 | } |
| 519 | 519 | |
@@ -565,7 +565,7 @@ discard block |
||
| 565 | 565 | * @return void |
| 566 | 566 | **/ |
| 567 | 567 | function bigbluebuttonbn_process_pre_save_instance(&$bigbluebuttonbn) { |
| 568 | - require_once(__DIR__.'/locallib.php'); |
|
| 568 | + require_once(__DIR__ . '/locallib.php'); |
|
| 569 | 569 | $bigbluebuttonbn->timemodified = time(); |
| 570 | 570 | if ((integer)$bigbluebuttonbn->instance == 0) { |
| 571 | 571 | $bigbluebuttonbn->timecreated = time(); |
@@ -721,7 +721,7 @@ discard block |
||
| 721 | 721 | if (count($files) == 1) { |
| 722 | 722 | // Get the first (and only) file. |
| 723 | 723 | $file = reset($files); |
| 724 | - $filesrc = '/'.$file->get_filename(); |
|
| 724 | + $filesrc = '/' . $file->get_filename(); |
|
| 725 | 725 | } |
| 726 | 726 | return $filesrc; |
| 727 | 727 | } |
@@ -789,7 +789,7 @@ discard block |
||
| 789 | 789 | if (!$filename) { |
| 790 | 790 | return false; |
| 791 | 791 | } |
| 792 | - $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename; |
|
| 792 | + $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename; |
|
| 793 | 793 | $fs = get_file_storage(); |
| 794 | 794 | $file = $fs->get_file_by_hash(sha1($fullpath)); |
| 795 | 795 | if (!$file || $file->is_directory()) { |