@@ -165,36 +165,36 @@ |
||
165 | 165 | */ |
166 | 166 | public static function get_options() { |
167 | 167 | return array( |
168 | - 'version_major' => self::get_moodle_version_major(), |
|
169 | - 'voicebridge_editable' => self::get('voicebridge_editable'), |
|
170 | - 'importrecordings_enabled' => self::get('importrecordings_enabled'), |
|
171 | - 'importrecordings_from_deleted_enabled' => self::get('importrecordings_from_deleted_enabled'), |
|
172 | - 'waitformoderator_default' => self::get('waitformoderator_default'), |
|
173 | - 'waitformoderator_editable' => self::get('waitformoderator_editable'), |
|
174 | - 'userlimit_default' => self::get('userlimit_default'), |
|
175 | - 'userlimit_editable' => self::get('userlimit_editable'), |
|
176 | - 'preuploadpresentation_enabled' => self::get('preuploadpresentation_enabled'), |
|
177 | - 'sendnotifications_enabled' => self::get('sendnotifications_enabled'), |
|
178 | - 'recordings_enabled' => self::get('recordings_enabled'), |
|
179 | - 'recordings_html_default' => self::get('recordings_html_default'), |
|
180 | - 'recordings_html_editable' => self::get('recordings_html_editable'), |
|
181 | - 'recordings_deleted_default' => self::get('recordings_deleted_default'), |
|
182 | - 'recordings_deleted_editable' => self::get('recordings_deleted_editable'), |
|
183 | - 'recordings_imported_default' => self::get('recordings_imported_default'), |
|
184 | - 'recordings_imported_editable' => self::get('recordings_imported_editable'), |
|
185 | - 'recordings_preview_default' => self::get('recordings_preview_default'), |
|
186 | - 'recordings_preview_editable' => self::get('recordings_preview_editable'), |
|
187 | - 'recording_default' => self::get('recording_default'), |
|
188 | - 'recording_editable' => self::get('recording_editable'), |
|
189 | - 'recording_icons_enabled' => self::get('recording_icons_enabled'), |
|
190 | - 'general_warning_message' => self::get('general_warning_message'), |
|
191 | - 'general_warning_box_type' => self::get('general_warning_box_type'), |
|
192 | - 'general_warning_button_text' => self::get('general_warning_button_text'), |
|
193 | - 'general_warning_button_href' => self::get('general_warning_button_href'), |
|
194 | - 'general_warning_button_class' => self::get('general_warning_button_class'), |
|
195 | - 'clienttype_enabled' => self::get('clienttype_enabled'), |
|
196 | - 'clienttype_editable' => self::get('clienttype_editable'), |
|
197 | - 'clienttype_default' => self::get('clienttype_default'), |
|
198 | - ); |
|
168 | + 'version_major' => self::get_moodle_version_major(), |
|
169 | + 'voicebridge_editable' => self::get('voicebridge_editable'), |
|
170 | + 'importrecordings_enabled' => self::get('importrecordings_enabled'), |
|
171 | + 'importrecordings_from_deleted_enabled' => self::get('importrecordings_from_deleted_enabled'), |
|
172 | + 'waitformoderator_default' => self::get('waitformoderator_default'), |
|
173 | + 'waitformoderator_editable' => self::get('waitformoderator_editable'), |
|
174 | + 'userlimit_default' => self::get('userlimit_default'), |
|
175 | + 'userlimit_editable' => self::get('userlimit_editable'), |
|
176 | + 'preuploadpresentation_enabled' => self::get('preuploadpresentation_enabled'), |
|
177 | + 'sendnotifications_enabled' => self::get('sendnotifications_enabled'), |
|
178 | + 'recordings_enabled' => self::get('recordings_enabled'), |
|
179 | + 'recordings_html_default' => self::get('recordings_html_default'), |
|
180 | + 'recordings_html_editable' => self::get('recordings_html_editable'), |
|
181 | + 'recordings_deleted_default' => self::get('recordings_deleted_default'), |
|
182 | + 'recordings_deleted_editable' => self::get('recordings_deleted_editable'), |
|
183 | + 'recordings_imported_default' => self::get('recordings_imported_default'), |
|
184 | + 'recordings_imported_editable' => self::get('recordings_imported_editable'), |
|
185 | + 'recordings_preview_default' => self::get('recordings_preview_default'), |
|
186 | + 'recordings_preview_editable' => self::get('recordings_preview_editable'), |
|
187 | + 'recording_default' => self::get('recording_default'), |
|
188 | + 'recording_editable' => self::get('recording_editable'), |
|
189 | + 'recording_icons_enabled' => self::get('recording_icons_enabled'), |
|
190 | + 'general_warning_message' => self::get('general_warning_message'), |
|
191 | + 'general_warning_box_type' => self::get('general_warning_box_type'), |
|
192 | + 'general_warning_button_text' => self::get('general_warning_button_text'), |
|
193 | + 'general_warning_button_href' => self::get('general_warning_button_href'), |
|
194 | + 'general_warning_button_class' => self::get('general_warning_button_class'), |
|
195 | + 'clienttype_enabled' => self::get('clienttype_enabled'), |
|
196 | + 'clienttype_editable' => self::get('clienttype_editable'), |
|
197 | + 'clienttype_default' => self::get('clienttype_default'), |
|
198 | + ); |
|
199 | 199 | } |
200 | 200 | } |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public static function defaultvalues() { |
57 | 57 | return array( |
58 | - 'server_url' => (string) BIGBLUEBUTTONBN_DEFAULT_SERVER_URL, |
|
59 | - 'shared_secret' => (string) BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET, |
|
58 | + 'server_url' => (string)BIGBLUEBUTTONBN_DEFAULT_SERVER_URL, |
|
59 | + 'shared_secret' => (string)BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET, |
|
60 | 60 | 'voicebridge_editable' => false, |
61 | 61 | 'importrecordings_enabled' => false, |
62 | 62 | 'importrecordings_from_deleted_enabled' => false, |
@@ -124,8 +124,8 @@ discard block |
||
124 | 124 | if (isset($CFG->bigbluebuttonbn[$setting])) { |
125 | 125 | return (string)$CFG->bigbluebuttonbn[$setting]; |
126 | 126 | } |
127 | - if (isset($CFG->{'bigbluebuttonbn_'.$setting})) { |
|
128 | - return (string)$CFG->{'bigbluebuttonbn_'.$setting}; |
|
127 | + if (isset($CFG->{'bigbluebuttonbn_' . $setting})) { |
|
128 | + return (string)$CFG->{'bigbluebuttonbn_' . $setting}; |
|
129 | 129 | } |
130 | 130 | return self::defaultvalue($setting); |
131 | 131 | } |
@@ -61,94 +61,94 @@ |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | switch (strtolower($action)) { |
64 | - case 'logout': |
|
65 | - if (isset($errors) && $errors != '') { |
|
66 | - bigbluebutton_bbb_view_errors($errors, $id); |
|
67 | - break; |
|
68 | - } |
|
69 | - if (is_null($bbbsession)) { |
|
70 | - bigbluebutton_bbb_view_close_window_manually(); |
|
71 | - break; |
|
72 | - } |
|
73 | - // Moodle event logger: Create an event for meeting left. |
|
74 | - bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['meeting_left'], $bigbluebuttonbn); |
|
75 | - // Update the cache. |
|
76 | - $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_UPDATE_CACHE); |
|
77 | - // Close the tab or window where BBB was opened. |
|
78 | - bigbluebutton_bbb_view_close_window(); |
|
79 | - break; |
|
80 | - case 'join': |
|
81 | - if (is_null($bbbsession)) { |
|
82 | - print_error('view_error_unable_join', 'bigbluebuttonbn'); |
|
83 | - break; |
|
84 | - } |
|
85 | - // See if the session is in progress. |
|
86 | - if (bigbluebuttonbn_is_meeting_running($bbbsession['meetingid'])) { |
|
87 | - // Since the meeting is already running, we just join the session. |
|
88 | - bigbluebutton_bbb_view_join_meeting($bbbsession, $bigbluebuttonbn); |
|
89 | - break; |
|
90 | - } |
|
91 | - // If user is not administrator nor moderator (user is steudent) and waiting is required. |
|
92 | - if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) { |
|
93 | - header('Location: '.$bbbsession['logoutURL']); |
|
64 | + case 'logout': |
|
65 | + if (isset($errors) && $errors != '') { |
|
66 | + bigbluebutton_bbb_view_errors($errors, $id); |
|
67 | + break; |
|
68 | + } |
|
69 | + if (is_null($bbbsession)) { |
|
70 | + bigbluebutton_bbb_view_close_window_manually(); |
|
71 | + break; |
|
72 | + } |
|
73 | + // Moodle event logger: Create an event for meeting left. |
|
74 | + bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['meeting_left'], $bigbluebuttonbn); |
|
75 | + // Update the cache. |
|
76 | + $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_UPDATE_CACHE); |
|
77 | + // Close the tab or window where BBB was opened. |
|
78 | + bigbluebutton_bbb_view_close_window(); |
|
94 | 79 | break; |
95 | - } |
|
96 | - // As the meeting doesn't exist, try to create it. |
|
97 | - $response = bigbluebuttonbn_get_create_meeting_array( |
|
98 | - bigbluebutton_bbb_view_create_meeting_data($bbbsession), |
|
99 | - bigbluebutton_bbb_view_create_meeting_metadata($bbbsession), |
|
100 | - $bbbsession['presentation']['name'], |
|
101 | - $bbbsession['presentation']['url'] |
|
102 | - ); |
|
103 | - if (empty($response)) { |
|
104 | - // The server is unreachable. |
|
105 | - if ($bbbsession['administrator']) { |
|
106 | - print_error('view_error_unable_join', 'bigbluebuttonbn', |
|
107 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
80 | + case 'join': |
|
81 | + if (is_null($bbbsession)) { |
|
82 | + print_error('view_error_unable_join', 'bigbluebuttonbn'); |
|
83 | + break; |
|
84 | + } |
|
85 | + // See if the session is in progress. |
|
86 | + if (bigbluebuttonbn_is_meeting_running($bbbsession['meetingid'])) { |
|
87 | + // Since the meeting is already running, we just join the session. |
|
88 | + bigbluebutton_bbb_view_join_meeting($bbbsession, $bigbluebuttonbn); |
|
108 | 89 | break; |
109 | 90 | } |
110 | - if ($bbbsession['moderator']) { |
|
111 | - print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', |
|
91 | + // If user is not administrator nor moderator (user is steudent) and waiting is required. |
|
92 | + if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) { |
|
93 | + header('Location: '.$bbbsession['logoutURL']); |
|
94 | + break; |
|
95 | + } |
|
96 | + // As the meeting doesn't exist, try to create it. |
|
97 | + $response = bigbluebuttonbn_get_create_meeting_array( |
|
98 | + bigbluebutton_bbb_view_create_meeting_data($bbbsession), |
|
99 | + bigbluebutton_bbb_view_create_meeting_metadata($bbbsession), |
|
100 | + $bbbsession['presentation']['name'], |
|
101 | + $bbbsession['presentation']['url'] |
|
102 | + ); |
|
103 | + if (empty($response)) { |
|
104 | + // The server is unreachable. |
|
105 | + if ($bbbsession['administrator']) { |
|
106 | + print_error('view_error_unable_join', 'bigbluebuttonbn', |
|
107 | + $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
108 | + break; |
|
109 | + } |
|
110 | + if ($bbbsession['moderator']) { |
|
111 | + print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', |
|
112 | + $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
113 | + break; |
|
114 | + } |
|
115 | + print_error('view_error_unable_join_student', 'bigbluebuttonbn', |
|
112 | 116 | $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
113 | 117 | break; |
114 | 118 | } |
115 | - print_error('view_error_unable_join_student', 'bigbluebuttonbn', |
|
116 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
117 | - break; |
|
118 | - } |
|
119 | - if ($response['returncode'] == 'FAILED') { |
|
120 | - // The meeting was not created. |
|
121 | - if (!$printerrorkey) { |
|
122 | - print_error($response['message'], 'bigbluebuttonbn'); |
|
119 | + if ($response['returncode'] == 'FAILED') { |
|
120 | + // The meeting was not created. |
|
121 | + if (!$printerrorkey) { |
|
122 | + print_error($response['message'], 'bigbluebuttonbn'); |
|
123 | + break; |
|
124 | + } |
|
125 | + $printerrorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create'); |
|
126 | + print_error($printerrorkey, 'bigbluebuttonbn'); |
|
127 | + break; |
|
128 | + } |
|
129 | + if ($response['hasBeenForciblyEnded'] == 'true') { |
|
130 | + print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn')); |
|
123 | 131 | break; |
124 | 132 | } |
125 | - $printerrorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create'); |
|
126 | - print_error($printerrorkey, 'bigbluebuttonbn'); |
|
133 | + // Moodle event logger: Create an event for meeting created. |
|
134 | + bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['meeting_create'], $bigbluebuttonbn); |
|
135 | + // Internal logger: Insert a record with the meeting created. |
|
136 | + $overrides = array('meetingid' => $bbbsession['meetingid']); |
|
137 | + $meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}'; |
|
138 | + bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_CREATE, $overrides, $meta); |
|
139 | + // Since the meeting is already running, we just join the session. |
|
140 | + bigbluebutton_bbb_view_join_meeting($bbbsession, $bigbluebuttonbn); |
|
127 | 141 | break; |
128 | - } |
|
129 | - if ($response['hasBeenForciblyEnded'] == 'true') { |
|
130 | - print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn')); |
|
142 | + case 'play': |
|
143 | + $href = bigbluebutton_bbb_view_playback_href($href, $mid, $rid, $rtype); |
|
144 | + // Moodle event logger: Create an event for meeting left. |
|
145 | + bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['recording_play'], $bigbluebuttonbn, |
|
146 | + ['other' => $rid]); |
|
147 | + // Execute the redirect. |
|
148 | + header('Location: '.urldecode($href)); |
|
131 | 149 | break; |
132 | - } |
|
133 | - // Moodle event logger: Create an event for meeting created. |
|
134 | - bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['meeting_create'], $bigbluebuttonbn); |
|
135 | - // Internal logger: Insert a record with the meeting created. |
|
136 | - $overrides = array('meetingid' => $bbbsession['meetingid']); |
|
137 | - $meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}'; |
|
138 | - bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_CREATE, $overrides, $meta); |
|
139 | - // Since the meeting is already running, we just join the session. |
|
140 | - bigbluebutton_bbb_view_join_meeting($bbbsession, $bigbluebuttonbn); |
|
141 | - break; |
|
142 | - case 'play': |
|
143 | - $href = bigbluebutton_bbb_view_playback_href($href, $mid, $rid, $rtype); |
|
144 | - // Moodle event logger: Create an event for meeting left. |
|
145 | - bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['recording_play'], $bigbluebuttonbn, |
|
146 | - ['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); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | } |
91 | 91 | // If user is not administrator nor moderator (user is steudent) and waiting is required. |
92 | 92 | if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) { |
93 | - header('Location: '.$bbbsession['logoutURL']); |
|
93 | + header('Location: ' . $bbbsession['logoutURL']); |
|
94 | 94 | break; |
95 | 95 | } |
96 | 96 | // As the meeting doesn't exist, try to create it. |
@@ -104,16 +104,16 @@ discard block |
||
104 | 104 | // The server is unreachable. |
105 | 105 | if ($bbbsession['administrator']) { |
106 | 106 | print_error('view_error_unable_join', 'bigbluebuttonbn', |
107 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
107 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
108 | 108 | break; |
109 | 109 | } |
110 | 110 | if ($bbbsession['moderator']) { |
111 | 111 | print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', |
112 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
112 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
113 | 113 | break; |
114 | 114 | } |
115 | 115 | print_error('view_error_unable_join_student', 'bigbluebuttonbn', |
116 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
116 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
117 | 117 | break; |
118 | 118 | } |
119 | 119 | if ($response['returncode'] == 'FAILED') { |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['meeting_create'], $bigbluebuttonbn); |
135 | 135 | // Internal logger: Insert a record with the meeting created. |
136 | 136 | $overrides = array('meetingid' => $bbbsession['meetingid']); |
137 | - $meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}'; |
|
137 | + $meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}'; |
|
138 | 138 | bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_CREATE, $overrides, $meta); |
139 | 139 | // Since the meeting is already running, we just join the session. |
140 | 140 | bigbluebutton_bbb_view_join_meeting($bbbsession, $bigbluebuttonbn); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['recording_play'], $bigbluebuttonbn, |
146 | 146 | ['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 | } |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_UPDATE_CACHE); |
318 | 318 | if ($bbbsession['userlimit'] > 0 && intval($meetinginfo['participantCount']) >= $bbbsession['userlimit']) { |
319 | 319 | // No more users allowed to join. |
320 | - header('Location: '.$bbbsession['logoutURL']); |
|
320 | + header('Location: ' . $bbbsession['logoutURL']); |
|
321 | 321 | return; |
322 | 322 | } |
323 | 323 | // Build the URL. |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | bigbluebuttonbn_participant_joined($bbbsession['meetingid'], |
337 | 337 | ($bbbsession['administrator'] || $bbbsession['moderator'])); |
338 | 338 | // Execute the redirect. |
339 | - header('Location: '.$joinurl); |
|
339 | + header('Location: ' . $joinurl); |
|
340 | 340 | } |
341 | 341 | |
342 | 342 | /** |
@@ -348,13 +348,13 @@ discard block |
||
348 | 348 | */ |
349 | 349 | function bigbluebutton_bbb_view_errors($serrors, $id) { |
350 | 350 | global $CFG, $OUTPUT; |
351 | - $errors = (array) json_decode(urldecode($serrors)); |
|
351 | + $errors = (array)json_decode(urldecode($serrors)); |
|
352 | 352 | $msgerrors = ''; |
353 | 353 | foreach ($errors as $error) { |
354 | - $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger'))."\n"; |
|
354 | + $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger')) . "\n"; |
|
355 | 355 | } |
356 | 356 | echo $OUTPUT->header(); |
357 | 357 | print_error('view_error_bigbluebutton', 'bigbluebuttonbn', |
358 | - $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$id, $msgerrors, $serrors); |
|
358 | + $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $id, $msgerrors, $serrors); |
|
359 | 359 | echo $OUTPUT->footer(); |
360 | 360 | } |
@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | * @author Fred Dixon (ffdixon [at] blindsidenetworks [dt] com) |
25 | 25 | */ |
26 | 26 | |
27 | -require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); |
|
28 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
27 | +require_once(dirname(dirname(dirname(__FILE__))) . '/config.php'); |
|
28 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
29 | 29 | |
30 | 30 | $id = required_param('id', PARAM_INT); |
31 | 31 | $bn = optional_param('bn', 0, PARAM_INT); |
@@ -57,19 +57,19 @@ discard block |
||
57 | 57 | if (is_null($serverversion)) { |
58 | 58 | if ($bbbsession['administrator']) { |
59 | 59 | print_error('view_error_unable_join', 'bigbluebuttonbn', |
60 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
60 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
61 | 61 | exit; |
62 | 62 | } |
63 | 63 | if ($bbbsession['moderator']) { |
64 | 64 | print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', |
65 | - $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course); |
|
65 | + $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course); |
|
66 | 66 | exit; |
67 | 67 | } |
68 | 68 | print_error('view_error_unable_join_student', 'bigbluebuttonbn', |
69 | - $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course); |
|
69 | + $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course); |
|
70 | 70 | exit; |
71 | 71 | } |
72 | -$bbbsession['serverversion'] = (string) $serverversion; |
|
72 | +$bbbsession['serverversion'] = (string)$serverversion; |
|
73 | 73 | |
74 | 74 | // Mark viewed by user (if required). |
75 | 75 | $completion = new completion_info($course); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | // Print the page header. |
79 | 79 | $PAGE->set_context($context); |
80 | -$PAGE->set_url($CFG->wwwroot.'/mod/bigbluebuttonbn/view.php', array('id' => $cm->id)); |
|
80 | +$PAGE->set_url($CFG->wwwroot . '/mod/bigbluebuttonbn/view.php', array('id' => $cm->id)); |
|
81 | 81 | $PAGE->set_title(format_string($bigbluebuttonbn->name)); |
82 | 82 | $PAGE->set_cacheable(false); |
83 | 83 | $PAGE->set_heading($course->fullname); |
@@ -87,11 +87,11 @@ discard block |
||
87 | 87 | if (!has_capability('moodle/category:manage', $context) && !has_capability('mod/bigbluebuttonbn:join', $context)) { |
88 | 88 | echo $OUTPUT->header(); |
89 | 89 | if (isguestuser()) { |
90 | - echo $OUTPUT->confirm('<p>'.get_string('view_noguests', 'bigbluebuttonbn').'</p>'.get_string('liketologin'), |
|
91 | - get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id); |
|
90 | + echo $OUTPUT->confirm('<p>' . get_string('view_noguests', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'), |
|
91 | + get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id); |
|
92 | 92 | } else { |
93 | - echo $OUTPUT->confirm('<p>'.get_string('view_nojoin', 'bigbluebuttonbn').'</p>'.get_string('liketologin'), |
|
94 | - get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id); |
|
93 | + echo $OUTPUT->confirm('<p>' . get_string('view_nojoin', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'), |
|
94 | + get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id); |
|
95 | 95 | } |
96 | 96 | echo $OUTPUT->footer(); |
97 | 97 | exit; |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | |
100 | 100 | // Operation URLs. |
101 | 101 | $bbbsession['bigbluebuttonbnURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id; |
102 | -$bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id='.$id . |
|
102 | +$bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id=' . $id . |
|
103 | 103 | '&bn=' . $bbbsession['bigbluebuttonbn']->id; |
104 | 104 | $bbbsession['recordingReadyURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_broker.php?action=recording_' . |
105 | 105 | 'ready&bigbluebuttonbn=' . $bbbsession['bigbluebuttonbn']->id; |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | echo $OUTPUT->footer(); |
120 | 120 | |
121 | 121 | // Shows version as a comment. |
122 | -echo '<!-- '.$bbbsession['originTag'].' -->'."\n"; |
|
122 | +echo '<!-- ' . $bbbsession['originTag'] . ' -->' . "\n"; |
|
123 | 123 | |
124 | 124 | // Initialize session variable used across views. |
125 | 125 | $SESSION->bigbluebuttonbn_bbbsession = $bbbsession; |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | $bbbsession['modPW'] = $bbbsession['bigbluebuttonbn']->moderatorpass; |
148 | 148 | $bbbsession['viewerPW'] = $bbbsession['bigbluebuttonbn']->viewerpass; |
149 | 149 | // Database info related to the activity. |
150 | - $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'. |
|
150 | + $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' . |
|
151 | 151 | $bbbsession['bigbluebuttonbn']->id; |
152 | 152 | $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name; |
153 | 153 | $bbbsession['meetingdescription'] = $bbbsession['bigbluebuttonbn']->intro; |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $bbbsession['welcome'] = get_string('mod_form_field_welcome_default', 'bigbluebuttonbn'); |
168 | 168 | } |
169 | 169 | if ($bbbsession['bigbluebuttonbn']->record) { |
170 | - $bbbsession['welcome'] .= '<br><br>'.get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
|
170 | + $bbbsession['welcome'] .= '<br><br>' . get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
|
171 | 171 | } |
172 | 172 | $bbbsession['openingtime'] = $bbbsession['bigbluebuttonbn']->openingtime; |
173 | 173 | $bbbsession['closingtime'] = $bbbsession['bigbluebuttonbn']->closingtime; |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | $bbbsession['originServerName'] = $parsedurl['host']; |
181 | 181 | $bbbsession['originServerUrl'] = $CFG->wwwroot; |
182 | 182 | $bbbsession['originServerCommonName'] = ''; |
183 | - $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn ('.get_config('mod_bigbluebuttonbn', 'version').')'; |
|
183 | + $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn (' . get_config('mod_bigbluebuttonbn', 'version') . ')'; |
|
184 | 184 | $bbbsession['bnserver'] = bigbluebuttonbn_is_bn_server(); |
185 | 185 | // Setting for clienttype, assign flash if not enabled, or default if not editable. |
186 | 186 | $bbbsession['clienttype'] = \mod_bigbluebuttonbn\locallib\config::get('clienttype_default'); |
@@ -243,8 +243,8 @@ discard block |
||
243 | 243 | $groupname = groups_get_group_name($bbbsession['group']); |
244 | 244 | } |
245 | 245 | // Assign group default values. |
246 | - $bbbsession['meetingid'] .= '['.$bbbsession['group'].']'; |
|
247 | - $bbbsession['meetingname'] .= ' ('.$groupname.')'; |
|
246 | + $bbbsession['meetingid'] .= '[' . $bbbsession['group'] . ']'; |
|
247 | + $bbbsession['meetingname'] .= ' (' . $groupname . ')'; |
|
248 | 248 | if (count($groups) == 0) { |
249 | 249 | // Only the All participants group exists. |
250 | 250 | bigbluebuttonbn_view_message_box($bbbsession, get_string('view_groups_notenrolled_warning', 'bigbluebuttonbn'), 'info'); |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | if (has_capability('moodle/site:accessallgroups', $context)) { |
255 | 255 | bigbluebuttonbn_view_message_box($bbbsession, get_string('view_groups_selection_warning', 'bigbluebuttonbn')); |
256 | 256 | } |
257 | - $urltoroot = $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bbbsession['cm']->id; |
|
257 | + $urltoroot = $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id; |
|
258 | 258 | groups_print_activity_menu($bbbsession['cm'], $urltoroot); |
259 | 259 | echo '<br><br>'; |
260 | 260 | } |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | $recordingsdisabled = get_string('view_message_recordings_disabled', 'bigbluebuttonbn'); |
322 | 322 | $output .= bigbluebuttonbn_render_warning($recordingsdisabled, 'danger'); |
323 | 323 | } |
324 | - echo $output.html_writer::empty_tag('br').html_writer::empty_tag('br').html_writer::empty_tag('br'); |
|
324 | + echo $output . html_writer::empty_tag('br') . html_writer::empty_tag('br') . html_writer::empty_tag('br'); |
|
325 | 325 | $PAGE->requires->yui_module('moodle-mod_bigbluebuttonbn-broker', 'M.mod_bigbluebuttonbn.broker.init', array($jsvars)); |
326 | 326 | } |
327 | 327 | |
@@ -390,12 +390,12 @@ discard block |
||
390 | 390 | // JavaScript variables for room. |
391 | 391 | $openingtime = ''; |
392 | 392 | if ($bbbsession['openingtime']) { |
393 | - $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn').': '. |
|
393 | + $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn') . ': ' . |
|
394 | 394 | userdate($bbbsession['openingtime']); |
395 | 395 | } |
396 | 396 | $closingtime = ''; |
397 | 397 | if ($bbbsession['closingtime']) { |
398 | - $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn').': '. |
|
398 | + $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn') . ': ' . |
|
399 | 399 | userdate($bbbsession['closingtime']); |
400 | 400 | } |
401 | 401 | $jsvars += array( |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | $output .= $OUTPUT->box_end(); |
413 | 413 | // Action button box. |
414 | 414 | $output .= $OUTPUT->box_start('generalbox boxaligncenter', 'bigbluebuttonbn_view_action_button_box'); |
415 | - $output .= '<br><br><span id="join_button"></span> <span id="end_button"></span>'."\n"; |
|
415 | + $output .= '<br><br><span id="join_button"></span> <span id="end_button"></span>' . "\n"; |
|
416 | 416 | $output .= $OUTPUT->box_end(); |
417 | 417 | if ($activity == 'ended') { |
418 | 418 | $output .= bigbluebuttonbn_view_ended($bbbsession); |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | // If there are meetings with recordings load the data to the table. |
466 | 466 | if ($bbbsession['bigbluebuttonbn']->recordings_html) { |
467 | 467 | // Render a plain html table. |
468 | - return bigbluebuttonbn_output_recording_table($bbbsession, $recordings)."\n"; |
|
468 | + return bigbluebuttonbn_output_recording_table($bbbsession, $recordings) . "\n"; |
|
469 | 469 | } |
470 | 470 | // JavaScript variables for recordings with YUI. |
471 | 471 | $jsvars += array( |
@@ -493,8 +493,8 @@ discard block |
||
493 | 493 | array('type' => 'button', |
494 | 494 | 'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'), |
495 | 495 | 'class' => 'btn btn-secondary', |
496 | - 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='. |
|
497 | - $bbbsession['bigbluebuttonbn']->id.'\'')); |
|
496 | + 'onclick' => 'window.location=\'' . $CFG->wwwroot . '/mod/bigbluebuttonbn/import_view.php?bn=' . |
|
497 | + $bbbsession['bigbluebuttonbn']->id . '\'')); |
|
498 | 498 | $output = html_writer::empty_tag('br'); |
499 | 499 | $output .= html_writer::tag('span', $button, array('id' => 'import_recording_links_button')); |
500 | 500 | $output .= html_writer::tag('span', '', array('id' => 'import_recording_links_table')); |
@@ -513,10 +513,10 @@ discard block |
||
513 | 513 | if (!is_null($bbbsession['presentation']['url'])) { |
514 | 514 | $attributes = array('title' => $bbbsession['presentation']['name']); |
515 | 515 | $icon = new pix_icon($bbbsession['presentation']['icon'], $bbbsession['presentation']['mimetype_description']); |
516 | - return '<h4>'.get_string('view_section_title_presentation', 'bigbluebuttonbn').'</h4>'. |
|
517 | - $OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false). |
|
516 | + return '<h4>' . get_string('view_section_title_presentation', 'bigbluebuttonbn') . '</h4>' . |
|
517 | + $OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false) . |
|
518 | 518 | $OUTPUT->action_link($bbbsession['presentation']['url'], |
519 | - $bbbsession['presentation']['name'], null, $attributes).'<br><br>'; |
|
519 | + $bbbsession['presentation']['name'], null, $attributes) . '<br><br>'; |
|
520 | 520 | } |
521 | 521 | return ''; |
522 | 522 | } |
@@ -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 | use \Firebase\JWT\JWT; |
30 | 30 | |
@@ -42,13 +42,13 @@ discard block |
||
42 | 42 | require_login(0, false); |
43 | 43 | |
44 | 44 | if (empty($params['action'])) { |
45 | - header('HTTP/1.0 400 Bad Request. Parameter ['.$params['action'].'] was not included'); |
|
45 | + header('HTTP/1.0 400 Bad Request. Parameter [' . $params['action'] . '] was not included'); |
|
46 | 46 | return; |
47 | 47 | } |
48 | 48 | |
49 | 49 | $error = bigbluebuttonbn_broker_validate_parameters($params); |
50 | 50 | if (!empty($error)) { |
51 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
51 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
52 | 52 | return; |
53 | 53 | } |
54 | 54 | |
@@ -132,11 +132,11 @@ discard block |
||
132 | 132 | bigbluebuttonbn_broker_live_session_events($params, $bigbluebuttonbn); |
133 | 133 | return; |
134 | 134 | } |
135 | - header('HTTP/1.0 400 Bad request. The action '. $a . ' doesn\'t exist'); |
|
135 | + header('HTTP/1.0 400 Bad request. The action ' . $a . ' doesn\'t exist'); |
|
136 | 136 | return; |
137 | 137 | |
138 | 138 | } catch (Exception $e) { |
139 | - header('HTTP/1.0 500 Internal Server Error. '.$e->getMessage()); |
|
139 | + header('HTTP/1.0 500 Internal Server Error. ' . $e->getMessage()); |
|
140 | 140 | return; |
141 | 141 | } |
142 | 142 | |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | function bigbluebuttonbn_broker_recording_info_current($recording, $params) { |
322 | 322 | $callbackresponse['status'] = true; |
323 | 323 | $callbackresponse['found'] = true; |
324 | - $callbackresponse['published'] = (string) $recording['published']; |
|
324 | + $callbackresponse['published'] = (string)$recording['published']; |
|
325 | 325 | if (!isset($params['meta']) || empty($params['meta'])) { |
326 | 326 | return $callbackresponse; |
327 | 327 | } |
@@ -648,8 +648,8 @@ discard block |
||
648 | 648 | $decodedparameters = JWT::decode($params['signed_parameters'], |
649 | 649 | \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256')); |
650 | 650 | } catch (Exception $e) { |
651 | - $error = 'Caught exception: '.$e->getMessage(); |
|
652 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
651 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
652 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
653 | 653 | return; |
654 | 654 | } |
655 | 655 | // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received. |
@@ -674,12 +674,12 @@ discard block |
||
674 | 674 | bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn); |
675 | 675 | } |
676 | 676 | $overrides = array('meetingid' => $decodedparameters->meeting_id); |
677 | - $meta = '{"recordid":'.$decodedparameters->record_id.'}'; |
|
677 | + $meta = '{"recordid":' . $decodedparameters->record_id . '}'; |
|
678 | 678 | bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTON_LOG_EVENT_CALLBACK, $overrides, $meta); |
679 | 679 | header('HTTP/1.0 202 Accepted'); |
680 | 680 | } catch (Exception $e) { |
681 | - $error = 'Caught exception: '.$e->getMessage(); |
|
682 | - header('HTTP/1.0 503 Service Unavailable. '.$error); |
|
681 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
682 | + header('HTTP/1.0 503 Service Unavailable. ' . $error); |
|
683 | 683 | } |
684 | 684 | } |
685 | 685 | |
@@ -700,13 +700,13 @@ discard block |
||
700 | 700 | $importrecordings = $SESSION->bigbluebuttonbn_importrecordings; |
701 | 701 | if (!isset($importrecordings[$params['id']])) { |
702 | 702 | $error = "Recording {$params['id']} could not be found. It can not be imported"; |
703 | - header('HTTP/1.0 404 Not found. '.$error); |
|
703 | + header('HTTP/1.0 404 Not found. ' . $error); |
|
704 | 704 | return; |
705 | 705 | } |
706 | 706 | $callbackresponse = array('status' => true); |
707 | 707 | $importrecordings[$params['id']]['imported'] = true; |
708 | 708 | $overrides = array('meetingid' => $importrecordings[$params['id']]['meetingID']); |
709 | - $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}'; |
|
709 | + $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}'; |
|
710 | 710 | bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta); |
711 | 711 | // Moodle event logger: Create an event for recording imported. |
712 | 712 | if (isset($bbbsession['bigbluebutton']) && isset($bbbsession['cm'])) { |
@@ -731,8 +731,8 @@ discard block |
||
731 | 731 | $decodedparameters = JWT::decode($params['signed_parameters'], |
732 | 732 | \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256')); |
733 | 733 | } catch (Exception $e) { |
734 | - $error = 'Caught exception: '.$e->getMessage(); |
|
735 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
734 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
735 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
736 | 736 | return; |
737 | 737 | } |
738 | 738 | // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received. |
@@ -773,7 +773,7 @@ discard block |
||
773 | 773 | } |
774 | 774 | $action = strtolower($params['action']); |
775 | 775 | if (!array_key_exists($action, $requiredparams)) { |
776 | - return 'Action '.$params['action'].' can not be performed.'; |
|
776 | + return 'Action ' . $params['action'] . ' can not be performed.'; |
|
777 | 777 | } |
778 | 778 | return bigbluebuttonbn_broker_validate_parameters_message($params, $requiredparams[$action]); |
779 | 779 | } |
@@ -209,8 +209,8 @@ discard block |
||
209 | 209 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
210 | 210 | $field['description_key'], 0, ['maxlength' => 4, 'size' => 6], |
211 | 211 | ['message' => get_string('mod_form_field_voicebridge_format_error', 'bigbluebuttonbn'), |
212 | - 'type' => 'numeric', 'rule' => '####', 'validator' => 'server'] |
|
213 | - ); |
|
212 | + 'type' => 'numeric', 'rule' => '####', 'validator' => 'server'] |
|
213 | + ); |
|
214 | 214 | } else { |
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]); |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | */ |
249 | 249 | private function bigbluebuttonbn_mform_add_block_room_recordings(&$mform, $cfg) { |
250 | 250 | $field = ['type' => 'hidden', 'name' => 'recordings_html', 'data_type' => PARAM_INT, |
251 | - 'description_key' => null]; |
|
251 | + 'description_key' => null]; |
|
252 | 252 | if ($cfg['recordings_html_editable']) { |
253 | 253 | $field['type'] = 'checkbox'; |
254 | 254 | $field['description_key'] = 'mod_form_field_recordings_html'; |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
257 | 257 | $field['description_key'], $cfg['recordings_html_default']); |
258 | 258 | $field = ['type' => 'hidden', 'name' => 'recordings_deleted', 'data_type' => PARAM_INT, |
259 | - 'description_key' => null]; |
|
259 | + 'description_key' => null]; |
|
260 | 260 | if ($cfg['recordings_deleted_editable']) { |
261 | 261 | $field['type'] = 'checkbox'; |
262 | 262 | $field['description_key'] = 'mod_form_field_recordings_deleted'; |
@@ -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_deleted_default']); |
266 | 266 | $field = ['type' => 'hidden', 'name' => 'recordings_imported', 'data_type' => PARAM_INT, |
267 | - 'description_key' => null]; |
|
267 | + 'description_key' => null]; |
|
268 | 268 | if ($cfg['importrecordings_enabled'] && $cfg['recordings_imported_editable']) { |
269 | 269 | $field['type'] = 'checkbox'; |
270 | 270 | $field['description_key'] = 'mod_form_field_recordings_imported'; |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
273 | 273 | $field['description_key'], $cfg['recordings_imported_default']); |
274 | 274 | $field = ['type' => 'hidden', 'name' => 'recordings_preview', 'data_type' => PARAM_INT, |
275 | - 'description_key' => null]; |
|
275 | + 'description_key' => null]; |
|
276 | 276 | if ($cfg['recordings_preview_editable']) { |
277 | 277 | $field['type'] = 'checkbox'; |
278 | 278 | $field['description_key'] = 'mod_form_field_recordings_preview'; |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | $htmlselectiontype = html_writer::select($participantselection['type_options'], |
343 | 343 | 'bigbluebuttonbn_participant_selection_type', $participantselection['type_selected'], array(), |
344 | 344 | array('id' => 'bigbluebuttonbn_participant_selection_type', |
345 | - 'onchange' => 'M.mod_bigbluebuttonbn.modform.participantSelectionSet(); return 0;')); |
|
345 | + 'onchange' => 'M.mod_bigbluebuttonbn.modform.participantSelectionSet(); return 0;')); |
|
346 | 346 | $htmlselectionoptions = html_writer::select($participantselection['options'], 'bigbluebuttonbn_participant_selection', |
347 | 347 | $participantselection['selected'], array(), |
348 | 348 | array('id' => 'bigbluebuttonbn_participant_selection', 'disabled' => 'disabled')); |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | 'type' => 'button', 'class' => 'btn btn-secondary', |
351 | 351 | 'value' => get_string('mod_form_field_participant_list_action_add', 'bigbluebuttonbn'), |
352 | 352 | 'onclick' => 'M.mod_bigbluebuttonbn.modform.participantAdd(); return 0;' |
353 | - )); |
|
353 | + )); |
|
354 | 354 | $htmladdparticipant = html_writer::tag('div', |
355 | 355 | $htmlselectiontype . ' ' . $htmlselectionoptions . ' ' . $htmlselectioninput, null); |
356 | 356 | $mform->addElement('html', "\n\n"); |
@@ -392,9 +392,9 @@ discard block |
||
392 | 392 | $field['type'] = 'select'; |
393 | 393 | $field['data_type'] = PARAM_TEXT; |
394 | 394 | $field['description_key'] = 'mod_form_field_block_clienttype'; |
395 | - $choices = array(BIGBLUEBUTTON_CLIENTTYPE_FLASH => get_string('mod_form_block_clienttype_flash', 'bigbluebuttonbn'), |
|
396 | - BIGBLUEBUTTON_CLIENTTYPE_HTML5 => get_string('mod_form_block_clienttype_html5', 'bigbluebuttonbn')); |
|
397 | - $mform->addElement('header', 'clienttypeselection', get_string('mod_form_block_clienttype', 'bigbluebuttonbn')); |
|
395 | + $choices = array(BIGBLUEBUTTON_CLIENTTYPE_FLASH => get_string('mod_form_block_clienttype_flash', 'bigbluebuttonbn'), |
|
396 | + BIGBLUEBUTTON_CLIENTTYPE_HTML5 => get_string('mod_form_block_clienttype_html5', 'bigbluebuttonbn')); |
|
397 | + $mform->addElement('header', 'clienttypeselection', get_string('mod_form_block_clienttype', 'bigbluebuttonbn')); |
|
398 | 398 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
399 | 399 | $field['description_key'], $cfg['clienttype_default'], $choices); |
400 | 400 | return; |
@@ -95,9 +95,9 @@ discard block |
||
95 | 95 | function bigbluebuttonbn_get_join_url($meetingid, $username, $pw, $logouturl, $configtoken = null, |
96 | 96 | $userid = null, $clienttype = BIGBLUEBUTTON_CLIENTTYPE_FLASH) { |
97 | 97 | $data = ['meetingID' => $meetingid, |
98 | - 'fullName' => $username, |
|
99 | - 'password' => $pw, |
|
100 | - 'logoutURL' => $logouturl, |
|
98 | + 'fullName' => $username, |
|
99 | + 'password' => $pw, |
|
100 | + 'logoutURL' => $logouturl, |
|
101 | 101 | ]; |
102 | 102 | // Choose between Adobe Flash or HTML5 Client. |
103 | 103 | if ( $clienttype == BIGBLUEBUTTON_CLIENTTYPE_HTML5 ) { |
@@ -153,23 +153,23 @@ discard block |
||
153 | 153 | function bigbluebuttonbn_get_meeting_info_array($meetingid) { |
154 | 154 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
155 | 155 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
156 | - ); |
|
156 | + ); |
|
157 | 157 | if ($xml && $xml->returncode == 'SUCCESS' && empty($xml->messageKey)) { |
158 | 158 | // Meeting info was returned. |
159 | 159 | return array('returncode' => $xml->returncode, |
160 | - 'meetingID' => $xml->meetingID, |
|
161 | - 'moderatorPW' => $xml->moderatorPW, |
|
162 | - 'attendeePW' => $xml->attendeePW, |
|
163 | - 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded, |
|
164 | - 'running' => $xml->running, |
|
165 | - 'recording' => $xml->recording, |
|
166 | - 'startTime' => $xml->startTime, |
|
167 | - 'endTime' => $xml->endTime, |
|
168 | - 'participantCount' => $xml->participantCount, |
|
169 | - 'moderatorCount' => $xml->moderatorCount, |
|
170 | - 'attendees' => $xml->attendees, |
|
171 | - 'metadata' => $xml->metadata, |
|
172 | - ); |
|
160 | + 'meetingID' => $xml->meetingID, |
|
161 | + 'moderatorPW' => $xml->moderatorPW, |
|
162 | + 'attendeePW' => $xml->attendeePW, |
|
163 | + 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded, |
|
164 | + 'running' => $xml->running, |
|
165 | + 'recording' => $xml->recording, |
|
166 | + 'startTime' => $xml->startTime, |
|
167 | + 'endTime' => $xml->endTime, |
|
168 | + 'participantCount' => $xml->participantCount, |
|
169 | + 'moderatorCount' => $xml->moderatorCount, |
|
170 | + 'attendees' => $xml->attendees, |
|
171 | + 'metadata' => $xml->metadata, |
|
172 | + ); |
|
173 | 173 | } |
174 | 174 | if ($xml) { |
175 | 175 | // Either failure or success without meeting info. |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | function bigbluebuttonbn_get_default_config_xml() { |
306 | 306 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
307 | 307 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getDefaultConfigXML') |
308 | - ); |
|
308 | + ); |
|
309 | 309 | return $xml; |
310 | 310 | } |
311 | 311 | |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | foreach ($ids as $id) { |
407 | 407 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
408 | 408 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('deleteRecordings', ['recordID' => $id]) |
409 | - ); |
|
409 | + ); |
|
410 | 410 | if ($xml && $xml->returncode != 'SUCCESS') { |
411 | 411 | return false; |
412 | 412 | } |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | foreach ($ids as $id) { |
426 | 426 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
427 | 427 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('publishRecordings', ['recordID' => $id, 'publish' => $publish]) |
428 | - ); |
|
428 | + ); |
|
429 | 429 | if ($xml && $xml->returncode != 'SUCCESS') { |
430 | 430 | return false; |
431 | 431 | } |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | foreach ($ids as $id) { |
445 | 445 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
446 | 446 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params) |
447 | - ); |
|
447 | + ); |
|
448 | 448 | if ($xml && $xml->returncode != 'SUCCESS') { |
449 | 449 | return false; |
450 | 450 | } |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | function bigbluebuttonbn_end_meeting($meetingid, $modpw) { |
462 | 462 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
463 | 463 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('end', ['meetingID' => $meetingid, 'password' => $modpw]) |
464 | - ); |
|
464 | + ); |
|
465 | 465 | if ($xml) { |
466 | 466 | // If the xml packet returned failure it displays the message to the user. |
467 | 467 | return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | function bigbluebuttonbn_get_server_version() { |
479 | 479 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
480 | 480 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url() |
481 | - ); |
|
481 | + ); |
|
482 | 482 | if ($xml && $xml->returncode == 'SUCCESS') { |
483 | 483 | return $xml->version; |
484 | 484 | } |
@@ -545,10 +545,10 @@ discard block |
||
545 | 545 | } |
546 | 546 | $options = array(); |
547 | 547 | $options['CURLOPT_HTTPHEADER'] = array( |
548 | - 'Content-Type: '.$contenttype, |
|
549 | - 'Content-Length: '.strlen($data), |
|
550 | - 'Content-Language: en-US', |
|
551 | - ); |
|
548 | + 'Content-Type: '.$contenttype, |
|
549 | + 'Content-Length: '.strlen($data), |
|
550 | + 'Content-Language: en-US', |
|
551 | + ); |
|
552 | 552 | |
553 | 553 | return $c->post($url, $data, $options); |
554 | 554 | } |
@@ -695,16 +695,16 @@ discard block |
||
695 | 695 | 'all' => array( |
696 | 696 | 'name' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'), |
697 | 697 | 'children' => [] |
698 | - ) |
|
699 | - ); |
|
698 | + ) |
|
699 | + ); |
|
700 | 700 | $data['role'] = array( |
701 | 701 | 'name' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'), |
702 | 702 | 'children' => bigbluebuttonbn_get_roles_select($context) |
703 | - ); |
|
703 | + ); |
|
704 | 704 | $data['user'] = array( |
705 | 705 | 'name' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'), |
706 | 706 | 'children' => bigbluebuttonbn_get_users_select($context) |
707 | - ); |
|
707 | + ); |
|
708 | 708 | return $data; |
709 | 709 | } |
710 | 710 | |
@@ -747,7 +747,7 @@ discard block |
||
747 | 747 | 'selectiontype' => 'all', |
748 | 748 | 'selectionid' => 'all', |
749 | 749 | 'role' => BIGBLUEBUTTONBN_ROLE_VIEWER |
750 | - ); |
|
750 | + ); |
|
751 | 751 | $defaultrules = explode(',', \mod_bigbluebuttonbn\locallib\config::get('participant_moderator_default')); |
752 | 752 | foreach ($defaultrules as $defaultrule) { |
753 | 753 | if ($defaultrule == '0') { |
@@ -760,9 +760,9 @@ discard block |
||
760 | 760 | continue; |
761 | 761 | } |
762 | 762 | $participantlist[] = array( |
763 | - 'selectiontype' => 'role', |
|
764 | - 'selectionid' => $defaultrule, |
|
765 | - 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR); |
|
763 | + 'selectiontype' => 'role', |
|
764 | + 'selectionid' => $defaultrule, |
|
765 | + 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR); |
|
766 | 766 | } |
767 | 767 | return $participantlist; |
768 | 768 | } |
@@ -801,11 +801,11 @@ discard block |
||
801 | 801 | 'all' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'), |
802 | 802 | 'role' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'), |
803 | 803 | 'user' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'), |
804 | - ], |
|
804 | + ], |
|
805 | 805 | 'type_selected' => 'all', |
806 | 806 | 'options' => ['all' => '---------------'], |
807 | 807 | 'selected' => 'all', |
808 | - ]; |
|
808 | + ]; |
|
809 | 809 | } |
810 | 810 | |
811 | 811 | /** |
@@ -1080,7 +1080,7 @@ discard block |
||
1080 | 1080 | // Ping again and refresh the cache. |
1081 | 1081 | $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file( |
1082 | 1082 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
1083 | - ); |
|
1083 | + ); |
|
1084 | 1084 | $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); |
1085 | 1085 | return $meetinginfo; |
1086 | 1086 | } |
@@ -1492,8 +1492,8 @@ discard block |
||
1492 | 1492 | } |
1493 | 1493 | $id = 'playbacks-'.$recording['recordID']; |
1494 | 1494 | $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported, |
1495 | - 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
|
1496 | - 'title' => $title, $visibility => $visibility)); |
|
1495 | + 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
|
1496 | + 'title' => $title, $visibility => $visibility)); |
|
1497 | 1497 | foreach ($recording['playbacks'] as $playback) { |
1498 | 1498 | $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bbbsession, $playback); |
1499 | 1499 | } |
@@ -1517,7 +1517,7 @@ discard block |
||
1517 | 1517 | } |
1518 | 1518 | $text = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'); |
1519 | 1519 | $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bbbsession['bigbluebuttonbn']->id . |
1520 | - '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
1520 | + '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
1521 | 1521 | if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') { |
1522 | 1522 | $href .= '&href='.urlencode(trim($playback['url'])); |
1523 | 1523 | } |
@@ -1528,7 +1528,7 @@ discard block |
||
1528 | 1528 | 'data-action' => 'play', |
1529 | 1529 | 'data-target' => $playback['type'], |
1530 | 1530 | 'data-href' => $href, |
1531 | - ); |
|
1531 | + ); |
|
1532 | 1532 | if (!bigbluebuttonbn_is_bn_server() && !bigbluebuttonbn_is_valid_resource(trim($playback['url']))) { |
1533 | 1533 | $linkattributes['class'] = 'btn btn-sm btn-warning'; |
1534 | 1534 | $linkattributes['title'] = get_string('view_recording_format_errror_unreachable', 'bigbluebuttonbn'); |
@@ -1678,10 +1678,10 @@ discard block |
||
1678 | 1678 | 'id' => $id, |
1679 | 1679 | 'onclick' => $onclick, |
1680 | 1680 | 'data-action' => $data['action'] |
1681 | - ); |
|
1681 | + ); |
|
1682 | 1682 | if (!isset($recording['imported'])) { |
1683 | 1683 | $linkattributes['data-links'] = bigbluebuttonbn_count_recording_imported_instances( |
1684 | - $recording['recordID']); |
|
1684 | + $recording['recordID']); |
|
1685 | 1685 | } |
1686 | 1686 | if (isset($data['disabled'])) { |
1687 | 1687 | $iconattributes['class'] .= ' fa-' . $data['disabled']; |
@@ -2240,8 +2240,8 @@ discard block |
||
2240 | 2240 | $activitytime = ''; |
2241 | 2241 | if ($time) { |
2242 | 2242 | $activitytime = calendar_day_representation($time).' '. |
2243 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
2244 | - calendar_time_representation($time); |
|
2243 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
2244 | + calendar_time_representation($time); |
|
2245 | 2245 | } |
2246 | 2246 | return $activitytime; |
2247 | 2247 | } |
@@ -2541,7 +2541,7 @@ discard block |
||
2541 | 2541 | $renderer->render_group_element('participant_moderator_default', |
2542 | 2542 | $renderer->render_group_element_configmultiselect('participant_moderator_default', |
2543 | 2543 | array_keys($owner), array_merge($owner, $roles)) |
2544 | - ); |
|
2544 | + ); |
|
2545 | 2545 | } |
2546 | 2546 | } |
2547 | 2547 | |
@@ -2577,7 +2577,7 @@ discard block |
||
2577 | 2577 | // Web Client default. |
2578 | 2578 | $default = intval((int)\mod_bigbluebuttonbn\locallib\config::get('clienttype_default')); |
2579 | 2579 | $choices = array(BIGBLUEBUTTON_CLIENTTYPE_FLASH => get_string('mod_form_block_clienttype_flash', 'bigbluebuttonbn'), |
2580 | - BIGBLUEBUTTON_CLIENTTYPE_HTML5 => get_string('mod_form_block_clienttype_html5', 'bigbluebuttonbn')); |
|
2580 | + BIGBLUEBUTTON_CLIENTTYPE_HTML5 => get_string('mod_form_block_clienttype_html5', 'bigbluebuttonbn')); |
|
2581 | 2581 | $renderer->render_group_element('clienttype_default', |
2582 | 2582 | $renderer->render_group_element_configselect('clienttype_default', |
2583 | 2583 | $default, $choices)); |
@@ -2668,7 +2668,7 @@ discard block |
||
2668 | 2668 | return $output; |
2669 | 2669 | } |
2670 | 2670 | $output .= $OUTPUT->box_start('box boxalignleft adminerror alert alert-' . $type . ' alert-block fade in', |
2671 | - 'bigbluebuttonbn_view_general_warning') . "\n"; |
|
2671 | + 'bigbluebuttonbn_view_general_warning') . "\n"; |
|
2672 | 2672 | $output .= ' ' . $message . "\n"; |
2673 | 2673 | $output .= ' <div class="singlebutton pull-right">' . "\n"; |
2674 | 2674 | if (!empty($href)) { |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | global $CFG; |
30 | 30 | |
31 | -require_once(dirname(__FILE__).'/lib.php'); |
|
31 | +require_once(dirname(__FILE__) . '/lib.php'); |
|
32 | 32 | |
33 | 33 | /** @var BIGBLUEBUTTONBN_UPDATE_CACHE boolean set to true indicates that cache has to be updated */ |
34 | 34 | const BIGBLUEBUTTONBN_UPDATE_CACHE = true; |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | 'logoutURL' => $logouturl, |
101 | 101 | ]; |
102 | 102 | // Choose between Adobe Flash or HTML5 Client. |
103 | - if ( $clienttype == BIGBLUEBUTTON_CLIENTTYPE_HTML5 ) { |
|
103 | + if ($clienttype == BIGBLUEBUTTON_CLIENTTYPE_HTML5) { |
|
104 | 104 | $data['joinViaHtml5'] = 'true'; |
105 | 105 | } |
106 | 106 | if (!is_null($configtoken)) { |
@@ -128,8 +128,8 @@ discard block |
||
128 | 128 | $data = null; |
129 | 129 | if (!is_null($pname) && !is_null($purl)) { |
130 | 130 | $method = 'POST'; |
131 | - $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='". |
|
132 | - $purl."' /></module></modules>"; |
|
131 | + $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='" . |
|
132 | + $purl . "' /></module></modules>"; |
|
133 | 133 | } |
134 | 134 | $xml = bigbluebuttonbn_wrap_xml_load_file($createmeetingurl, $method, $data); |
135 | 135 | if ($xml) { |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | // Override imported flag with actual ID. |
291 | 291 | $recording['imported'] = $recordimported->id; |
292 | 292 | if (isset($recordimported->protected)) { |
293 | - $recording['protected'] = (string) $recordimported->protected; |
|
293 | + $recording['protected'] = (string)$recordimported->protected; |
|
294 | 294 | } |
295 | 295 | $recordsimportedarray[$recording['recordID']] = $recording; |
296 | 296 | } |
@@ -320,21 +320,21 @@ discard block |
||
320 | 320 | // Add formats. |
321 | 321 | $playbackarray = array(); |
322 | 322 | foreach ($recording->playback->format as $format) { |
323 | - $playbackarray[(string) $format->type] = array('type' => (string) $format->type, |
|
324 | - 'url' => trim((string) $format->url), 'length' => (string) $format->length); |
|
323 | + $playbackarray[(string)$format->type] = array('type' => (string)$format->type, |
|
324 | + 'url' => trim((string)$format->url), 'length' => (string)$format->length); |
|
325 | 325 | // Add preview per format when existing. |
326 | 326 | if ($format->preview) { |
327 | - $playbackarray[(string) $format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview); |
|
327 | + $playbackarray[(string)$format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview); |
|
328 | 328 | } |
329 | 329 | } |
330 | 330 | // Add the metadata to the recordings array. |
331 | 331 | $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata)); |
332 | - $recordingarray = array('recordID' => (string) $recording->recordID, |
|
333 | - 'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name, |
|
334 | - 'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime, |
|
335 | - 'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray); |
|
332 | + $recordingarray = array('recordID' => (string)$recording->recordID, |
|
333 | + 'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name, |
|
334 | + 'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime, |
|
335 | + 'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray); |
|
336 | 336 | if (isset($recording->protected)) { |
337 | - $recordingarray['protected'] = (string) $recording->protected; |
|
337 | + $recordingarray['protected'] = (string)$recording->protected; |
|
338 | 338 | } |
339 | 339 | return $recordingarray + $metadataarray; |
340 | 340 | } |
@@ -349,9 +349,9 @@ discard block |
||
349 | 349 | function bigbluebuttonbn_get_recording_preview_images($preview) { |
350 | 350 | $imagesarray = array(); |
351 | 351 | foreach ($preview->images->image as $image) { |
352 | - $imagearray = array('url' => trim((string) $image)); |
|
352 | + $imagearray = array('url' => trim((string)$image)); |
|
353 | 353 | foreach ($image->attributes() as $attkey => $attvalue) { |
354 | - $imagearray[$attkey] = (string) $attvalue; |
|
354 | + $imagearray[$attkey] = (string)$attvalue; |
|
355 | 355 | } |
356 | 356 | array_push($imagesarray, $imagearray); |
357 | 357 | } |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | if (is_object($value)) { |
372 | 372 | $value = ''; |
373 | 373 | } |
374 | - $metadataarray['meta_'.$key] = $value; |
|
374 | + $metadataarray['meta_' . $key] = $value; |
|
375 | 375 | } |
376 | 376 | return $metadataarray; |
377 | 377 | } |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | $ids = explode(',', $recordids); |
444 | 444 | foreach ($ids as $id) { |
445 | 445 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
446 | - \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params) |
|
446 | + \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params) |
|
447 | 447 | ); |
448 | 448 | if ($xml && $xml->returncode != 'SUCCESS') { |
449 | 449 | return false; |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | return $xml; |
509 | 509 | } catch (Exception $e) { |
510 | 510 | libxml_use_internal_errors($previous); |
511 | - $error = 'Caught exception: '.$e->getMessage(); |
|
511 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
512 | 512 | debugging($error, DEBUG_DEVELOPER); |
513 | 513 | return null; |
514 | 514 | } |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | $response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS); |
520 | 520 | return $response; |
521 | 521 | } catch (Exception $e) { |
522 | - $error = 'Caught exception: '.$e->getMessage(); |
|
522 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
523 | 523 | debugging($error, DEBUG_DEVELOPER); |
524 | 524 | libxml_use_internal_errors($previous); |
525 | 525 | return null; |
@@ -545,8 +545,8 @@ discard block |
||
545 | 545 | } |
546 | 546 | $options = array(); |
547 | 547 | $options['CURLOPT_HTTPHEADER'] = array( |
548 | - 'Content-Type: '.$contenttype, |
|
549 | - 'Content-Length: '.strlen($data), |
|
548 | + 'Content-Type: ' . $contenttype, |
|
549 | + 'Content-Length: ' . strlen($data), |
|
550 | 550 | 'Content-Language: en-US', |
551 | 551 | ); |
552 | 552 | |
@@ -567,7 +567,7 @@ discard block |
||
567 | 567 | * @return void |
568 | 568 | */ |
569 | 569 | function bigbluebuttonbn_end_meeting_if_running($bigbluebuttonbn) { |
570 | - $meetingid = $bigbluebuttonbn->meetingid.'-'.$bigbluebuttonbn->course.'-'.$bigbluebuttonbn->id; |
|
570 | + $meetingid = $bigbluebuttonbn->meetingid . '-' . $bigbluebuttonbn->course . '-' . $bigbluebuttonbn->id; |
|
571 | 571 | if (bigbluebuttonbn_is_meeting_running($meetingid)) { |
572 | 572 | bigbluebuttonbn_end_meeting($meetingid, $bigbluebuttonbn->moderatorpass); |
573 | 573 | } |
@@ -587,9 +587,9 @@ discard block |
||
587 | 587 | if ($userroles) { |
588 | 588 | $where = ''; |
589 | 589 | foreach ($userroles as $userrole) { |
590 | - $where .= (empty($where) ? ' WHERE' : ' OR').' id=' . $userrole->roleid; |
|
590 | + $where .= (empty($where) ? ' WHERE' : ' OR') . ' id=' . $userrole->roleid; |
|
591 | 591 | } |
592 | - $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where); |
|
592 | + $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where); |
|
593 | 593 | } |
594 | 594 | return $userroles; |
595 | 595 | } |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | * @return array $users |
613 | 613 | */ |
614 | 614 | function bigbluebuttonbn_get_users(context $context = null) { |
615 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
615 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
616 | 616 | foreach ($users as $key => $value) { |
617 | 617 | $users[$key] = fullname($value); |
618 | 618 | } |
@@ -627,7 +627,7 @@ discard block |
||
627 | 627 | * @return array $users |
628 | 628 | */ |
629 | 629 | function bigbluebuttonbn_get_users_select(context $context = null) { |
630 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
630 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
631 | 631 | foreach ($users as $key => $value) { |
632 | 632 | $users[$key] = array('id' => $value->id, 'name' => fullname($value)); |
633 | 633 | } |
@@ -642,7 +642,7 @@ discard block |
||
642 | 642 | * @return array $roles |
643 | 643 | */ |
644 | 644 | function bigbluebuttonbn_get_roles(context $context = null) { |
645 | - $roles = (array) role_get_names($context); |
|
645 | + $roles = (array)role_get_names($context); |
|
646 | 646 | foreach ($roles as $key => $value) { |
647 | 647 | $roles[$key] = $value->localname; |
648 | 648 | } |
@@ -657,7 +657,7 @@ discard block |
||
657 | 657 | * @return array $users |
658 | 658 | */ |
659 | 659 | function bigbluebuttonbn_get_roles_select(context $context = null) { |
660 | - $roles = (array) role_get_names($context); |
|
660 | + $roles = (array)role_get_names($context); |
|
661 | 661 | foreach ($roles as $key => $value) { |
662 | 662 | $roles[$key] = array('id' => $value->id, 'name' => $value->localname); |
663 | 663 | } |
@@ -672,7 +672,7 @@ discard block |
||
672 | 672 | * @return object $role |
673 | 673 | */ |
674 | 674 | function bigbluebuttonbn_get_role($id) { |
675 | - $roles = (array) role_get_names(); |
|
675 | + $roles = (array)role_get_names(); |
|
676 | 676 | if (is_numeric($id) && isset($roles[$id])) { |
677 | 677 | return (object)$roles[$id]; |
678 | 678 | } |
@@ -829,7 +829,7 @@ discard block |
||
829 | 829 | if (!isguestuser()) { |
830 | 830 | $userroles = bigbluebuttonbn_get_user_roles($context, $userid); |
831 | 831 | } |
832 | - return bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles); |
|
832 | + return bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles); |
|
833 | 833 | } |
834 | 834 | |
835 | 835 | /** |
@@ -985,7 +985,7 @@ discard block |
||
985 | 985 | function bigbluebuttonbn_generate_nonce() { |
986 | 986 | $mt = microtime(); |
987 | 987 | $rand = mt_rand(); |
988 | - return md5($mt.$rand); |
|
988 | + return md5($mt . $rand); |
|
989 | 989 | } |
990 | 990 | |
991 | 991 | /** |
@@ -1075,10 +1075,10 @@ discard block |
||
1075 | 1075 | $now = time(); |
1076 | 1076 | if (!$updatecache && isset($result) && $now < ($result['creation_time'] + $cachettl)) { |
1077 | 1077 | // Use the value in the cache. |
1078 | - return (array) json_decode($result['meeting_info']); |
|
1078 | + return (array)json_decode($result['meeting_info']); |
|
1079 | 1079 | } |
1080 | 1080 | // Ping again and refresh the cache. |
1081 | - $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file( |
|
1081 | + $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file( |
|
1082 | 1082 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
1083 | 1083 | ); |
1084 | 1084 | $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); |
@@ -1189,7 +1189,7 @@ discard block |
||
1189 | 1189 | * @return object |
1190 | 1190 | */ |
1191 | 1191 | function bigbluebuttonbn_set_config_xml($meetingid, $configxml) { |
1192 | - $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?'; |
|
1192 | + $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?'; |
|
1193 | 1193 | $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml); |
1194 | 1194 | $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, 'POST', |
1195 | 1195 | $configxmlparams, 'application/x-www-form-urlencoded'); |
@@ -1205,8 +1205,8 @@ discard block |
||
1205 | 1205 | * @return string |
1206 | 1206 | */ |
1207 | 1207 | function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) { |
1208 | - $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid); |
|
1209 | - $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.\mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
1208 | + $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid); |
|
1209 | + $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . \mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
1210 | 1210 | return $configxmlparams; |
1211 | 1211 | } |
1212 | 1212 | |
@@ -1220,7 +1220,7 @@ discard block |
||
1220 | 1220 | */ |
1221 | 1221 | function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) { |
1222 | 1222 | $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml); |
1223 | - $configxmlarray = (array) $configxml; |
|
1223 | + $configxmlarray = (array)$configxml; |
|
1224 | 1224 | if ($configxmlarray['returncode'] != 'SUCCESS') { |
1225 | 1225 | debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER); |
1226 | 1226 | return ''; |
@@ -1312,7 +1312,7 @@ discard block |
||
1312 | 1312 | global $USER; |
1313 | 1313 | $starttime = $starttime - ($starttime % 1000); |
1314 | 1314 | // Set formatted date. |
1315 | - $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z'; |
|
1315 | + $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z'; |
|
1316 | 1316 | return userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone)); |
1317 | 1317 | } |
1318 | 1318 | |
@@ -1428,7 +1428,7 @@ discard block |
||
1428 | 1428 | * @return string |
1429 | 1429 | */ |
1430 | 1430 | function bigbluebuttonbn_get_recording_data_row_preview($recording) { |
1431 | - $options = array('id' => 'preview-'.$recording['recordID']); |
|
1431 | + $options = array('id' => 'preview-' . $recording['recordID']); |
|
1432 | 1432 | if ($recording['published'] === 'false') { |
1433 | 1433 | $options['hidden'] = 'hidden'; |
1434 | 1434 | } |
@@ -1490,7 +1490,7 @@ discard block |
||
1490 | 1490 | if ($recording['published'] === 'false') { |
1491 | 1491 | $visibility = 'hidden '; |
1492 | 1492 | } |
1493 | - $id = 'playbacks-'.$recording['recordID']; |
|
1493 | + $id = 'playbacks-' . $recording['recordID']; |
|
1494 | 1494 | $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported, |
1495 | 1495 | 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
1496 | 1496 | 'title' => $title, $visibility => $visibility)); |
@@ -1515,11 +1515,11 @@ discard block |
||
1515 | 1515 | if (!bigbluebuttonbn_include_recording_data_row_type($recording, $bbbsession, $playback)) { |
1516 | 1516 | return ''; |
1517 | 1517 | } |
1518 | - $text = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'); |
|
1518 | + $text = get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn'); |
|
1519 | 1519 | $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bbbsession['bigbluebuttonbn']->id . |
1520 | - '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
1520 | + '&mid=' . $recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
1521 | 1521 | if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') { |
1522 | - $href .= '&href='.urlencode(trim($playback['url'])); |
|
1522 | + $href .= '&href=' . urlencode(trim($playback['url'])); |
|
1523 | 1523 | } |
1524 | 1524 | $linkattributes = array( |
1525 | 1525 | 'id' => 'recording-play-' . $playback['type'] . '-' . $recording['recordID'], |
@@ -1688,7 +1688,7 @@ discard block |
||
1688 | 1688 | $linkattributes['class'] = 'disabled'; |
1689 | 1689 | unset($linkattributes['onclick']); |
1690 | 1690 | } |
1691 | - $icon = new pix_icon('i/'.$data['tag'], |
|
1691 | + $icon = new pix_icon('i/' . $data['tag'], |
|
1692 | 1692 | get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'), |
1693 | 1693 | 'moodle', $iconattributes); |
1694 | 1694 | return $OUTPUT->action_icon('#', $icon, null, $linkattributes, false); |
@@ -1805,7 +1805,7 @@ discard block |
||
1805 | 1805 | */ |
1806 | 1806 | function bigbluebuttonbn_get_recording_table_row($bbbsession, $recording, $rowdata) { |
1807 | 1807 | $row = new html_table_row(); |
1808 | - $row->id = 'recording-tr-'.$recording['recordID']; |
|
1808 | + $row->id = 'recording-tr-' . $recording['recordID']; |
|
1809 | 1809 | $row->attributes['data-imported'] = 'false'; |
1810 | 1810 | $texthead = ''; |
1811 | 1811 | $texttail = ''; |
@@ -1865,9 +1865,9 @@ discard block |
||
1865 | 1865 | function bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn) { |
1866 | 1866 | $sender = get_admin(); |
1867 | 1867 | // Prepare message. |
1868 | - $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn'). |
|
1869 | - ' "' . $bigbluebuttonbn->name . '" '. |
|
1870 | - get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>'; |
|
1868 | + $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . |
|
1869 | + ' "' . $bigbluebuttonbn->name . '" ' . |
|
1870 | + get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>'; |
|
1871 | 1871 | $context = context_course::instance($bigbluebuttonbn->course); |
1872 | 1872 | \mod_bigbluebuttonbn\locallib\notifier::notification_send($context, $sender, $bigbluebuttonbn, $messagetext); |
1873 | 1873 | } |
@@ -2089,7 +2089,7 @@ discard block |
||
2089 | 2089 | } |
2090 | 2090 | // Prepare select for loading records based on existent bigbluebuttonbns. |
2091 | 2091 | $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE '; |
2092 | - $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')'; |
|
2092 | + $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')'; |
|
2093 | 2093 | // Include only Create events and exclude those with record not true. |
2094 | 2094 | $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?'; |
2095 | 2095 | // Execute select for loading records based on existent bigbluebuttonbns. |
@@ -2239,8 +2239,8 @@ discard block |
||
2239 | 2239 | function bigbluebuttonbn_format_activity_time($time) { |
2240 | 2240 | $activitytime = ''; |
2241 | 2241 | if ($time) { |
2242 | - $activitytime = calendar_day_representation($time).' '. |
|
2243 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
2242 | + $activitytime = calendar_day_representation($time) . ' ' . |
|
2243 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' . |
|
2244 | 2244 | calendar_time_representation($time); |
2245 | 2245 | } |
2246 | 2246 | return $activitytime; |
@@ -2660,7 +2660,7 @@ discard block |
||
2660 | 2660 | * |
2661 | 2661 | * @return string |
2662 | 2662 | */ |
2663 | -function bigbluebuttonbn_render_warning($message, $type='info', $href='', $text='', $class='') { |
|
2663 | +function bigbluebuttonbn_render_warning($message, $type = 'info', $href = '', $text = '', $class = '') { |
|
2664 | 2664 | global $OUTPUT; |
2665 | 2665 | $output = "\n"; |
2666 | 2666 | // Evaluates if config_warning is enabled. |
@@ -2699,11 +2699,11 @@ discard block |
||
2699 | 2699 | if ($class == '') { |
2700 | 2700 | $class = 'btn btn-secondary'; |
2701 | 2701 | } |
2702 | - $output = ' <form method="post" action="' . $href . '" class="form-inline">'."\n"; |
|
2703 | - $output .= ' <button type="submit" class="' . $class . '"'."\n"; |
|
2704 | - $output .= ' title="' . $title . '"'."\n"; |
|
2705 | - $output .= ' >' . $text . '</button>'."\n"; |
|
2706 | - $output .= ' </form>'."\n"; |
|
2702 | + $output = ' <form method="post" action="' . $href . '" class="form-inline">' . "\n"; |
|
2703 | + $output .= ' <button type="submit" class="' . $class . '"' . "\n"; |
|
2704 | + $output .= ' title="' . $title . '"' . "\n"; |
|
2705 | + $output .= ' >' . $text . '</button>' . "\n"; |
|
2706 | + $output .= ' </form>' . "\n"; |
|
2707 | 2707 | return $output; |
2708 | 2708 | } |
2709 | 2709 |