@@ -120,29 +120,29 @@ |
||
| 120 | 120 | */ |
| 121 | 121 | public static function get_options() { |
| 122 | 122 | return [ |
| 123 | - 'version_major' => self::get_moodle_version_major(), |
|
| 124 | - 'voicebridge_editable' => self::get('voicebridge_editable'), |
|
| 125 | - 'waitformoderator_default' => self::get('waitformoderator_default'), |
|
| 126 | - 'waitformoderator_editable' => self::get('waitformoderator_editable'), |
|
| 127 | - 'userlimit_default' => self::get('userlimit_default'), |
|
| 128 | - 'userlimit_editable' => self::get('userlimit_editable'), |
|
| 129 | - 'preuploadpresentation_enabled' => self::get('preuploadpresentation_enabled'), |
|
| 130 | - 'sendnotifications_enabled' => self::get('sendnotifications_enabled'), |
|
| 131 | - 'recordings_enabled' => self::get('recordings_enabled'), |
|
| 132 | - 'recordings_html_default' => self::get('recordings_html_default'), |
|
| 133 | - 'recordings_html_editable' => self::get('recordings_html_editable'), |
|
| 134 | - 'recordings_deleted_default' => self::get('recordings_deleted_default'), |
|
| 135 | - 'recordings_deleted_editable' => self::get('recordings_deleted_editable'), |
|
| 136 | - 'recordings_imported_default' => self::get('recordings_imported_default'), |
|
| 137 | - 'recordings_imported_editable' => self::get('recordings_imported_editable'), |
|
| 138 | - 'recording_default' => self::get('recording_default'), |
|
| 139 | - 'recording_editable' => self::get('recording_editable'), |
|
| 140 | - 'recording_icons_enabled' => self::get('recording_icons_enabled'), |
|
| 141 | - 'general_warning_message' => self::get('general_warning_message'), |
|
| 142 | - 'general_warning_box_type' => self::get('general_warning_box_type'), |
|
| 143 | - 'general_warning_button_text' => self::get('general_warning_button_text'), |
|
| 144 | - 'general_warning_button_href' => self::get('general_warning_button_href'), |
|
| 145 | - 'general_warning_button_class' => self::get('general_warning_button_class'), |
|
| 146 | - ]; |
|
| 123 | + 'version_major' => self::get_moodle_version_major(), |
|
| 124 | + 'voicebridge_editable' => self::get('voicebridge_editable'), |
|
| 125 | + 'waitformoderator_default' => self::get('waitformoderator_default'), |
|
| 126 | + 'waitformoderator_editable' => self::get('waitformoderator_editable'), |
|
| 127 | + 'userlimit_default' => self::get('userlimit_default'), |
|
| 128 | + 'userlimit_editable' => self::get('userlimit_editable'), |
|
| 129 | + 'preuploadpresentation_enabled' => self::get('preuploadpresentation_enabled'), |
|
| 130 | + 'sendnotifications_enabled' => self::get('sendnotifications_enabled'), |
|
| 131 | + 'recordings_enabled' => self::get('recordings_enabled'), |
|
| 132 | + 'recordings_html_default' => self::get('recordings_html_default'), |
|
| 133 | + 'recordings_html_editable' => self::get('recordings_html_editable'), |
|
| 134 | + 'recordings_deleted_default' => self::get('recordings_deleted_default'), |
|
| 135 | + 'recordings_deleted_editable' => self::get('recordings_deleted_editable'), |
|
| 136 | + 'recordings_imported_default' => self::get('recordings_imported_default'), |
|
| 137 | + 'recordings_imported_editable' => self::get('recordings_imported_editable'), |
|
| 138 | + 'recording_default' => self::get('recording_default'), |
|
| 139 | + 'recording_editable' => self::get('recording_editable'), |
|
| 140 | + 'recording_icons_enabled' => self::get('recording_icons_enabled'), |
|
| 141 | + 'general_warning_message' => self::get('general_warning_message'), |
|
| 142 | + 'general_warning_box_type' => self::get('general_warning_box_type'), |
|
| 143 | + 'general_warning_button_text' => self::get('general_warning_button_text'), |
|
| 144 | + 'general_warning_button_href' => self::get('general_warning_button_href'), |
|
| 145 | + 'general_warning_button_class' => self::get('general_warning_button_class'), |
|
| 146 | + ]; |
|
| 147 | 147 | } |
| 148 | 148 | } |
@@ -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', |
@@ -119,8 +119,8 @@ discard block |
||
| 119 | 119 | if (isset($CFG->bigbluebuttonbn[$setting])) { |
| 120 | 120 | return (string)$CFG->bigbluebuttonbn[$setting]; |
| 121 | 121 | } |
| 122 | - if (isset($CFG->{'bigbluebuttonbn_'.$setting})) { |
|
| 123 | - return (string)$CFG->{'bigbluebuttonbn_'.$setting}; |
|
| 122 | + if (isset($CFG->{'bigbluebuttonbn_' . $setting})) { |
|
| 123 | + return (string)$CFG->{'bigbluebuttonbn_' . $setting}; |
|
| 124 | 124 | } |
| 125 | 125 | return self::defaultvalue($setting); |
| 126 | 126 | } |
@@ -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,91 +62,91 @@ |
||
| 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 | + bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_CREATE); |
|
| 138 | + // Since the meeting is already running, we just join the session. |
|
| 139 | + bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn); |
|
| 128 | 140 | break; |
| 129 | - } |
|
| 130 | - if ($response['hasBeenForciblyEnded'] == 'true') { |
|
| 131 | - print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn')); |
|
| 141 | + case 'play': |
|
| 142 | + $href = bigbluebutton_bbb_view_playback_href($href, $mid, $rid, $rtype); |
|
| 143 | + // Moodle event logger: Create an event for meeting left. |
|
| 144 | + bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_VIEWED, $bigbluebuttonbn, $cm, ['other' => $rid]); |
|
| 145 | + // Execute the redirect. |
|
| 146 | + header('Location: '.urldecode($href)); |
|
| 132 | 147 | 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 | - bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_CREATE); |
|
| 138 | - // Since the meeting is already running, we just join the session. |
|
| 139 | - bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn); |
|
| 140 | - break; |
|
| 141 | - case 'play': |
|
| 142 | - $href = bigbluebutton_bbb_view_playback_href($href, $mid, $rid, $rtype); |
|
| 143 | - // Moodle event logger: Create an event for meeting left. |
|
| 144 | - bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_VIEWED, $bigbluebuttonbn, $cm, ['other' => $rid]); |
|
| 145 | - // Execute the redirect. |
|
| 146 | - header('Location: '.urldecode($href)); |
|
| 147 | - break; |
|
| 148 | - default: |
|
| 149 | - bigbluebutton_bbb_view_close_window(); |
|
| 148 | + default: |
|
| 149 | + bigbluebutton_bbb_view_close_window(); |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | /** |
@@ -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') { |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | // Moodle event logger: Create an event for meeting left. |
| 144 | 144 | bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_VIEWED, $bigbluebuttonbn, $cm, ['other' => $rid]); |
| 145 | 145 | // Execute the redirect. |
| 146 | - header('Location: '.urldecode($href)); |
|
| 146 | + header('Location: ' . urldecode($href)); |
|
| 147 | 147 | break; |
| 148 | 148 | default: |
| 149 | 149 | bigbluebutton_bbb_view_close_window(); |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | $data['welcome'] .= '<br><br>'; |
| 229 | 229 | $data['welcome'] .= str_replace( |
| 230 | 230 | '%duration%', |
| 231 | - (string) $durationtime, |
|
| 231 | + (string)$durationtime, |
|
| 232 | 232 | get_string('bbbdurationwarning', 'bigbluebuttonbn') |
| 233 | 233 | ); |
| 234 | 234 | } |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_UPDATE_CACHE); |
| 317 | 317 | if ($bbbsession['userlimit'] > 0 && intval($meetinginfo['participantCount']) >= $bbbsession['userlimit']) { |
| 318 | 318 | // No more users allowed to join. |
| 319 | - header('Location: '.$bbbsession['logoutURL']); |
|
| 319 | + header('Location: ' . $bbbsession['logoutURL']); |
|
| 320 | 320 | return; |
| 321 | 321 | } |
| 322 | 322 | // Build the URL. |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | bigbluebuttonbn_participant_joined($bbbsession['meetingid'], |
| 335 | 335 | ($bbbsession['administrator'] || $bbbsession['moderator'])); |
| 336 | 336 | // Execute the redirect. |
| 337 | - header('Location: '.$joinurl); |
|
| 337 | + header('Location: ' . $joinurl); |
|
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | /** |
@@ -346,13 +346,13 @@ discard block |
||
| 346 | 346 | */ |
| 347 | 347 | function bigbluebutton_bbb_view_errors($serrors, $id) { |
| 348 | 348 | global $CFG, $OUTPUT; |
| 349 | - $errors = (array) json_decode(urldecode($serrors)); |
|
| 349 | + $errors = (array)json_decode(urldecode($serrors)); |
|
| 350 | 350 | $msgerrors = ''; |
| 351 | 351 | foreach ($errors as $error) { |
| 352 | - $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger'))."\n"; |
|
| 352 | + $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger')) . "\n"; |
|
| 353 | 353 | } |
| 354 | 354 | echo $OUTPUT->header(); |
| 355 | 355 | print_error('view_error_bigbluebutton', 'bigbluebuttonbn', |
| 356 | - $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$id, $msgerrors, $serrors); |
|
| 356 | + $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $id, $msgerrors, $serrors); |
|
| 357 | 357 | echo $OUTPUT->footer(); |
| 358 | 358 | } |
@@ -366,26 +366,26 @@ discard block |
||
| 366 | 366 | return array( |
| 367 | 367 | 'status' => false, |
| 368 | 368 | 'message' => get_string('view_recording_publish_link_deleted', 'bigbluebuttonbn') |
| 369 | - ); |
|
| 369 | + ); |
|
| 370 | 370 | } |
| 371 | 371 | if ($realrecordings[$params['id']]['published'] !== 'true') { |
| 372 | 372 | return array( |
| 373 | 373 | 'status' => false, |
| 374 | 374 | 'message' => get_string('view_recording_publish_link_not_published', 'bigbluebuttonbn') |
| 375 | - ); |
|
| 375 | + ); |
|
| 376 | 376 | } |
| 377 | 377 | return array( |
| 378 | 378 | 'status' => bigbluebuttonbn_publish_recording_imported( |
| 379 | 379 | $recordings[$params['id']]['imported'], true |
| 380 | 380 | ) |
| 381 | - ); |
|
| 381 | + ); |
|
| 382 | 382 | } |
| 383 | 383 | // As the recordingid was not identified as imported recording link, execute actual publish. |
| 384 | 384 | return array( |
| 385 | 385 | 'status' => bigbluebuttonbn_publish_recordings( |
| 386 | 386 | $params['id'], 'true' |
| 387 | 387 | ) |
| 388 | - ); |
|
| 388 | + ); |
|
| 389 | 389 | } |
| 390 | 390 | |
| 391 | 391 | /** |
@@ -401,26 +401,26 @@ discard block |
||
| 401 | 401 | return array( |
| 402 | 402 | 'status' => false, |
| 403 | 403 | 'message' => get_string('view_recording_unprotect_link_deleted', 'bigbluebuttonbn') |
| 404 | - ); |
|
| 404 | + ); |
|
| 405 | 405 | } |
| 406 | 406 | if ($realrecordings[$params['id']]['protected'] === 'true') { |
| 407 | 407 | return array( |
| 408 | 408 | 'status' => false, |
| 409 | 409 | 'message' => get_string('view_recording_unprotect_link_not_unprotected', 'bigbluebuttonbn') |
| 410 | - ); |
|
| 410 | + ); |
|
| 411 | 411 | } |
| 412 | 412 | return array( |
| 413 | 413 | 'status' => bigbluebuttonbn_protect_recording_imported( |
| 414 | 414 | $recordings[$params['id']]['imported'], false |
| 415 | 415 | ) |
| 416 | - ); |
|
| 416 | + ); |
|
| 417 | 417 | } |
| 418 | 418 | // As the recordingid was not identified as imported recording link, execute actual uprotect. |
| 419 | 419 | return array( |
| 420 | 420 | 'status' => bigbluebuttonbn_update_recordings( |
| 421 | 421 | $params['id'], array('protect' => 'false') |
| 422 | 422 | ) |
| 423 | - ); |
|
| 423 | + ); |
|
| 424 | 424 | } |
| 425 | 425 | |
| 426 | 426 | /** |
@@ -434,7 +434,7 @@ discard block |
||
| 434 | 434 | 'status' => bigbluebuttonbn_publish_recording_imported( |
| 435 | 435 | $recordings[$params['id']]['imported'], false |
| 436 | 436 | ) |
| 437 | - ); |
|
| 437 | + ); |
|
| 438 | 438 | } |
| 439 | 439 | // As the recordingid was not identified as imported recording link, execute unpublish on a real recording. |
| 440 | 440 | // First: Unpublish imported links associated to the recording. |
@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | 'status' => bigbluebuttonbn_publish_recordings( |
| 453 | 453 | $params['id'], 'false' |
| 454 | 454 | ) |
| 455 | - ); |
|
| 455 | + ); |
|
| 456 | 456 | } |
| 457 | 457 | |
| 458 | 458 | /** |
@@ -466,7 +466,7 @@ discard block |
||
| 466 | 466 | 'status' => bigbluebuttonbn_protect_recording_imported( |
| 467 | 467 | $recordings[$params['id']]['imported'], true |
| 468 | 468 | ) |
| 469 | - ); |
|
| 469 | + ); |
|
| 470 | 470 | } |
| 471 | 471 | // As the recordingid was not identified as imported recording link, execute protect on a real recording. |
| 472 | 472 | // First: Protect imported links associated to the recording. |
@@ -484,7 +484,7 @@ discard block |
||
| 484 | 484 | 'status' => bigbluebuttonbn_update_recordings( |
| 485 | 485 | $params['id'], array('protect' => 'true') |
| 486 | 486 | ) |
| 487 | - ); |
|
| 487 | + ); |
|
| 488 | 488 | } |
| 489 | 489 | |
| 490 | 490 | /** |
@@ -498,7 +498,7 @@ discard block |
||
| 498 | 498 | 'status' => bigbluebuttonbn_delete_recording_imported( |
| 499 | 499 | $recordings[$params['id']]['imported'] |
| 500 | 500 | ) |
| 501 | - ); |
|
| 501 | + ); |
|
| 502 | 502 | } |
| 503 | 503 | // As the recordingid was not identified as imported recording link, execute delete on a real recording. |
| 504 | 504 | // First: Delete imported links associated to the recording. |
@@ -514,7 +514,7 @@ discard block |
||
| 514 | 514 | 'status' => bigbluebuttonbn_delete_recordings( |
| 515 | 515 | $params['id'] |
| 516 | 516 | ) |
| 517 | - ); |
|
| 517 | + ); |
|
| 518 | 518 | } |
| 519 | 519 | |
| 520 | 520 | /** |
@@ -527,7 +527,7 @@ discard block |
||
| 527 | 527 | 'status' => bigbluebuttonbn_update_recording_imported( |
| 528 | 528 | $recordings[$params['id']]['imported'], json_decode($params['meta'], true) |
| 529 | 529 | ) |
| 530 | - ); |
|
| 530 | + ); |
|
| 531 | 531 | } |
| 532 | 532 | |
| 533 | 533 | // As the recordingid was not identified as imported recording link, execute update on a real recording. |
@@ -537,7 +537,7 @@ discard block |
||
| 537 | 537 | 'status' => bigbluebuttonbn_update_recordings( |
| 538 | 538 | $params['id'], json_decode($params['meta']) |
| 539 | 539 | ) |
| 540 | - ); |
|
| 540 | + ); |
|
| 541 | 541 | } |
| 542 | 542 | |
| 543 | 543 | /** |
@@ -682,10 +682,10 @@ discard block |
||
| 682 | 682 | $params['recording_import'] = ['id' => 'The recordingID must be specified.']; |
| 683 | 683 | $params['recording_ready'] = [ |
| 684 | 684 | 'signed_parameters' => 'A JWT encoded string must be included as [signed_parameters].' |
| 685 | - ]; |
|
| 685 | + ]; |
|
| 686 | 686 | $params['live_session_events'] = [ |
| 687 | 687 | 'signed_parameters' => 'A JWT encoded string must be included as [signed_parameters].' |
| 688 | - ]; |
|
| 688 | + ]; |
|
| 689 | 689 | return $params; |
| 690 | 690 | } |
| 691 | 691 | |
@@ -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 | |
@@ -40,13 +40,13 @@ discard block |
||
| 40 | 40 | $params['meta'] = optional_param('meta', '', PARAM_TEXT); |
| 41 | 41 | |
| 42 | 42 | if (empty($params['action'])) { |
| 43 | - header('HTTP/1.0 400 Bad Request. Parameter ['.$params['action'].'] was not included'); |
|
| 43 | + header('HTTP/1.0 400 Bad Request. Parameter [' . $params['action'] . '] was not included'); |
|
| 44 | 44 | return; |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | $error = bigbluebuttonbn_broker_validate_parameters($params); |
| 48 | 48 | if (!empty($error)) { |
| 49 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
| 49 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
| 50 | 50 | return; |
| 51 | 51 | } |
| 52 | 52 | |
@@ -130,11 +130,11 @@ discard block |
||
| 130 | 130 | bigbluebuttonbn_broker_live_session_events($params, $bigbluebuttonbn, $cm); |
| 131 | 131 | return; |
| 132 | 132 | } |
| 133 | - header('HTTP/1.0 400 Bad request. The action '. $a . ' doesn\'t exist'); |
|
| 133 | + header('HTTP/1.0 400 Bad request. The action ' . $a . ' doesn\'t exist'); |
|
| 134 | 134 | return; |
| 135 | 135 | |
| 136 | 136 | } catch (Exception $e) { |
| 137 | - header('HTTP/1.0 500 Internal Server Error. '.$e->getMessage()); |
|
| 137 | + header('HTTP/1.0 500 Internal Server Error. ' . $e->getMessage()); |
|
| 138 | 138 | return; |
| 139 | 139 | } |
| 140 | 140 | |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | function bigbluebuttonbn_broker_recording_info_current($recording, $params) { |
| 321 | 321 | $callbackresponse['status'] = true; |
| 322 | 322 | $callbackresponse['found'] = true; |
| 323 | - $callbackresponse['published'] = (string) $recording['published']; |
|
| 323 | + $callbackresponse['published'] = (string)$recording['published']; |
|
| 324 | 324 | if (!isset($params['meta']) || empty($params['meta'])) { |
| 325 | 325 | return $callbackresponse; |
| 326 | 326 | } |
@@ -650,8 +650,8 @@ discard block |
||
| 650 | 650 | $decodedparameters = JWT::decode($params['signed_parameters'], |
| 651 | 651 | \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256')); |
| 652 | 652 | } catch (Exception $e) { |
| 653 | - $error = 'Caught exception: '.$e->getMessage(); |
|
| 654 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
| 653 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
| 654 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
| 655 | 655 | return; |
| 656 | 656 | } |
| 657 | 657 | // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received. |
@@ -667,8 +667,8 @@ discard block |
||
| 667 | 667 | bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn); |
| 668 | 668 | header('HTTP/1.0 202 Accepted'); |
| 669 | 669 | } catch (Exception $e) { |
| 670 | - $error = 'Caught exception: '.$e->getMessage(); |
|
| 671 | - header('HTTP/1.0 503 Service Unavailable. '.$error); |
|
| 670 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
| 671 | + header('HTTP/1.0 503 Service Unavailable. ' . $error); |
|
| 672 | 672 | } |
| 673 | 673 | } |
| 674 | 674 | |
@@ -689,13 +689,13 @@ discard block |
||
| 689 | 689 | $importrecordings = $SESSION->bigbluebuttonbn_importrecordings; |
| 690 | 690 | if (!isset($importrecordings[$params['id']])) { |
| 691 | 691 | $error = "Recording {$params['id']} could not be found. It can not be imported"; |
| 692 | - header('HTTP/1.0 404 Not found. '.$error); |
|
| 692 | + header('HTTP/1.0 404 Not found. ' . $error); |
|
| 693 | 693 | return; |
| 694 | 694 | } |
| 695 | 695 | $callbackresponse = array('status' => true); |
| 696 | 696 | $importrecordings[$params['id']]['imported'] = true; |
| 697 | 697 | $overrides = array('meetingid' => $importrecordings[$params['id']]['meetingID']); |
| 698 | - $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}'; |
|
| 698 | + $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}'; |
|
| 699 | 699 | bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta); |
| 700 | 700 | // Moodle event logger: Create an event for recording imported. |
| 701 | 701 | if (isset($bbbsession['bigbluebutton']) && isset($bbbsession['cm'])) { |
@@ -721,8 +721,8 @@ discard block |
||
| 721 | 721 | $decodedparameters = JWT::decode($params['signed_parameters'], |
| 722 | 722 | \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256')); |
| 723 | 723 | } catch (Exception $e) { |
| 724 | - $error = 'Caught exception: '.$e->getMessage(); |
|
| 725 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
| 724 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
| 725 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
| 726 | 726 | return; |
| 727 | 727 | } |
| 728 | 728 | // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received. |
@@ -763,7 +763,7 @@ discard block |
||
| 763 | 763 | } |
| 764 | 764 | $action = strtolower($params['action']); |
| 765 | 765 | if (!array_key_exists($action, $requiredparams)) { |
| 766 | - return 'Action '.$params['action'].' can not be performed.'; |
|
| 766 | + return 'Action ' . $params['action'] . ' can not be performed.'; |
|
| 767 | 767 | } |
| 768 | 768 | return bigbluebuttonbn_broker_validate_parameters_message($params, $requiredparams[$action]); |
| 769 | 769 | } |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | * @uses FEATURE_GRADE_OUTCOMES |
| 98 | 98 | * @uses FEATURE_SHOW_DESCRIPTION |
| 99 | 99 | * @param string $feature |
| 100 | - * @return mixed True if yes (some features may use other values) |
|
| 100 | + * @return null|boolean True if yes (some features may use other values) |
|
| 101 | 101 | */ |
| 102 | 102 | function bigbluebuttonbn_supports($feature) { |
| 103 | 103 | if (!$feature) { |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | * @param object $mod |
| 240 | 240 | * @param object $bigbluebuttonbn |
| 241 | 241 | * |
| 242 | - * @return bool |
|
| 242 | + * @return string |
|
| 243 | 243 | */ |
| 244 | 244 | function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) { |
| 245 | 245 | global $DB; |
@@ -542,7 +542,7 @@ discard block |
||
| 542 | 542 | * @param stdClass $context context object |
| 543 | 543 | * @param string $filearea file area |
| 544 | 544 | * |
| 545 | - * @return false|null false if file not valid |
|
| 545 | + * @return boolean false if file not valid |
|
| 546 | 546 | */ |
| 547 | 547 | function bigbluebuttonbn_pluginfile_valid($context, $filearea) { |
| 548 | 548 | if ($context->contextlevel != CONTEXT_MODULE) { |
@@ -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 | } |
@@ -28,32 +28,32 @@ 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->libdir.'/accesslib.php'); |
|
| 35 | -require_once($CFG->libdir.'/completionlib.php'); |
|
| 36 | -require_once($CFG->libdir.'/datalib.php'); |
|
| 37 | -require_once($CFG->libdir.'/coursecatlib.php'); |
|
| 38 | -require_once($CFG->libdir.'/enrollib.php'); |
|
| 39 | -require_once($CFG->libdir.'/filelib.php'); |
|
| 40 | -require_once($CFG->libdir.'/formslib.php'); |
|
| 41 | - |
|
| 42 | -if (file_exists(dirname(__FILE__).'/vendor/firebase/php-jwt/src/JWT.php')) { |
|
| 43 | - require_once(dirname(__FILE__).'/vendor/firebase/php-jwt/src/JWT.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->libdir . '/accesslib.php'); |
|
| 35 | +require_once($CFG->libdir . '/completionlib.php'); |
|
| 36 | +require_once($CFG->libdir . '/datalib.php'); |
|
| 37 | +require_once($CFG->libdir . '/coursecatlib.php'); |
|
| 38 | +require_once($CFG->libdir . '/enrollib.php'); |
|
| 39 | +require_once($CFG->libdir . '/filelib.php'); |
|
| 40 | +require_once($CFG->libdir . '/formslib.php'); |
|
| 41 | + |
|
| 42 | +if (file_exists(dirname(__FILE__) . '/vendor/firebase/php-jwt/src/JWT.php')) { |
|
| 43 | + require_once(dirname(__FILE__) . '/vendor/firebase/php-jwt/src/JWT.php'); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | if (!isset($CFG->bigbluebuttonbn)) { |
| 47 | 47 | $CFG->bigbluebuttonbn = array(); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | -if (file_exists(dirname(__FILE__).'/config.php')) { |
|
| 51 | - require_once(dirname(__FILE__).'/config.php'); |
|
| 50 | +if (file_exists(dirname(__FILE__) . '/config.php')) { |
|
| 51 | + require_once(dirname(__FILE__) . '/config.php'); |
|
| 52 | 52 | // Old BigBlueButtonBN cfg schema. For backward compatibility. |
| 53 | 53 | global $BIGBLUEBUTTONBN_CFG; |
| 54 | 54 | |
| 55 | 55 | if (isset($BIGBLUEBUTTONBN_CFG)) { |
| 56 | - foreach ((array) $BIGBLUEBUTTONBN_CFG as $key => $value) { |
|
| 56 | + foreach ((array)$BIGBLUEBUTTONBN_CFG as $key => $value) { |
|
| 57 | 57 | $cfgkey = str_replace("bigbluebuttonbn_", "", $key); |
| 58 | 58 | $CFG->bigbluebuttonbn[$cfgkey] = $value; |
| 59 | 59 | } |
@@ -104,18 +104,18 @@ discard block |
||
| 104 | 104 | return null; |
| 105 | 105 | } |
| 106 | 106 | $features = array( |
| 107 | - (string) FEATURE_IDNUMBER => true, |
|
| 108 | - (string) FEATURE_GROUPS => true, |
|
| 109 | - (string) FEATURE_GROUPINGS => true, |
|
| 110 | - (string) FEATURE_GROUPMEMBERSONLY => true, |
|
| 111 | - (string) FEATURE_MOD_INTRO => true, |
|
| 112 | - (string) FEATURE_BACKUP_MOODLE2 => true, |
|
| 113 | - (string) FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
| 114 | - (string) FEATURE_GRADE_HAS_GRADE => false, |
|
| 115 | - (string) FEATURE_GRADE_OUTCOMES => false, |
|
| 116 | - (string) FEATURE_SHOW_DESCRIPTION => true, |
|
| 107 | + (string)FEATURE_IDNUMBER => true, |
|
| 108 | + (string)FEATURE_GROUPS => true, |
|
| 109 | + (string)FEATURE_GROUPINGS => true, |
|
| 110 | + (string)FEATURE_GROUPMEMBERSONLY => true, |
|
| 111 | + (string)FEATURE_MOD_INTRO => true, |
|
| 112 | + (string)FEATURE_BACKUP_MOODLE2 => true, |
|
| 113 | + (string)FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
| 114 | + (string)FEATURE_GRADE_HAS_GRADE => false, |
|
| 115 | + (string)FEATURE_GRADE_OUTCOMES => false, |
|
| 116 | + (string)FEATURE_SHOW_DESCRIPTION => true, |
|
| 117 | 117 | ); |
| 118 | - if (isset($features[(string) $feature])) { |
|
| 118 | + if (isset($features[(string)$feature])) { |
|
| 119 | 119 | return $features[$feature]; |
| 120 | 120 | } |
| 121 | 121 | return null; |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | $log->timecreated = time(); |
| 216 | 216 | $log->log = BIGBLUEBUTTONBN_LOG_EVENT_DELETE; |
| 217 | 217 | $sql = "SELECT * FROM {bigbluebuttonbn_logs} "; |
| 218 | - $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND ". $DB->sql_compare_text('meta') . " = ?"; |
|
| 218 | + $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND " . $DB->sql_compare_text('meta') . " = ?"; |
|
| 219 | 219 | $logs = $DB->get_records_sql($sql, array($bigbluebuttonbn->id, BIGBLUEBUTTONBN_LOG_EVENT_CREATE, "{\"record\":true}")); |
| 220 | 220 | $log->meta = "{\"has_recordings\":false}"; |
| 221 | 221 | if (!empty($logs)) { |
@@ -244,10 +244,10 @@ discard block |
||
| 244 | 244 | function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) { |
| 245 | 245 | global $DB; |
| 246 | 246 | $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id, |
| 247 | - 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join', ), '*'); |
|
| 247 | + 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join',), '*'); |
|
| 248 | 248 | if ($completed > 0) { |
| 249 | - return fullname($user).' '.get_string('view_message_has_joined', 'bigbluebuttonbn').' '. |
|
| 250 | - get_string('view_message_session_for', 'bigbluebuttonbn').' '.(string) $completed.' '. |
|
| 249 | + return fullname($user) . ' ' . get_string('view_message_has_joined', 'bigbluebuttonbn') . ' ' . |
|
| 250 | + get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string)$completed . ' ' . |
|
| 251 | 251 | get_string('view_message_times', 'bigbluebuttonbn'); |
| 252 | 252 | } |
| 253 | 253 | return ''; |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | function bigbluebuttonbn_user_complete($course, $user, $mod, $bigbluebuttonbn) { |
| 268 | 268 | global $DB; |
| 269 | 269 | $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id, |
| 270 | - 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join', ), |
|
| 270 | + 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join',), |
|
| 271 | 271 | '*', IGNORE_MULTIPLE); |
| 272 | 272 | return $completed > 0; |
| 273 | 273 | } |
@@ -342,16 +342,16 @@ discard block |
||
| 342 | 342 | if ($bigbluebuttonbn->visible) { |
| 343 | 343 | $classes = 'class="dimmed" '; |
| 344 | 344 | } |
| 345 | - $str = '<div class="bigbluebuttonbn overview">'."\n"; |
|
| 346 | - $str .= ' <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; |
|
| 347 | - $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule. |
|
| 348 | - '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
| 349 | - $str .= ' </div>'."\n"; |
|
| 350 | - $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime). |
|
| 351 | - '</div>'."\n"; |
|
| 352 | - $str .= ' <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) |
|
| 353 | - .'</div>'."\n"; |
|
| 354 | - $str .= '</div>'."\n"; |
|
| 345 | + $str = '<div class="bigbluebuttonbn overview">' . "\n"; |
|
| 346 | + $str .= ' <div class="name">' . get_string('modulename', 'bigbluebuttonbn') . ': ' . "\n"; |
|
| 347 | + $str .= ' <a ' . $classes . 'href="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bigbluebuttonbn->coursemodule . |
|
| 348 | + '">' . $bigbluebuttonbn->name . '</a>' . "\n"; |
|
| 349 | + $str .= ' </div>' . "\n"; |
|
| 350 | + $str .= ' <div class="info">' . get_string($start, 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->openingtime) . |
|
| 351 | + '</div>' . "\n"; |
|
| 352 | + $str .= ' <div class="info">' . get_string('ends_at', 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->closingtime) |
|
| 353 | + .'</div>' . "\n"; |
|
| 354 | + $str .= '</div>' . "\n"; |
|
| 355 | 355 | return $str; |
| 356 | 356 | } |
| 357 | 357 | |
@@ -505,7 +505,7 @@ discard block |
||
| 505 | 505 | if (count($files) == 1) { |
| 506 | 506 | // Get the first (and only) file. |
| 507 | 507 | $file = reset($files); |
| 508 | - $filesrc = '/'.$file->get_filename(); |
|
| 508 | + $filesrc = '/' . $file->get_filename(); |
|
| 509 | 509 | } |
| 510 | 510 | return $filesrc; |
| 511 | 511 | } |
@@ -573,7 +573,7 @@ discard block |
||
| 573 | 573 | if (!$filename) { |
| 574 | 574 | return false; |
| 575 | 575 | } |
| 576 | - $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename; |
|
| 576 | + $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename; |
|
| 577 | 577 | $fs = get_file_storage(); |
| 578 | 578 | $file = $fs->get_file_by_hash(sha1($fullpath)); |
| 579 | 579 | if (!$file || $file->is_directory()) { |
@@ -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. |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | 'alt' => $contents, |
| 105 | 105 | 'title' => $contents, |
| 106 | 106 | 'src' => $jsvars['pix_icon_delete'] |
| 107 | - ); |
|
| 107 | + ); |
|
| 108 | 108 | $jsvars['pix_icon_delete'] = html_writer::tag('img', '', $options); |
| 109 | 109 | } |
| 110 | 110 | $PAGE->requires->yui_module('moodle-mod_bigbluebuttonbn-modform', |
@@ -224,8 +224,8 @@ discard block |
||
| 224 | 224 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
| 225 | 225 | $field['description_key'], 0, ['maxlength' => 4, 'size' => 6], |
| 226 | 226 | ['message' => get_string('mod_form_field_voicebridge_format_error', 'bigbluebuttonbn'), |
| 227 | - 'type' => 'numeric', 'rule' => '####', 'validator' => 'server'] |
|
| 228 | - ); |
|
| 227 | + 'type' => 'numeric', 'rule' => '####', 'validator' => 'server'] |
|
| 228 | + ); |
|
| 229 | 229 | } else { |
| 230 | 230 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
| 231 | 231 | $field['description_key'], 0, ['maxlength' => 4, 'size' => 6]); |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | */ |
| 264 | 264 | private function bigbluebuttonbn_mform_add_block_room_recordings(&$mform, $cfg) { |
| 265 | 265 | $field = ['type' => 'hidden', 'name' => 'recordings_html', 'data_type' => PARAM_INT, |
| 266 | - 'description_key' => null]; |
|
| 266 | + 'description_key' => null]; |
|
| 267 | 267 | if ($cfg['recordings_html_editable']) { |
| 268 | 268 | $field['type'] = 'checkbox'; |
| 269 | 269 | $field['description_key'] = 'mod_form_field_recordings_html'; |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
| 272 | 272 | $field['description_key'], $cfg['recordings_html_default']); |
| 273 | 273 | $field = ['type' => 'hidden', 'name' => 'recordings_deleted', 'data_type' => PARAM_INT, |
| 274 | - 'description_key' => null]; |
|
| 274 | + 'description_key' => null]; |
|
| 275 | 275 | if ($cfg['recordings_deleted_editable']) { |
| 276 | 276 | $field['type'] = 'checkbox'; |
| 277 | 277 | $field['description_key'] = 'mod_form_field_recordings_deleted'; |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
| 280 | 280 | $field['description_key'], $cfg['recordings_deleted_default']); |
| 281 | 281 | $field = ['type' => 'hidden', 'name' => 'recordings_imported', 'data_type' => PARAM_INT, |
| 282 | - 'description_key' => null]; |
|
| 282 | + 'description_key' => null]; |
|
| 283 | 283 | if ($cfg['recordings_imported_editable']) { |
| 284 | 284 | $field['type'] = 'checkbox'; |
| 285 | 285 | $field['description_key'] = 'mod_form_field_recordings_imported'; |
@@ -349,7 +349,7 @@ discard block |
||
| 349 | 349 | $htmlselectiontype = html_writer::select($participantselection['type_options'], |
| 350 | 350 | 'bigbluebuttonbn_participant_selection_type', $participantselection['type_selected'], array(), |
| 351 | 351 | array('id' => 'bigbluebuttonbn_participant_selection_type', |
| 352 | - 'onchange' => 'M.mod_bigbluebuttonbn.modform.participantSelectionSet(); return 0;')); |
|
| 352 | + 'onchange' => 'M.mod_bigbluebuttonbn.modform.participantSelectionSet(); return 0;')); |
|
| 353 | 353 | $htmlselectionoptions = html_writer::select($participantselection['options'], 'bigbluebuttonbn_participant_selection', |
| 354 | 354 | $participantselection['selected'], array(), |
| 355 | 355 | array('id' => 'bigbluebuttonbn_participant_selection', 'disabled' => 'disabled')); |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | 'type' => 'button', 'class' => 'btn btn-secondary', |
| 358 | 358 | 'value' => get_string('mod_form_field_participant_list_action_add', 'bigbluebuttonbn'), |
| 359 | 359 | 'onclick' => 'M.mod_bigbluebuttonbn.modform.participantAdd(); return 0;' |
| 360 | - )); |
|
| 360 | + )); |
|
| 361 | 361 | $htmladdparticipant = html_writer::tag('div', |
| 362 | 362 | $htmlselectiontype . ' ' . $htmlselectionoptions . ' ' . $htmlselectioninput, null); |
| 363 | 363 | $mform->addElement('html', "\n\n"); |
@@ -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)) { |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | public static function notification_process($context, $bigbluebuttonbn, $action) { |
| 48 | 48 | global $USER; |
| 49 | 49 | // Prepare message. |
| 50 | - $msg = (object) array(); |
|
| 50 | + $msg = (object)array(); |
|
| 51 | 51 | // Build the message_body. |
| 52 | 52 | $msg->action = $action; |
| 53 | 53 | $msg->activity_type = ''; |
@@ -72,26 +72,26 @@ discard block |
||
| 72 | 72 | * @return string |
| 73 | 73 | */ |
| 74 | 74 | public static function notification_msg_html($msg) { |
| 75 | - $messagetext = '<p>'.$msg->activity_type.' "'.$msg->activity_title.'" '. |
|
| 76 | - get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn').' '.$msg->action.'.</p>'."\n"; |
|
| 77 | - $messagetext .= '<p><b>'.$msg->activity_title.'</b> '. |
|
| 78 | - get_string('email_body_notification_meeting_details', 'bigbluebuttonbn').':'."\n"; |
|
| 79 | - $messagetext .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>'."\n"; |
|
| 80 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'. |
|
| 81 | - get_string('email_body_notification_meeting_title', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
| 82 | - $messagetext .= $msg->activity_title.'</td></tr>'."\n"; |
|
| 83 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'. |
|
| 84 | - get_string('email_body_notification_meeting_description', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
| 85 | - $messagetext .= $msg->activity_description.'</td></tr>'."\n"; |
|
| 86 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'. |
|
| 87 | - get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
| 88 | - $messagetext .= $msg->activity_openingtime.'</td></tr>'."\n"; |
|
| 89 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'. |
|
| 90 | - get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
| 91 | - $messagetext .= $msg->activity_closingtime.'</td></tr>'."\n"; |
|
| 92 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.$msg->action.' '. |
|
| 93 | - get_string('email_body_notification_meeting_by', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
| 94 | - $messagetext .= $msg->activity_owner.'</td></tr></tbody></table></p>'."\n"; |
|
| 75 | + $messagetext = '<p>' . $msg->activity_type . ' "' . $msg->activity_title . '" ' . |
|
| 76 | + get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn') . ' ' . $msg->action . '.</p>' . "\n"; |
|
| 77 | + $messagetext .= '<p><b>' . $msg->activity_title . '</b> ' . |
|
| 78 | + get_string('email_body_notification_meeting_details', 'bigbluebuttonbn') . ':' . "\n"; |
|
| 79 | + $messagetext .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>' . "\n"; |
|
| 80 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . |
|
| 81 | + get_string('email_body_notification_meeting_title', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
| 82 | + $messagetext .= $msg->activity_title . '</td></tr>' . "\n"; |
|
| 83 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . |
|
| 84 | + get_string('email_body_notification_meeting_description', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
| 85 | + $messagetext .= $msg->activity_description . '</td></tr>' . "\n"; |
|
| 86 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . |
|
| 87 | + get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
| 88 | + $messagetext .= $msg->activity_openingtime . '</td></tr>' . "\n"; |
|
| 89 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . |
|
| 90 | + get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
| 91 | + $messagetext .= $msg->activity_closingtime . '</td></tr>' . "\n"; |
|
| 92 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . $msg->action . ' ' . |
|
| 93 | + get_string('email_body_notification_meeting_by', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
| 94 | + $messagetext .= $msg->activity_owner . '</td></tr></tbody></table></p>' . "\n"; |
|
| 95 | 95 | return $messagetext; |
| 96 | 96 | } |
| 97 | 97 | |
@@ -108,14 +108,14 @@ discard block |
||
| 108 | 108 | global $DB; |
| 109 | 109 | $course = $DB->get_record('course', array('id' => $bigbluebuttonbn->course), '*', MUST_EXIST); |
| 110 | 110 | // Complete message. |
| 111 | - $msg = (object) array(); |
|
| 111 | + $msg = (object)array(); |
|
| 112 | 112 | $msg->user_name = fullname($sender); |
| 113 | 113 | $msg->user_email = $sender->email; |
| 114 | 114 | $msg->course_name = "$course->fullname"; |
| 115 | - $message .= '<p><hr/><br/>'.get_string('email_footer_sent_by', 'bigbluebuttonbn').' '. |
|
| 116 | - $msg->user_name.'('.$msg->user_email.') '; |
|
| 117 | - $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn').' '.$msg->course_name.'.</p>'; |
|
| 118 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
| 115 | + $message .= '<p><hr/><br/>' . get_string('email_footer_sent_by', 'bigbluebuttonbn') . ' ' . |
|
| 116 | + $msg->user_name . '(' . $msg->user_email . ') '; |
|
| 117 | + $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn') . ' ' . $msg->course_name . '.</p>'; |
|
| 118 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
| 119 | 119 | foreach ($users as $user) { |
| 120 | 120 | if ($user->id != $sender->id) { |
| 121 | 121 | message_post_message($sender, $user, $message, FORMAT_HTML); |
@@ -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 | $a = optional_param('a', 0, PARAM_INT); |
@@ -88,12 +88,12 @@ discard block |
||
| 88 | 88 | if ($moderator || $administrator) { |
| 89 | 89 | bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_ENDED, $bigbluebuttonbn, $cm); |
| 90 | 90 | echo get_string('index_ending', 'bigbluebuttonbn'); |
| 91 | - $meetingid = $bigbluebuttonbn->meetingid.'-'.$course->id.'-'.$bigbluebuttonbn->id; |
|
| 91 | + $meetingid = $bigbluebuttonbn->meetingid . '-' . $course->id . '-' . $bigbluebuttonbn->id; |
|
| 92 | 92 | if ($g != '0') { |
| 93 | - $meetingid .= '['.$g.']'; |
|
| 93 | + $meetingid .= '[' . $g . ']'; |
|
| 94 | 94 | } |
| 95 | 95 | bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getEndMeetingURL($meetingid)); |
| 96 | - redirect('index.php?id='.$id); |
|
| 96 | + redirect('index.php?id=' . $id); |
|
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | // Add a the data for the bigbluebuttonbn instance. |
| 108 | 108 | $groupobj = null; |
| 109 | 109 | if (groups_get_activity_groupmode($cm) > 0) { |
| 110 | - $groupobj = (object) array('id' => 0, 'name' => get_string('allparticipants')); |
|
| 110 | + $groupobj = (object)array('id' => 0, 'name' => get_string('allparticipants')); |
|
| 111 | 111 | } |
| 112 | 112 | $table->data[] = bigbluebuttonbn_index_display_room($canmoderate, $course, $bigbluebuttonbn, $groupobj); |
| 113 | 113 | // Add a the data for the groups belonging to the bigbluebuttonbn instance, if any. |
@@ -133,12 +133,12 @@ discard block |
||
| 133 | 133 | * @return array |
| 134 | 134 | */ |
| 135 | 135 | function bigbluebuttonbn_index_display_room($moderator, $course, $bigbluebuttonbn, $groupobj = null) { |
| 136 | - $meetingid = $bigbluebuttonbn->meetingid.'-'.$course->id.'-'.$bigbluebuttonbn->id; |
|
| 136 | + $meetingid = $bigbluebuttonbn->meetingid . '-' . $course->id . '-' . $bigbluebuttonbn->id; |
|
| 137 | 137 | $paramgroup = ''; |
| 138 | 138 | $groupname = ''; |
| 139 | 139 | if ($groupobj) { |
| 140 | - $meetingid .= '['.$groupobj->id.']'; |
|
| 141 | - $paramgroup = '&group='.$groupobj->id; |
|
| 140 | + $meetingid .= '[' . $groupobj->id . ']'; |
|
| 141 | + $paramgroup = '&group=' . $groupobj->id; |
|
| 142 | 142 | $groupname = $groupobj->name; |
| 143 | 143 | } |
| 144 | 144 | $meetinginfo = bigbluebuttonbn_get_meeting_info_array($meetingid); |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | return; |
| 154 | 154 | } |
| 155 | 155 | // Output Users in the meeting. |
| 156 | - $joinurl = '<a href="view.php?id='.$bigbluebuttonbn->coursemodule.$paramgroup.'">'.format_string($bigbluebuttonbn->name).'</a>'; |
|
| 156 | + $joinurl = '<a href="view.php?id=' . $bigbluebuttonbn->coursemodule . $paramgroup . '">' . format_string($bigbluebuttonbn->name) . '</a>'; |
|
| 157 | 157 | $group = $groupname; |
| 158 | 158 | $users = ''; |
| 159 | 159 | $viewerlist = ''; |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | $attendeecount = 0; |
| 199 | 199 | foreach ($meetinginfo['attendees']->attendee as $attendee) { |
| 200 | 200 | if ($attendee->role == $role) { |
| 201 | - $attendeelist .= ($attendeecount++ > 0 ? ', ' : '').$attendee->fullName; |
|
| 201 | + $attendeelist .= ($attendeecount++ > 0 ? ', ' : '') . $attendee->fullName; |
|
| 202 | 202 | } |
| 203 | 203 | } |
| 204 | 204 | } |
@@ -232,15 +232,15 @@ discard block |
||
| 232 | 232 | function bigbluebuttonbn_index_display_room_actions($moderator, $course, $bigbluebuttonbn, $groupobj = null) { |
| 233 | 233 | $actions = ''; |
| 234 | 234 | if ($moderator) { |
| 235 | - $actions .= '<form name="form1" method="post" action="">'.'/n'; |
|
| 236 | - $actions .= ' <INPUT type="hidden" name="id" value="'.$course->id.'">'.'/n'; |
|
| 237 | - $actions .= ' <INPUT type="hidden" name="a" value="'.$bigbluebuttonbn->id.'">'.'/n'; |
|
| 235 | + $actions .= '<form name="form1" method="post" action="">' . '/n'; |
|
| 236 | + $actions .= ' <INPUT type="hidden" name="id" value="' . $course->id . '">' . '/n'; |
|
| 237 | + $actions .= ' <INPUT type="hidden" name="a" value="' . $bigbluebuttonbn->id . '">' . '/n'; |
|
| 238 | 238 | if ($groupobj != null) { |
| 239 | - $actions .= ' <INPUT type="hidden" name="g" value="'.$groupobj->id.'">'.'/n'; |
|
| 239 | + $actions .= ' <INPUT type="hidden" name="g" value="' . $groupobj->id . '">' . '/n'; |
|
| 240 | 240 | } |
| 241 | - $actions .= ' <INPUT type="submit" name="submit" value="end" onclick="return confirm(\''. |
|
| 242 | - get_string('index_confirm_end', 'bigbluebuttonbn').'\')">'.'/n'; |
|
| 243 | - $actions .= '</form>'.'/n'; |
|
| 241 | + $actions .= ' <INPUT type="submit" name="submit" value="end" onclick="return confirm(\'' . |
|
| 242 | + get_string('index_confirm_end', 'bigbluebuttonbn') . '\')">' . '/n'; |
|
| 243 | + $actions .= '</form>' . '/n'; |
|
| 244 | 244 | } |
| 245 | 245 | return $actions; |
| 246 | 246 | } |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | * Helper function to retrieve imported recordings from the Moodle database. |
| 293 | 293 | * The references are stored as events in bigbluebuttonbn_logs. |
| 294 | 294 | * |
| 295 | - * @param string $courseid |
|
| 295 | + * @param integer $courseid |
|
| 296 | 296 | * @param string $bigbluebuttonbnid |
| 297 | 297 | * @param bool $subset |
| 298 | 298 | * |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | /** |
| 321 | 321 | * Helper function to retrive the default config.xml file. |
| 322 | 322 | * |
| 323 | - * @return string |
|
| 323 | + * @return null|SimpleXMLElement |
|
| 324 | 324 | */ |
| 325 | 325 | function bigbluebuttonbn_get_default_config_xml() { |
| 326 | 326 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | * @param object $a |
| 392 | 392 | * @param object $b |
| 393 | 393 | * |
| 394 | - * @return array |
|
| 394 | + * @return integer |
|
| 395 | 395 | */ |
| 396 | 396 | function bigbluebuttonbn_recording_build_sorter($a, $b) { |
| 397 | 397 | if ($a['startTime'] < $b['startTime']) { |
@@ -517,7 +517,7 @@ discard block |
||
| 517 | 517 | * @param string $data |
| 518 | 518 | * @param string $contenttype |
| 519 | 519 | * |
| 520 | - * @return object |
|
| 520 | + * @return null|SimpleXMLElement |
|
| 521 | 521 | */ |
| 522 | 522 | function bigbluebuttonbn_wrap_xml_load_file($url, $method = 'GET', $data = null, $contenttype = 'text/xml') { |
| 523 | 523 | if (extension_loaded('curl')) { |
@@ -558,7 +558,7 @@ discard block |
||
| 558 | 558 | * @param string $data |
| 559 | 559 | * @param string $contenttype |
| 560 | 560 | * |
| 561 | - * @return object |
|
| 561 | + * @return string |
|
| 562 | 562 | */ |
| 563 | 563 | function bigbluebuttonbn_wrap_xml_load_file_curl_request($url, $method = 'GET', $data = null, $contenttype = 'text/xml') { |
| 564 | 564 | $c = new curl(); |
@@ -922,7 +922,7 @@ discard block |
||
| 922 | 922 | * |
| 923 | 923 | * @param integer $voicebridge |
| 924 | 924 | * |
| 925 | - * @return string |
|
| 925 | + * @return boolean |
|
| 926 | 926 | */ |
| 927 | 927 | function bigbluebuttonbn_voicebridge_unique($voicebridge) { |
| 928 | 928 | global $DB; |
@@ -1021,7 +1021,7 @@ discard block |
||
| 1021 | 1021 | /** |
| 1022 | 1022 | * Helper returns an array with all possible bigbluebuttonbn events. |
| 1023 | 1023 | * |
| 1024 | - * @return array |
|
| 1024 | + * @return string[] |
|
| 1025 | 1025 | */ |
| 1026 | 1026 | function bigbluebuttonbn_events() { |
| 1027 | 1027 | return array( |
@@ -1230,7 +1230,7 @@ discard block |
||
| 1230 | 1230 | * @param string $meetingid |
| 1231 | 1231 | * @param string $configxml |
| 1232 | 1232 | * |
| 1233 | - * @return object |
|
| 1233 | + * @return null|SimpleXMLElement |
|
| 1234 | 1234 | */ |
| 1235 | 1235 | function bigbluebuttonbn_set_config_xml($meetingid, $configxml) { |
| 1236 | 1236 | $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?'; |
@@ -1279,7 +1279,7 @@ discard block |
||
| 1279 | 1279 | * @param array $recording |
| 1280 | 1280 | * @param array $tools |
| 1281 | 1281 | * |
| 1282 | - * @return array |
|
| 1282 | + * @return null|stdClass |
|
| 1283 | 1283 | */ |
| 1284 | 1284 | function bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools = ['protect', 'publish', 'delete']) { |
| 1285 | 1285 | if (!bigbluebuttonbn_include_recording_table_row($bbbsession, $recording)) { |
@@ -1781,7 +1781,7 @@ discard block |
||
| 1781 | 1781 | * |
| 1782 | 1782 | * @param array $bbbsession |
| 1783 | 1783 | * @param array $recording |
| 1784 | - * @param object $rowdata |
|
| 1784 | + * @param stdClass $rowdata |
|
| 1785 | 1785 | * |
| 1786 | 1786 | * @return object |
| 1787 | 1787 | */ |
@@ -1969,7 +1969,7 @@ discard block |
||
| 1969 | 1969 | * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included |
| 1970 | 1970 | * in the getRecordings request considering only those that belong to deleted activities. |
| 1971 | 1971 | * |
| 1972 | - * @param string $courseid |
|
| 1972 | + * @param integer $courseid |
|
| 1973 | 1973 | * @param string $bigbluebuttonbnid |
| 1974 | 1974 | * @param bool $subset |
| 1975 | 1975 | * |
@@ -1993,7 +1993,7 @@ discard block |
||
| 1993 | 1993 | * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included |
| 1994 | 1994 | * in the getRecordings request considering only those that belong to imported recordings. |
| 1995 | 1995 | * |
| 1996 | - * @param string $courseid |
|
| 1996 | + * @param integer $courseid |
|
| 1997 | 1997 | * @param string $bigbluebuttonbnid |
| 1998 | 1998 | * @param bool $subset |
| 1999 | 1999 | * |
@@ -2016,7 +2016,7 @@ discard block |
||
| 2016 | 2016 | /** |
| 2017 | 2017 | * Helper function to get recordings and imported recordings together. |
| 2018 | 2018 | * |
| 2019 | - * @param string $courseid |
|
| 2019 | + * @param integer $courseid |
|
| 2020 | 2020 | * @param string $bigbluebuttonbnid |
| 2021 | 2021 | * @param bool $subset |
| 2022 | 2022 | * @param bool $includedeleted |
@@ -2034,7 +2034,7 @@ discard block |
||
| 2034 | 2034 | * Helper function to retrieve recordings from the BigBlueButton. The references are stored as events |
| 2035 | 2035 | * in bigbluebuttonbn_logs. |
| 2036 | 2036 | * |
| 2037 | - * @param string $courseid |
|
| 2037 | + * @param integer $courseid |
|
| 2038 | 2038 | * @param string $bigbluebuttonbnid |
| 2039 | 2039 | * @param bool $subset |
| 2040 | 2040 | * @param bool $includedeleted |
@@ -119,9 +119,9 @@ discard block |
||
| 119 | 119 | */ |
| 120 | 120 | function bigbluebuttonbn_get_join_url($meetingid, $username, $pw, $logouturl, $configtoken = null, $userid = null) { |
| 121 | 121 | $data = ['meetingID' => $meetingid, |
| 122 | - 'fullName' => $username, |
|
| 123 | - 'password' => $pw, |
|
| 124 | - 'logoutURL' => $logouturl, |
|
| 122 | + 'fullName' => $username, |
|
| 123 | + 'password' => $pw, |
|
| 124 | + 'logoutURL' => $logouturl, |
|
| 125 | 125 | ]; |
| 126 | 126 | if (!is_null($configtoken)) { |
| 127 | 127 | $data['configToken'] = $configtoken; |
@@ -173,23 +173,23 @@ discard block |
||
| 173 | 173 | function bigbluebuttonbn_get_meeting_info_array($meetingid) { |
| 174 | 174 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 175 | 175 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
| 176 | - ); |
|
| 176 | + ); |
|
| 177 | 177 | if ($xml && $xml->returncode == 'SUCCESS' && empty($xml->messageKey)) { |
| 178 | 178 | // Meeting info was returned. |
| 179 | 179 | return array('returncode' => $xml->returncode, |
| 180 | - 'meetingID' => $xml->meetingID, |
|
| 181 | - 'moderatorPW' => $xml->moderatorPW, |
|
| 182 | - 'attendeePW' => $xml->attendeePW, |
|
| 183 | - 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded, |
|
| 184 | - 'running' => $xml->running, |
|
| 185 | - 'recording' => $xml->recording, |
|
| 186 | - 'startTime' => $xml->startTime, |
|
| 187 | - 'endTime' => $xml->endTime, |
|
| 188 | - 'participantCount' => $xml->participantCount, |
|
| 189 | - 'moderatorCount' => $xml->moderatorCount, |
|
| 190 | - 'attendees' => $xml->attendees, |
|
| 191 | - 'metadata' => $xml->metadata, |
|
| 192 | - ); |
|
| 180 | + 'meetingID' => $xml->meetingID, |
|
| 181 | + 'moderatorPW' => $xml->moderatorPW, |
|
| 182 | + 'attendeePW' => $xml->attendeePW, |
|
| 183 | + 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded, |
|
| 184 | + 'running' => $xml->running, |
|
| 185 | + 'recording' => $xml->recording, |
|
| 186 | + 'startTime' => $xml->startTime, |
|
| 187 | + 'endTime' => $xml->endTime, |
|
| 188 | + 'participantCount' => $xml->participantCount, |
|
| 189 | + 'moderatorCount' => $xml->moderatorCount, |
|
| 190 | + 'attendees' => $xml->attendees, |
|
| 191 | + 'metadata' => $xml->metadata, |
|
| 192 | + ); |
|
| 193 | 193 | } |
| 194 | 194 | if ($xml) { |
| 195 | 195 | // Either failure or success without meeting info. |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | function bigbluebuttonbn_get_default_config_xml() { |
| 326 | 326 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 327 | 327 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getDefaultConfigXML') |
| 328 | - ); |
|
| 328 | + ); |
|
| 329 | 329 | return $xml; |
| 330 | 330 | } |
| 331 | 331 | |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | foreach ($ids as $id) { |
| 427 | 427 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 428 | 428 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('deleteRecordings', ['recordID' => $id]) |
| 429 | - ); |
|
| 429 | + ); |
|
| 430 | 430 | if ($xml && $xml->returncode != 'SUCCESS') { |
| 431 | 431 | return false; |
| 432 | 432 | } |
@@ -445,7 +445,7 @@ discard block |
||
| 445 | 445 | foreach ($ids as $id) { |
| 446 | 446 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 447 | 447 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('publishRecordings', ['recordID' => $id, 'publish' => $publish]) |
| 448 | - ); |
|
| 448 | + ); |
|
| 449 | 449 | if ($xml && $xml->returncode != 'SUCCESS') { |
| 450 | 450 | return false; |
| 451 | 451 | } |
@@ -464,7 +464,7 @@ discard block |
||
| 464 | 464 | foreach ($ids as $id) { |
| 465 | 465 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 466 | 466 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params) |
| 467 | - ); |
|
| 467 | + ); |
|
| 468 | 468 | if ($xml && $xml->returncode != 'SUCCESS') { |
| 469 | 469 | return false; |
| 470 | 470 | } |
@@ -481,7 +481,7 @@ discard block |
||
| 481 | 481 | function bigbluebuttonbn_end_meeting($meetingid, $modpw) { |
| 482 | 482 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 483 | 483 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('end', ['meetingID' => $meetingid, 'password' => $modpw]) |
| 484 | - ); |
|
| 484 | + ); |
|
| 485 | 485 | if ($xml) { |
| 486 | 486 | // If the xml packet returned failure it displays the message to the user. |
| 487 | 487 | return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); |
@@ -501,7 +501,7 @@ discard block |
||
| 501 | 501 | */ |
| 502 | 502 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 503 | 503 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
| 504 | - ); |
|
| 504 | + ); |
|
| 505 | 505 | return ($xml && $xml->returncode == 'SUCCESS'); |
| 506 | 506 | } |
| 507 | 507 | |
@@ -513,7 +513,7 @@ discard block |
||
| 513 | 513 | function bigbluebuttonbn_get_server_version() { |
| 514 | 514 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 515 | 515 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url() |
| 516 | - ); |
|
| 516 | + ); |
|
| 517 | 517 | if ($xml && $xml->returncode == 'SUCCESS') { |
| 518 | 518 | return $xml->version; |
| 519 | 519 | } |
@@ -581,10 +581,10 @@ discard block |
||
| 581 | 581 | |
| 582 | 582 | $options = array(); |
| 583 | 583 | $options['CURLOPT_HTTPHEADER'] = array( |
| 584 | - 'Content-Type: '.$contenttype, |
|
| 585 | - 'Content-Length: '.strlen($data), |
|
| 586 | - 'Content-Language: en-US', |
|
| 587 | - ); |
|
| 584 | + 'Content-Type: '.$contenttype, |
|
| 585 | + 'Content-Length: '.strlen($data), |
|
| 586 | + 'Content-Language: en-US', |
|
| 587 | + ); |
|
| 588 | 588 | |
| 589 | 589 | return $c->post($url, $data, $options); |
| 590 | 590 | } |
@@ -727,16 +727,16 @@ discard block |
||
| 727 | 727 | 'all' => array( |
| 728 | 728 | 'name' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'), |
| 729 | 729 | 'children' => [] |
| 730 | - ) |
|
| 731 | - ); |
|
| 730 | + ) |
|
| 731 | + ); |
|
| 732 | 732 | $data['role'] = array( |
| 733 | 733 | 'name' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'), |
| 734 | 734 | 'children' => bigbluebuttonbn_get_roles_select($context) |
| 735 | - ); |
|
| 735 | + ); |
|
| 736 | 736 | $data['user'] = array( |
| 737 | 737 | 'name' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'), |
| 738 | 738 | 'children' => bigbluebuttonbn_get_users_select($context) |
| 739 | - ); |
|
| 739 | + ); |
|
| 740 | 740 | return $data; |
| 741 | 741 | } |
| 742 | 742 | |
@@ -781,9 +781,9 @@ discard block |
||
| 781 | 781 | continue; |
| 782 | 782 | } |
| 783 | 783 | $participantlistarray[] = array( |
| 784 | - 'selectiontype' => 'role', |
|
| 785 | - 'selectionid' => $moderatordefault, |
|
| 786 | - 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR); |
|
| 784 | + 'selectiontype' => 'role', |
|
| 785 | + 'selectionid' => $moderatordefault, |
|
| 786 | + 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR); |
|
| 787 | 787 | } |
| 788 | 788 | return $participantlistarray; |
| 789 | 789 | } |
@@ -826,11 +826,11 @@ discard block |
||
| 826 | 826 | 'all' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'), |
| 827 | 827 | 'role' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'), |
| 828 | 828 | 'user' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'), |
| 829 | - ], |
|
| 829 | + ], |
|
| 830 | 830 | 'type_selected' => 'all', |
| 831 | 831 | 'options' => ['all' => '---------------'], |
| 832 | 832 | 'selected' => 'all', |
| 833 | - ]; |
|
| 833 | + ]; |
|
| 834 | 834 | } |
| 835 | 835 | |
| 836 | 836 | /** |
@@ -1107,7 +1107,7 @@ discard block |
||
| 1107 | 1107 | $eventproperties['other'] = $options['other']; |
| 1108 | 1108 | } |
| 1109 | 1109 | $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create', |
| 1110 | - array($eventproperties)); |
|
| 1110 | + array($eventproperties)); |
|
| 1111 | 1111 | $event->trigger(); |
| 1112 | 1112 | } |
| 1113 | 1113 | |
@@ -1151,7 +1151,7 @@ discard block |
||
| 1151 | 1151 | // Ping again and refresh the cache. |
| 1152 | 1152 | $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file( |
| 1153 | 1153 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
| 1154 | - ); |
|
| 1154 | + ); |
|
| 1155 | 1155 | $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); |
| 1156 | 1156 | return $meetinginfo; |
| 1157 | 1157 | } |
@@ -1521,8 +1521,8 @@ discard block |
||
| 1521 | 1521 | } |
| 1522 | 1522 | $id = 'playbacks-'.$recording['recordID']; |
| 1523 | 1523 | $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported, |
| 1524 | - 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
|
| 1525 | - 'title' => $title, $visibility => $visibility)); |
|
| 1524 | + 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
|
| 1525 | + 'title' => $title, $visibility => $visibility)); |
|
| 1526 | 1526 | foreach ($recording['playbacks'] as $playback) { |
| 1527 | 1527 | $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bbbsession, $playback); |
| 1528 | 1528 | } |
@@ -1547,7 +1547,7 @@ discard block |
||
| 1547 | 1547 | $title = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'); |
| 1548 | 1548 | $onclick = 'M.mod_bigbluebuttonbn.recordings.recordingPlay(this);'; |
| 1549 | 1549 | $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bbbsession['bigbluebuttonbn']->id . |
| 1550 | - '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
| 1550 | + '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
| 1551 | 1551 | if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') { |
| 1552 | 1552 | $href .= '&href='.urlencode(trim($playback['url'])); |
| 1553 | 1553 | } |
@@ -1559,7 +1559,7 @@ discard block |
||
| 1559 | 1559 | 'data-target' => $playback['type'], |
| 1560 | 1560 | 'data-href' => $href, |
| 1561 | 1561 | 'class' => 'btn btn-sm btn-default' |
| 1562 | - ); |
|
| 1562 | + ); |
|
| 1563 | 1563 | return $OUTPUT->action_link('#', $title, null, $linkattributes) . ' '; |
| 1564 | 1564 | } |
| 1565 | 1565 | |
@@ -1673,10 +1673,10 @@ discard block |
||
| 1673 | 1673 | 'id' => $id, |
| 1674 | 1674 | 'onclick' => $onclick, |
| 1675 | 1675 | 'data-action' => $data['action'] |
| 1676 | - ); |
|
| 1676 | + ); |
|
| 1677 | 1677 | if (!isset($recording['imported'])) { |
| 1678 | 1678 | $linkattributes['data-links'] = bigbluebuttonbn_count_recording_imported_instances( |
| 1679 | - $recording['recordID']); |
|
| 1679 | + $recording['recordID']); |
|
| 1680 | 1680 | } |
| 1681 | 1681 | if (isset($data['disabled'])) { |
| 1682 | 1682 | $iconattributes['class'] .= ' fa-' . $data['disabled']; |
@@ -2214,8 +2214,8 @@ discard block |
||
| 2214 | 2214 | $activitytime = ''; |
| 2215 | 2215 | if ($time) { |
| 2216 | 2216 | $activitytime = calendar_day_representation($time).' '. |
| 2217 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
| 2218 | - calendar_time_representation($time); |
|
| 2217 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
| 2218 | + calendar_time_representation($time); |
|
| 2219 | 2219 | } |
| 2220 | 2220 | return $activitytime; |
| 2221 | 2221 | } |
@@ -2515,7 +2515,7 @@ discard block |
||
| 2515 | 2515 | $renderer->render_group_element('participant_moderator_default', |
| 2516 | 2516 | $renderer->render_group_element_configmultiselect('participant_moderator_default', |
| 2517 | 2517 | array_keys($owner), array_merge($owner, $roles)) |
| 2518 | - ); |
|
| 2518 | + ); |
|
| 2519 | 2519 | } |
| 2520 | 2520 | } |
| 2521 | 2521 | |
@@ -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 | if (isset($meta)) { |
| 101 | 101 | $log->meta = $meta; |
| 102 | 102 | } else if ($event == BIGBLUEBUTTONBN_LOG_EVENT_CREATE) { |
| 103 | - $log->meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}'; |
|
| 103 | + $log->meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}'; |
|
| 104 | 104 | } |
| 105 | 105 | $DB->insert_record('bigbluebuttonbn_logs', $log); |
| 106 | 106 | } |
@@ -148,8 +148,8 @@ discard block |
||
| 148 | 148 | $data = null; |
| 149 | 149 | if (!is_null($pname) && !is_null($purl)) { |
| 150 | 150 | $method = 'POST'; |
| 151 | - $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='". |
|
| 152 | - $purl."' /></module></modules>"; |
|
| 151 | + $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='" . |
|
| 152 | + $purl . "' /></module></modules>"; |
|
| 153 | 153 | } |
| 154 | 154 | $xml = bigbluebuttonbn_wrap_xml_load_file($createmeetingurl, $method, $data); |
| 155 | 155 | if ($xml) { |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | // Override imported flag with actual ID. |
| 311 | 311 | $recording['imported'] = $recordimported->id; |
| 312 | 312 | if (isset($recordimported->protected)) { |
| 313 | - $recording['protected'] = (string) $recordimported->protected; |
|
| 313 | + $recording['protected'] = (string)$recordimported->protected; |
|
| 314 | 314 | } |
| 315 | 315 | $recordsimportedarray[$recording['recordID']] = $recording; |
| 316 | 316 | } |
@@ -340,21 +340,21 @@ discard block |
||
| 340 | 340 | // Add formats. |
| 341 | 341 | $playbackarray = array(); |
| 342 | 342 | foreach ($recording->playback->format as $format) { |
| 343 | - $playbackarray[(string) $format->type] = array('type' => (string) $format->type, |
|
| 344 | - 'url' => trim((string) $format->url), 'length' => (string) $format->length); |
|
| 343 | + $playbackarray[(string)$format->type] = array('type' => (string)$format->type, |
|
| 344 | + 'url' => trim((string)$format->url), 'length' => (string)$format->length); |
|
| 345 | 345 | // Add preview per format when existing. |
| 346 | 346 | if ($format->preview) { |
| 347 | - $playbackarray[(string) $format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview); |
|
| 347 | + $playbackarray[(string)$format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview); |
|
| 348 | 348 | } |
| 349 | 349 | } |
| 350 | 350 | // Add the metadata to the recordings array. |
| 351 | 351 | $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata)); |
| 352 | - $recordingarray = array('recordID' => (string) $recording->recordID, |
|
| 353 | - 'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name, |
|
| 354 | - 'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime, |
|
| 355 | - 'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray); |
|
| 352 | + $recordingarray = array('recordID' => (string)$recording->recordID, |
|
| 353 | + 'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name, |
|
| 354 | + 'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime, |
|
| 355 | + 'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray); |
|
| 356 | 356 | if (isset($recording->protected)) { |
| 357 | - $recordingarray['protected'] = (string) $recording->protected; |
|
| 357 | + $recordingarray['protected'] = (string)$recording->protected; |
|
| 358 | 358 | } |
| 359 | 359 | return $recordingarray + $metadataarray; |
| 360 | 360 | } |
@@ -369,9 +369,9 @@ discard block |
||
| 369 | 369 | function bigbluebuttonbn_get_recording_preview_images($preview) { |
| 370 | 370 | $imagesarray = array(); |
| 371 | 371 | foreach ($preview->images->image as $image) { |
| 372 | - $imagearray = array('url' => trim((string) $image)); |
|
| 372 | + $imagearray = array('url' => trim((string)$image)); |
|
| 373 | 373 | foreach ($image->attributes() as $attkey => $attvalue) { |
| 374 | - $imagearray[$attkey] = (string) $attvalue; |
|
| 374 | + $imagearray[$attkey] = (string)$attvalue; |
|
| 375 | 375 | } |
| 376 | 376 | array_push($imagesarray, $imagearray); |
| 377 | 377 | } |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | if (is_object($value)) { |
| 392 | 392 | $value = ''; |
| 393 | 393 | } |
| 394 | - $metadataarray['meta_'.$key] = $value; |
|
| 394 | + $metadataarray['meta_' . $key] = $value; |
|
| 395 | 395 | } |
| 396 | 396 | return $metadataarray; |
| 397 | 397 | } |
@@ -463,7 +463,7 @@ discard block |
||
| 463 | 463 | $ids = explode(',', $recordids); |
| 464 | 464 | foreach ($ids as $id) { |
| 465 | 465 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 466 | - \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params) |
|
| 466 | + \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params) |
|
| 467 | 467 | ); |
| 468 | 468 | if ($xml && $xml->returncode != 'SUCCESS') { |
| 469 | 469 | return false; |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | return $xml; |
| 544 | 544 | } catch (Exception $e) { |
| 545 | 545 | libxml_use_internal_errors($previous); |
| 546 | - $error = 'Caught exception: '.$e->getMessage(); |
|
| 546 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
| 547 | 547 | debugging($error, DEBUG_DEVELOPER); |
| 548 | 548 | return null; |
| 549 | 549 | } |
@@ -554,7 +554,7 @@ discard block |
||
| 554 | 554 | $response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS); |
| 555 | 555 | return $response; |
| 556 | 556 | } catch (Exception $e) { |
| 557 | - $error = 'Caught exception: '.$e->getMessage(); |
|
| 557 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
| 558 | 558 | debugging($error, DEBUG_DEVELOPER); |
| 559 | 559 | libxml_use_internal_errors($previous); |
| 560 | 560 | return null; |
@@ -581,8 +581,8 @@ discard block |
||
| 581 | 581 | |
| 582 | 582 | $options = array(); |
| 583 | 583 | $options['CURLOPT_HTTPHEADER'] = array( |
| 584 | - 'Content-Type: '.$contenttype, |
|
| 585 | - 'Content-Length: '.strlen($data), |
|
| 584 | + 'Content-Type: ' . $contenttype, |
|
| 585 | + 'Content-Length: ' . strlen($data), |
|
| 586 | 586 | 'Content-Language: en-US', |
| 587 | 587 | ); |
| 588 | 588 | |
@@ -599,7 +599,7 @@ discard block |
||
| 599 | 599 | * @return void |
| 600 | 600 | */ |
| 601 | 601 | function bigbluebuttonbn_end_meeting_if_running($bigbluebuttonbn) { |
| 602 | - $meetingid = $bigbluebuttonbn->meetingid.'-'.$bigbluebuttonbn->course.'-'.$bigbluebuttonbn->id; |
|
| 602 | + $meetingid = $bigbluebuttonbn->meetingid . '-' . $bigbluebuttonbn->course . '-' . $bigbluebuttonbn->id; |
|
| 603 | 603 | if (bigbluebuttonbn_is_meeting_running($meetingid)) { |
| 604 | 604 | bigbluebuttonbn_end_meeting($meetingid, $bigbluebuttonbn->moderatorpass); |
| 605 | 605 | } |
@@ -619,9 +619,9 @@ discard block |
||
| 619 | 619 | if ($userroles) { |
| 620 | 620 | $where = ''; |
| 621 | 621 | foreach ($userroles as $userrole) { |
| 622 | - $where .= (empty($where) ? ' WHERE' : ' OR').' id=' . $userrole->roleid; |
|
| 622 | + $where .= (empty($where) ? ' WHERE' : ' OR') . ' id=' . $userrole->roleid; |
|
| 623 | 623 | } |
| 624 | - $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where); |
|
| 624 | + $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where); |
|
| 625 | 625 | } |
| 626 | 626 | return $userroles; |
| 627 | 627 | } |
@@ -644,7 +644,7 @@ discard block |
||
| 644 | 644 | * @return array $users |
| 645 | 645 | */ |
| 646 | 646 | function bigbluebuttonbn_get_users(context $context = null) { |
| 647 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
| 647 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
| 648 | 648 | foreach ($users as $key => $value) { |
| 649 | 649 | $users[$key] = fullname($value); |
| 650 | 650 | } |
@@ -659,7 +659,7 @@ discard block |
||
| 659 | 659 | * @return array $users |
| 660 | 660 | */ |
| 661 | 661 | function bigbluebuttonbn_get_users_select(context $context = null) { |
| 662 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
| 662 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
| 663 | 663 | foreach ($users as $key => $value) { |
| 664 | 664 | $users[$key] = array('id' => $value->id, 'name' => fullname($value)); |
| 665 | 665 | } |
@@ -674,7 +674,7 @@ discard block |
||
| 674 | 674 | * @return array $roles |
| 675 | 675 | */ |
| 676 | 676 | function bigbluebuttonbn_get_roles(context $context = null) { |
| 677 | - $roles = (array) role_get_names($context); |
|
| 677 | + $roles = (array)role_get_names($context); |
|
| 678 | 678 | foreach ($roles as $key => $value) { |
| 679 | 679 | $roles[$key] = $value->localname; |
| 680 | 680 | } |
@@ -689,7 +689,7 @@ discard block |
||
| 689 | 689 | * @return array $users |
| 690 | 690 | */ |
| 691 | 691 | function bigbluebuttonbn_get_roles_select(context $context = null) { |
| 692 | - $roles = (array) role_get_names($context); |
|
| 692 | + $roles = (array)role_get_names($context); |
|
| 693 | 693 | foreach ($roles as $key => $value) { |
| 694 | 694 | $roles[$key] = array('id' => $value->id, 'name' => $value->localname); |
| 695 | 695 | } |
@@ -704,7 +704,7 @@ discard block |
||
| 704 | 704 | * @return object $role |
| 705 | 705 | */ |
| 706 | 706 | function bigbluebuttonbn_get_role($id) { |
| 707 | - $roles = (array) role_get_names(); |
|
| 707 | + $roles = (array)role_get_names(); |
|
| 708 | 708 | if (is_numeric($id)) { |
| 709 | 709 | return (object)$roles[$id]; |
| 710 | 710 | } |
@@ -859,7 +859,7 @@ discard block |
||
| 859 | 859 | if (empty($userroles)) { |
| 860 | 860 | $userroles = get_user_roles($context, $userid, true); |
| 861 | 861 | } |
| 862 | - return bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles); |
|
| 862 | + return bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles); |
|
| 863 | 863 | } |
| 864 | 864 | |
| 865 | 865 | /** |
@@ -1010,7 +1010,7 @@ discard block |
||
| 1010 | 1010 | function bigbluebuttonbn_generate_nonce() { |
| 1011 | 1011 | $mt = microtime(); |
| 1012 | 1012 | $rand = mt_rand(); |
| 1013 | - return md5($mt.$rand); |
|
| 1013 | + return md5($mt . $rand); |
|
| 1014 | 1014 | } |
| 1015 | 1015 | |
| 1016 | 1016 | /** |
@@ -1036,21 +1036,21 @@ discard block |
||
| 1036 | 1036 | */ |
| 1037 | 1037 | function bigbluebuttonbn_events() { |
| 1038 | 1038 | return array( |
| 1039 | - (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
| 1040 | - (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
| 1041 | - (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
| 1042 | - (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
| 1043 | - (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
| 1044 | - (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
| 1045 | - (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
| 1046 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
| 1047 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
| 1048 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
| 1049 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
| 1050 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
| 1051 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
| 1052 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
| 1053 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
| 1039 | + (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
| 1040 | + (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
| 1041 | + (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
| 1042 | + (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
| 1043 | + (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
| 1044 | + (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
| 1045 | + (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
| 1046 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
| 1047 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
| 1048 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
| 1049 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
| 1050 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
| 1051 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
| 1052 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
| 1053 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
| 1054 | 1054 | ); |
| 1055 | 1055 | } |
| 1056 | 1056 | |
@@ -1061,21 +1061,21 @@ discard block |
||
| 1061 | 1061 | */ |
| 1062 | 1062 | function bigbluebuttonbn_events_action() { |
| 1063 | 1063 | return array( |
| 1064 | - 'view' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
| 1065 | - 'view_management' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
| 1066 | - 'live_action' => (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
| 1067 | - 'meeting_create' => (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
| 1068 | - 'meeting_end' => (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
| 1069 | - 'meeting_join' => (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
| 1070 | - 'meeting_left' => (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
| 1071 | - 'recording_delete' => (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
| 1072 | - 'recording_import' => (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
| 1073 | - 'recording_protect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
| 1074 | - 'recording_publish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
| 1075 | - 'recording_unprotect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
| 1076 | - 'recording_unpublish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
| 1077 | - 'recording_edit' => (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
| 1078 | - 'recording_play' => (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
| 1064 | + 'view' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
| 1065 | + 'view_management' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
| 1066 | + 'live_action' => (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
| 1067 | + 'meeting_create' => (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
| 1068 | + 'meeting_end' => (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
| 1069 | + 'meeting_join' => (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
| 1070 | + 'meeting_left' => (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
| 1071 | + 'recording_delete' => (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
| 1072 | + 'recording_import' => (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
| 1073 | + 'recording_protect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
| 1074 | + 'recording_publish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
| 1075 | + 'recording_unprotect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
| 1076 | + 'recording_unpublish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
| 1077 | + 'recording_edit' => (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
| 1078 | + 'recording_play' => (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
| 1079 | 1079 | ); |
| 1080 | 1080 | } |
| 1081 | 1081 | |
@@ -1106,7 +1106,7 @@ discard block |
||
| 1106 | 1106 | if (array_key_exists('other', $options)) { |
| 1107 | 1107 | $eventproperties['other'] = $options['other']; |
| 1108 | 1108 | } |
| 1109 | - $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create', |
|
| 1109 | + $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_' . $eventtype . '::create', |
|
| 1110 | 1110 | array($eventproperties)); |
| 1111 | 1111 | $event->trigger(); |
| 1112 | 1112 | } |
@@ -1146,10 +1146,10 @@ discard block |
||
| 1146 | 1146 | $now = time(); |
| 1147 | 1147 | if (!$updatecache && isset($result) && $now < ($result['creation_time'] + $cachettl)) { |
| 1148 | 1148 | // Use the value in the cache. |
| 1149 | - return (array) json_decode($result['meeting_info']); |
|
| 1149 | + return (array)json_decode($result['meeting_info']); |
|
| 1150 | 1150 | } |
| 1151 | 1151 | // Ping again and refresh the cache. |
| 1152 | - $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file( |
|
| 1152 | + $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file( |
|
| 1153 | 1153 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
| 1154 | 1154 | ); |
| 1155 | 1155 | $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); |
@@ -1244,7 +1244,7 @@ discard block |
||
| 1244 | 1244 | * @return object |
| 1245 | 1245 | */ |
| 1246 | 1246 | function bigbluebuttonbn_set_config_xml($meetingid, $configxml) { |
| 1247 | - $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?'; |
|
| 1247 | + $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?'; |
|
| 1248 | 1248 | $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml); |
| 1249 | 1249 | $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, 'POST', |
| 1250 | 1250 | $configxmlparams, 'application/x-www-form-urlencoded'); |
@@ -1260,8 +1260,8 @@ discard block |
||
| 1260 | 1260 | * @return string |
| 1261 | 1261 | */ |
| 1262 | 1262 | function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) { |
| 1263 | - $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid); |
|
| 1264 | - $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.\mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
| 1263 | + $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid); |
|
| 1264 | + $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . \mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
| 1265 | 1265 | return $configxmlparams; |
| 1266 | 1266 | } |
| 1267 | 1267 | |
@@ -1275,7 +1275,7 @@ discard block |
||
| 1275 | 1275 | */ |
| 1276 | 1276 | function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) { |
| 1277 | 1277 | $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml); |
| 1278 | - $configxmlarray = (array) $configxml; |
|
| 1278 | + $configxmlarray = (array)$configxml; |
|
| 1279 | 1279 | if ($configxmlarray['returncode'] != 'SUCCESS') { |
| 1280 | 1280 | debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER); |
| 1281 | 1281 | return ''; |
@@ -1367,7 +1367,7 @@ discard block |
||
| 1367 | 1367 | global $USER; |
| 1368 | 1368 | $starttime = $starttime - ($starttime % 1000); |
| 1369 | 1369 | // Set formatted date. |
| 1370 | - $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z'; |
|
| 1370 | + $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z'; |
|
| 1371 | 1371 | return userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone)); |
| 1372 | 1372 | } |
| 1373 | 1373 | |
@@ -1483,7 +1483,7 @@ discard block |
||
| 1483 | 1483 | $visibility = 'hidden '; |
| 1484 | 1484 | } |
| 1485 | 1485 | $recordingpreview = html_writer::start_tag('div', |
| 1486 | - array('id' => 'preview-'.$recording['recordID'], $visibility => $visibility)); |
|
| 1486 | + array('id' => 'preview-' . $recording['recordID'], $visibility => $visibility)); |
|
| 1487 | 1487 | foreach ($recording['playbacks'] as $playback) { |
| 1488 | 1488 | if (isset($playback['preview'])) { |
| 1489 | 1489 | foreach ($playback['preview'] as $image) { |
@@ -1519,7 +1519,7 @@ discard block |
||
| 1519 | 1519 | if ($recording['published'] === 'false') { |
| 1520 | 1520 | $visibility = 'hidden '; |
| 1521 | 1521 | } |
| 1522 | - $id = 'playbacks-'.$recording['recordID']; |
|
| 1522 | + $id = 'playbacks-' . $recording['recordID']; |
|
| 1523 | 1523 | $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported, |
| 1524 | 1524 | 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
| 1525 | 1525 | 'title' => $title, $visibility => $visibility)); |
@@ -1544,12 +1544,12 @@ discard block |
||
| 1544 | 1544 | if (!bigbluebuttonbn_include_recording_data_row_type($recording, $bbbsession, $playback)) { |
| 1545 | 1545 | return ''; |
| 1546 | 1546 | } |
| 1547 | - $title = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'); |
|
| 1547 | + $title = get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn'); |
|
| 1548 | 1548 | $onclick = 'M.mod_bigbluebuttonbn.recordings.recordingPlay(this);'; |
| 1549 | 1549 | $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bbbsession['bigbluebuttonbn']->id . |
| 1550 | - '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
| 1550 | + '&mid=' . $recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
| 1551 | 1551 | if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') { |
| 1552 | - $href .= '&href='.urlencode(trim($playback['url'])); |
|
| 1552 | + $href .= '&href=' . urlencode(trim($playback['url'])); |
|
| 1553 | 1553 | } |
| 1554 | 1554 | $id = 'recording-play-' . $playback['type'] . '-' . $recording['recordID']; |
| 1555 | 1555 | $linkattributes = array( |
@@ -1683,7 +1683,7 @@ discard block |
||
| 1683 | 1683 | $linkattributes['class'] = 'disabled'; |
| 1684 | 1684 | unset($linkattributes['onclick']); |
| 1685 | 1685 | } |
| 1686 | - $icon = new pix_icon('i/'.$data['tag'], |
|
| 1686 | + $icon = new pix_icon('i/' . $data['tag'], |
|
| 1687 | 1687 | get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'), |
| 1688 | 1688 | 'moodle', $iconattributes); |
| 1689 | 1689 | return $OUTPUT->action_icon('#', $icon, null, $linkattributes, false); |
@@ -1800,7 +1800,7 @@ discard block |
||
| 1800 | 1800 | */ |
| 1801 | 1801 | function bigbluebuttonbn_get_recording_table_row($bbbsession, $recording, $rowdata) { |
| 1802 | 1802 | $row = new html_table_row(); |
| 1803 | - $row->id = 'recording-td-'.$recording['recordID']; |
|
| 1803 | + $row->id = 'recording-td-' . $recording['recordID']; |
|
| 1804 | 1804 | $row->attributes['data-imported'] = 'false'; |
| 1805 | 1805 | $texthead = ''; |
| 1806 | 1806 | $texttail = ''; |
@@ -1859,9 +1859,9 @@ discard block |
||
| 1859 | 1859 | function bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn) { |
| 1860 | 1860 | $sender = get_admin(); |
| 1861 | 1861 | // Prepare message. |
| 1862 | - $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn'). |
|
| 1863 | - ' "' . $bigbluebuttonbn->name . '" '. |
|
| 1864 | - get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>'; |
|
| 1862 | + $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . |
|
| 1863 | + ' "' . $bigbluebuttonbn->name . '" ' . |
|
| 1864 | + get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>'; |
|
| 1865 | 1865 | $context = context_course::instance($bigbluebuttonbn->course); |
| 1866 | 1866 | \mod_bigbluebuttonbn\locallib\notifier::notification_send($context, $sender, $bigbluebuttonbn, $messagetext); |
| 1867 | 1867 | } |
@@ -2081,7 +2081,7 @@ discard block |
||
| 2081 | 2081 | } |
| 2082 | 2082 | // Prepare select for loading records based on existent bigbluebuttonbns. |
| 2083 | 2083 | $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE '; |
| 2084 | - $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')'; |
|
| 2084 | + $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')'; |
|
| 2085 | 2085 | // Include only Create events and exclude those with record not true. |
| 2086 | 2086 | $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?'; |
| 2087 | 2087 | // Execute select for loading records based on existent bigbluebuttonbns. |
@@ -2213,8 +2213,8 @@ discard block |
||
| 2213 | 2213 | function bigbluebuttonbn_format_activity_time($time) { |
| 2214 | 2214 | $activitytime = ''; |
| 2215 | 2215 | if ($time) { |
| 2216 | - $activitytime = calendar_day_representation($time).' '. |
|
| 2217 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
| 2216 | + $activitytime = calendar_day_representation($time) . ' ' . |
|
| 2217 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' . |
|
| 2218 | 2218 | calendar_time_representation($time); |
| 2219 | 2219 | } |
| 2220 | 2220 | return $activitytime; |