@@ -9,12 +9,12 @@ discard block |
||
| 9 | 9 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v2 or later |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | -require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); |
|
| 13 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
| 12 | +require_once(dirname(dirname(dirname(__FILE__))) . '/config.php'); |
|
| 13 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
| 14 | 14 | |
| 15 | -$id = required_param('id', PARAM_INT); // Course Module ID, or |
|
| 16 | -$b = optional_param('n', 0, PARAM_INT); // bigbluebuttonbn instance ID |
|
| 17 | -$group = optional_param('group', 0, PARAM_INT); // group instance ID |
|
| 15 | +$id = required_param('id', PARAM_INT); // Course Module ID, or |
|
| 16 | +$b = optional_param('n', 0, PARAM_INT); // bigbluebuttonbn instance ID |
|
| 17 | +$group = optional_param('group', 0, PARAM_INT); // group instance ID |
|
| 18 | 18 | |
| 19 | 19 | if ($id) { |
| 20 | 20 | $cm = get_coursemodule_from_id('bigbluebuttonbn', $id, 0, false, MUST_EXIST); |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | require_login($course, true, $cm); |
| 32 | 32 | |
| 33 | 33 | $version_major = bigbluebuttonbn_get_moodle_version_major(); |
| 34 | -if ( $version_major < '2013111800' ) { |
|
| 34 | +if ($version_major < '2013111800') { |
|
| 35 | 35 | //This is valid before v2.6 |
| 36 | 36 | $module = $DB->get_record('modules', array('name' => 'bigbluebuttonbn')); |
| 37 | 37 | $module_version = $module->version; |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | $bbbsession['roles'] = get_user_roles($context, $USER->id, true); |
| 57 | 57 | |
| 58 | 58 | // User roles |
| 59 | -if( $bigbluebuttonbn->participants == null || $bigbluebuttonbn->participants == "" || $bigbluebuttonbn->participants == "[]" ){ |
|
| 59 | +if ($bigbluebuttonbn->participants == null || $bigbluebuttonbn->participants == "" || $bigbluebuttonbn->participants == "[]") { |
|
| 60 | 60 | //The room that is being used comes from a previous version |
| 61 | 61 | $bbbsession['moderator'] = has_capability('mod/bigbluebuttonbn:moderate', $context); |
| 62 | 62 | } else { |
@@ -76,16 +76,16 @@ discard block |
||
| 76 | 76 | // Database info related to the activity |
| 77 | 77 | $bbbsession['meetingdescription'] = $bigbluebuttonbn->intro; |
| 78 | 78 | $bbbsession['welcome'] = $bigbluebuttonbn->welcome; |
| 79 | -if( !isset($bbbsession['welcome']) || $bbbsession['welcome'] == '') { |
|
| 79 | +if (!isset($bbbsession['welcome']) || $bbbsession['welcome'] == '') { |
|
| 80 | 80 | $bbbsession['welcome'] = get_string('mod_form_field_welcome_default', 'bigbluebuttonbn'); |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | -$bbbsession['userlimit'] = bigbluebuttonbn_get_cfg_userlimit_editable()? intval($bigbluebuttonbn->userlimit): intval(bigbluebuttonbn_get_cfg_userlimit_default()); |
|
| 84 | -$bbbsession['voicebridge'] = ($bigbluebuttonbn->voicebridge > 0)? 70000 + $bigbluebuttonbn->voicebridge: $bigbluebuttonbn->voicebridge; |
|
| 83 | +$bbbsession['userlimit'] = bigbluebuttonbn_get_cfg_userlimit_editable() ? intval($bigbluebuttonbn->userlimit) : intval(bigbluebuttonbn_get_cfg_userlimit_default()); |
|
| 84 | +$bbbsession['voicebridge'] = ($bigbluebuttonbn->voicebridge > 0) ? 70000 + $bigbluebuttonbn->voicebridge : $bigbluebuttonbn->voicebridge; |
|
| 85 | 85 | $bbbsession['wait'] = $bigbluebuttonbn->wait; |
| 86 | 86 | $bbbsession['record'] = $bigbluebuttonbn->record; |
| 87 | -if( $bigbluebuttonbn->record ) |
|
| 88 | - $bbbsession['welcome'] .= '<br><br>'.get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
|
| 87 | +if ($bigbluebuttonbn->record) |
|
| 88 | + $bbbsession['welcome'] .= '<br><br>' . get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
|
| 89 | 89 | $bbbsession['tagging'] = $bigbluebuttonbn->tagging; |
| 90 | 90 | |
| 91 | 91 | $bbbsession['openingtime'] = $bigbluebuttonbn->openingtime; |
@@ -104,29 +104,29 @@ discard block |
||
| 104 | 104 | $bbbsession['originServerName'] = $parsedUrl['host']; |
| 105 | 105 | $bbbsession['originServerUrl'] = $CFG->wwwroot; |
| 106 | 106 | $bbbsession['originServerCommonName'] = ''; |
| 107 | -$bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn ('.$module_version.')'; |
|
| 107 | +$bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn (' . $module_version . ')'; |
|
| 108 | 108 | //////////////////////////////////////////////// |
| 109 | 109 | ///// BigBlueButton Session Setup Ends ///// |
| 110 | 110 | //////////////////////////////////////////////// |
| 111 | 111 | |
| 112 | 112 | // Validates if the BigBlueButton server is running |
| 113 | 113 | $serverVersion = bigbluebuttonbn_getServerVersion($bbbsession['endpoint']); |
| 114 | -if ( !isset($serverVersion) ) { //Server is not working |
|
| 115 | - if ( $bbbsession['administrator'] ) |
|
| 116 | - print_error( 'view_error_unable_join', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
|
| 117 | - else if ( $bbbsession['moderator'] ) |
|
| 118 | - print_error( 'view_error_unable_join_teacher', 'bigbluebuttonbn', $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course ); |
|
| 114 | +if (!isset($serverVersion)) { //Server is not working |
|
| 115 | + if ($bbbsession['administrator']) |
|
| 116 | + print_error('view_error_unable_join', 'bigbluebuttonbn', $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 117 | + else if ($bbbsession['moderator']) |
|
| 118 | + print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course); |
|
| 119 | 119 | else |
| 120 | - print_error( 'view_error_unable_join_student', 'bigbluebuttonbn', $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course ); |
|
| 120 | + print_error('view_error_unable_join_student', 'bigbluebuttonbn', $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course); |
|
| 121 | 121 | } else { |
| 122 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getMeetingsURL( $bbbsession['endpoint'], $bbbsession['shared_secret'] ) ); |
|
| 123 | - if ( !isset($xml) || !isset($xml->returncode) || $xml->returncode == 'FAILED' ){ // The shared secret is wrong |
|
| 124 | - if ( $bbbsession['administrator'] ) |
|
| 125 | - print_error( 'view_error_unable_join', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
|
| 126 | - else if ( $bbbsession['moderator'] ) |
|
| 127 | - print_error( 'view_error_unable_join_teacher', 'bigbluebuttonbn', $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course ); |
|
| 122 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getMeetingsURL($bbbsession['endpoint'], $bbbsession['shared_secret'])); |
|
| 123 | + if (!isset($xml) || !isset($xml->returncode) || $xml->returncode == 'FAILED') { // The shared secret is wrong |
|
| 124 | + if ($bbbsession['administrator']) |
|
| 125 | + print_error('view_error_unable_join', 'bigbluebuttonbn', $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 126 | + else if ($bbbsession['moderator']) |
|
| 127 | + print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course); |
|
| 128 | 128 | else |
| 129 | - print_error( 'view_error_unable_join_student', 'bigbluebuttonbn', $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course ); |
|
| 129 | + print_error('view_error_unable_join_student', 'bigbluebuttonbn', $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course); |
|
| 130 | 130 | } |
| 131 | 131 | } |
| 132 | 132 | |
@@ -136,12 +136,12 @@ discard block |
||
| 136 | 136 | |
| 137 | 137 | // Print the page header |
| 138 | 138 | $PAGE->set_context($context); |
| 139 | -$PAGE->set_url($CFG->wwwroot.'/mod/bigbluebuttonbn/view.php', array('id' => $cm->id)); |
|
| 139 | +$PAGE->set_url($CFG->wwwroot . '/mod/bigbluebuttonbn/view.php', array('id' => $cm->id)); |
|
| 140 | 140 | $PAGE->set_title(format_string($bigbluebuttonbn->name)); |
| 141 | 141 | $PAGE->set_cacheable(false); |
| 142 | 142 | $PAGE->set_heading($course->fullname); |
| 143 | 143 | |
| 144 | -if( $bigbluebuttonbn->newwindow == 1 ) { |
|
| 144 | +if ($bigbluebuttonbn->newwindow == 1) { |
|
| 145 | 145 | $PAGE->blocks->show_only_fake_blocks(); |
| 146 | 146 | |
| 147 | 147 | } else { |
@@ -149,14 +149,14 @@ discard block |
||
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | // Validate if the user is in a role allowed to join |
| 152 | -if ( !has_capability('moodle/category:manage', $context) && !has_capability('mod/bigbluebuttonbn:join', $context) ) { |
|
| 152 | +if (!has_capability('moodle/category:manage', $context) && !has_capability('mod/bigbluebuttonbn:join', $context)) { |
|
| 153 | 153 | echo $OUTPUT->header(); |
| 154 | 154 | if (isguestuser()) { |
| 155 | - echo $OUTPUT->confirm('<p>'.get_string('view_noguests', 'bigbluebuttonbn').'</p>'.get_string('liketologin'), |
|
| 156 | - get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id); |
|
| 155 | + echo $OUTPUT->confirm('<p>' . get_string('view_noguests', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'), |
|
| 156 | + get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id); |
|
| 157 | 157 | } else { |
| 158 | - echo $OUTPUT->confirm('<p>'.get_string('view_nojoin', 'bigbluebuttonbn').'</p>'.get_string('liketologin'), |
|
| 159 | - get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id); |
|
| 158 | + echo $OUTPUT->confirm('<p>' . get_string('view_nojoin', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'), |
|
| 159 | + get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id); |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | echo $OUTPUT->footer(); |
@@ -164,47 +164,47 @@ discard block |
||
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | // Operation URLs |
| 167 | -$bbbsession['courseURL'] = $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course; |
|
| 168 | -$bbbsession['logoutURL'] = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=logout&id='.$id.'&bn='.$bbbsession['bigbluebuttonbn']->id; |
|
| 169 | -$bbbsession['recordingReadyURL'] = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_broker.php?action=recording_ready'; |
|
| 170 | -$bbbsession['joinURL'] = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=join&id='.$id.'&bigbluebuttonbn='.$bbbsession['bigbluebuttonbn']->id; |
|
| 167 | +$bbbsession['courseURL'] = $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course; |
|
| 168 | +$bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id=' . $id . '&bn=' . $bbbsession['bigbluebuttonbn']->id; |
|
| 169 | +$bbbsession['recordingReadyURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_broker.php?action=recording_ready'; |
|
| 170 | +$bbbsession['joinURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=join&id=' . $id . '&bigbluebuttonbn=' . $bbbsession['bigbluebuttonbn']->id; |
|
| 171 | 171 | |
| 172 | 172 | // Output starts here |
| 173 | 173 | echo $OUTPUT->header(); |
| 174 | 174 | |
| 175 | 175 | /// find out current groups mode |
| 176 | 176 | $groupmode = groups_get_activity_groupmode($bbbsession['cm']); |
| 177 | -if ( $groupmode == NOGROUPS ) { //No groups mode |
|
| 178 | - $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'.$bbbsession['bigbluebuttonbn']->id; |
|
| 177 | +if ($groupmode == NOGROUPS) { //No groups mode |
|
| 178 | + $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' . $bbbsession['bigbluebuttonbn']->id; |
|
| 179 | 179 | $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name; |
| 180 | 180 | |
| 181 | 181 | } else { // Separate or visible groups mode |
| 182 | 182 | echo $OUTPUT->box_start('generalbox boxaligncenter'); |
| 183 | - echo '<br><div class="alert alert-warning">'.get_string('view_groups_selection_warning', 'bigbluebuttonbn').'</div>'; |
|
| 183 | + echo '<br><div class="alert alert-warning">' . get_string('view_groups_selection_warning', 'bigbluebuttonbn') . '</div>'; |
|
| 184 | 184 | echo $OUTPUT->box_end(); |
| 185 | 185 | |
| 186 | 186 | $bbbsession['group'] = groups_get_activity_group($bbbsession['cm'], true); |
| 187 | 187 | $groups = groups_get_all_groups($bbbsession['course']->id); |
| 188 | - if ( $groupmode == SEPARATEGROUPS && sizeof($groups) > 0 ) { |
|
| 189 | - groups_print_activity_menu($cm, $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bbbsession['cm']->id, false, true); |
|
| 190 | - if( $bbbsession['group'] == 0 ) { |
|
| 191 | - if ( !$bbbsession['administrator'] ) { |
|
| 188 | + if ($groupmode == SEPARATEGROUPS && sizeof($groups) > 0) { |
|
| 189 | + groups_print_activity_menu($cm, $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id, false, true); |
|
| 190 | + if ($bbbsession['group'] == 0) { |
|
| 191 | + if (!$bbbsession['administrator']) { |
|
| 192 | 192 | $groups = groups_get_activity_allowed_groups($bbbsession['cm']); |
| 193 | 193 | } |
| 194 | 194 | $current_group = current($groups); |
| 195 | 195 | $bbbsession['group'] = $current_group->id; |
| 196 | 196 | } |
| 197 | 197 | } else { |
| 198 | - groups_print_activity_menu($cm, $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bbbsession['cm']->id); |
|
| 198 | + groups_print_activity_menu($cm, $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id); |
|
| 199 | 199 | } |
| 200 | 200 | |
| 201 | - $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'.$bbbsession['bigbluebuttonbn']->id.'['.$bbbsession['group'].']'; |
|
| 202 | - if ( $bbbsession['group'] > 0 ) { |
|
| 201 | + $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' . $bbbsession['bigbluebuttonbn']->id . '[' . $bbbsession['group'] . ']'; |
|
| 202 | + if ($bbbsession['group'] > 0) { |
|
| 203 | 203 | $group_name = groups_get_group_name($bbbsession['group']); |
| 204 | 204 | } else { |
| 205 | 205 | $group_name = get_string('allparticipants'); |
| 206 | 206 | } |
| 207 | - $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name.' ('.$group_name.')'; |
|
| 207 | + $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name . ' (' . $group_name . ')'; |
|
| 208 | 208 | } |
| 209 | 209 | // Metadata (context) |
| 210 | 210 | $bbbsession['contextActivityName'] = $bbbsession['meetingname']; |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | |
| 214 | 214 | $bigbluebuttonbn_activity = 'open'; |
| 215 | 215 | $now = time(); |
| 216 | -if (!empty($bigbluebuttonbn->openingtime) && $now < $bigbluebuttonbn->openingtime ) { |
|
| 216 | +if (!empty($bigbluebuttonbn->openingtime) && $now < $bigbluebuttonbn->openingtime) { |
|
| 217 | 217 | //ACTIVITY HAS NOT BEEN OPENED |
| 218 | 218 | $bigbluebuttonbn_activity = 'not_started'; |
| 219 | 219 | |
@@ -237,11 +237,11 @@ discard block |
||
| 237 | 237 | 'activity' => $bigbluebuttonbn_activity, |
| 238 | 238 | 'meetingid' => $bbbsession['meetingid'], |
| 239 | 239 | 'bigbluebuttonbnid' => $bbbsession['bigbluebuttonbn']->id, |
| 240 | - 'ping_interval' => ($waitformoderator_ping_interval > 0? $waitformoderator_ping_interval * 1000: 15000), |
|
| 240 | + 'ping_interval' => ($waitformoderator_ping_interval > 0 ? $waitformoderator_ping_interval * 1000 : 15000), |
|
| 241 | 241 | 'userlimit' => $bbbsession['userlimit'], |
| 242 | 242 | 'locales' => bigbluebuttonbn_get_locales_for_ui(), |
| 243 | - 'opening' => ($bbbsession['openingtime'])? get_string('mod_form_field_openingtime','bigbluebuttonbn').': '.userdate($bbbsession['openingtime']) : '', |
|
| 244 | - 'closing' => ($bbbsession['closingtime'])? get_string('mod_form_field_closingtime','bigbluebuttonbn').': '.userdate($bbbsession['closingtime']) : '' |
|
| 243 | + 'opening' => ($bbbsession['openingtime']) ? get_string('mod_form_field_openingtime', 'bigbluebuttonbn') . ': ' . userdate($bbbsession['openingtime']) : '', |
|
| 244 | + 'closing' => ($bbbsession['closingtime']) ? get_string('mod_form_field_closingtime', 'bigbluebuttonbn') . ': ' . userdate($bbbsession['closingtime']) : '' |
|
| 245 | 245 | ); |
| 246 | 246 | |
| 247 | 247 | $PAGE->requires->data_for_js('bigbluebuttonbn', $jsVars); |
@@ -268,13 +268,13 @@ discard block |
||
| 268 | 268 | echo $OUTPUT->box_end(); |
| 269 | 269 | |
| 270 | 270 | echo $OUTPUT->box_start('generalbox boxaligncenter', 'bigbluebuttonbn_view_action_button_box'); |
| 271 | - echo '<br><br><span id="join_button"></span> <span id="end_button"></span>'."\n"; |
|
| 271 | + echo '<br><br><span id="join_button"></span> <span id="end_button"></span>' . "\n"; |
|
| 272 | 272 | echo $OUTPUT->box_end(); |
| 273 | 273 | |
| 274 | - if ( $activity == 'not_started' ) { |
|
| 274 | + if ($activity == 'not_started') { |
|
| 275 | 275 | // Do nothing |
| 276 | 276 | } else { |
| 277 | - if ( $activity == 'ended' ) { |
|
| 277 | + if ($activity == 'ended') { |
|
| 278 | 278 | bigbluebuttonbn_view_ended($bbbsession); |
| 279 | 279 | } else { |
| 280 | 280 | bigbluebuttonbn_view_joining($bbbsession); |
@@ -286,29 +286,29 @@ discard block |
||
| 286 | 286 | |
| 287 | 287 | function bigbluebuttonbn_view_joining($bbbsession) { |
| 288 | 288 | |
| 289 | - if( $bbbsession['tagging'] && ($bbbsession['administrator'] || $bbbsession['moderator']) ){ |
|
| 290 | - echo ''. |
|
| 291 | - '<div id="panelContent" class="hidden">'."\n". |
|
| 292 | - ' <div class="yui3-widget-bd">'."\n". |
|
| 293 | - ' <form>'."\n". |
|
| 294 | - ' <fieldset>'."\n". |
|
| 295 | - ' <input type="hidden" name="join" id="meeting_join_url" value="">'."\n". |
|
| 296 | - ' <input type="hidden" name="message" id="meeting_message" value="">'."\n". |
|
| 297 | - ' <div>'."\n". |
|
| 298 | - ' <label for="name">'.get_string('view_recording_name', 'bigbluebuttonbn').'</label><br/>'."\n". |
|
| 299 | - ' <input type="text" name="name" id="recording_name" placeholder="">'."\n". |
|
| 300 | - ' </div><br>'."\n". |
|
| 301 | - ' <div>'."\n". |
|
| 302 | - ' <label for="description">'.get_string('view_recording_description', 'bigbluebuttonbn').'</label><br/>'."\n". |
|
| 303 | - ' <input type="text" name="description" id="recording_description" value="" placeholder="">'."\n". |
|
| 304 | - ' </div><br>'."\n". |
|
| 305 | - ' <div>'."\n". |
|
| 306 | - ' <label for="tags">'.get_string('view_recording_tags', 'bigbluebuttonbn').'</label><br/>'."\n". |
|
| 307 | - ' <input type="text" name="tags" id="recording_tags" value="" placeholder="">'."\n". |
|
| 308 | - ' </div>'."\n". |
|
| 309 | - ' </fieldset>'."\n". |
|
| 310 | - ' </form>'."\n". |
|
| 311 | - ' </div>'."\n". |
|
| 289 | + if ($bbbsession['tagging'] && ($bbbsession['administrator'] || $bbbsession['moderator'])) { |
|
| 290 | + echo '' . |
|
| 291 | + '<div id="panelContent" class="hidden">' . "\n" . |
|
| 292 | + ' <div class="yui3-widget-bd">' . "\n" . |
|
| 293 | + ' <form>' . "\n" . |
|
| 294 | + ' <fieldset>' . "\n" . |
|
| 295 | + ' <input type="hidden" name="join" id="meeting_join_url" value="">' . "\n" . |
|
| 296 | + ' <input type="hidden" name="message" id="meeting_message" value="">' . "\n" . |
|
| 297 | + ' <div>' . "\n" . |
|
| 298 | + ' <label for="name">' . get_string('view_recording_name', 'bigbluebuttonbn') . '</label><br/>' . "\n" . |
|
| 299 | + ' <input type="text" name="name" id="recording_name" placeholder="">' . "\n" . |
|
| 300 | + ' </div><br>' . "\n" . |
|
| 301 | + ' <div>' . "\n" . |
|
| 302 | + ' <label for="description">' . get_string('view_recording_description', 'bigbluebuttonbn') . '</label><br/>' . "\n" . |
|
| 303 | + ' <input type="text" name="description" id="recording_description" value="" placeholder="">' . "\n" . |
|
| 304 | + ' </div><br>' . "\n" . |
|
| 305 | + ' <div>' . "\n" . |
|
| 306 | + ' <label for="tags">' . get_string('view_recording_tags', 'bigbluebuttonbn') . '</label><br/>' . "\n" . |
|
| 307 | + ' <input type="text" name="tags" id="recording_tags" value="" placeholder="">' . "\n" . |
|
| 308 | + ' </div>' . "\n" . |
|
| 309 | + ' </fieldset>' . "\n" . |
|
| 310 | + ' </form>' . "\n" . |
|
| 311 | + ' </div>' . "\n" . |
|
| 312 | 312 | '</div>'; |
| 313 | 313 | } |
| 314 | 314 | } |
@@ -316,26 +316,26 @@ discard block |
||
| 316 | 316 | function bigbluebuttonbn_view_ended($bbbsession) { |
| 317 | 317 | global $OUTPUT; |
| 318 | 318 | |
| 319 | - if( !is_null($bbbsession['presentation']['url']) ) { |
|
| 319 | + if (!is_null($bbbsession['presentation']['url'])) { |
|
| 320 | 320 | $attributes = array('title' => $bbbsession['presentation']['name']); |
| 321 | 321 | $icon = new pix_icon($bbbsession['presentation']['icon'], $bbbsession['presentation']['mimetype_description']); |
| 322 | 322 | |
| 323 | - echo '<h4>'.get_string('view_section_title_presentation', 'bigbluebuttonbn').'</h4>'. |
|
| 324 | - ''.$OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false).''. |
|
| 325 | - ''.$OUTPUT->action_link($bbbsession['presentation']['url'], $bbbsession['presentation']['name'], null, $attributes).'<br><br>'; |
|
| 323 | + echo '<h4>' . get_string('view_section_title_presentation', 'bigbluebuttonbn') . '</h4>' . |
|
| 324 | + '' . $OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false) . '' . |
|
| 325 | + '' . $OUTPUT->action_link($bbbsession['presentation']['url'], $bbbsession['presentation']['name'], null, $attributes) . '<br><br>'; |
|
| 326 | 326 | } |
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | function bigbluebuttonbn_view_recordings($bbbsession) { |
| 330 | 330 | global $CFG; |
| 331 | 331 | |
| 332 | - if( isset($bbbsession['record']) && $bbbsession['record'] ) { |
|
| 333 | - $output = html_writer::tag('h4', get_string('view_section_title_recordings', 'bigbluebuttonbn') ); |
|
| 332 | + if (isset($bbbsession['record']) && $bbbsession['record']) { |
|
| 333 | + $output = html_writer::tag('h4', get_string('view_section_title_recordings', 'bigbluebuttonbn')); |
|
| 334 | 334 | |
| 335 | - $meetingID=''; |
|
| 335 | + $meetingID = ''; |
|
| 336 | 336 | $results = bigbluebuttonbn_getRecordedMeetings($bbbsession['course']->id, $bbbsession['bigbluebuttonbn']->id); |
| 337 | 337 | |
| 338 | - if( $results ){ |
|
| 338 | + if ($results) { |
|
| 339 | 339 | //Eliminates duplicates |
| 340 | 340 | $mIDs = array(); |
| 341 | 341 | foreach ($results as $result) { |
@@ -349,7 +349,7 @@ discard block |
||
| 349 | 349 | } |
| 350 | 350 | |
| 351 | 351 | // Get actual recordings |
| 352 | - if ( $meetingID != '' ) { |
|
| 352 | + if ($meetingID != '') { |
|
| 353 | 353 | $recordings = bigbluebuttonbn_getRecordingsArray($meetingID, $bbbsession['endpoint'], $bbbsession['shared_secret']); |
| 354 | 354 | } else { |
| 355 | 355 | $recordings = Array(); |
@@ -357,12 +357,12 @@ discard block |
||
| 357 | 357 | // Get recording links |
| 358 | 358 | $recordings_imported = bigbluebuttonbn_getRecordingsImportedArray($bbbsession['course']->id, $bbbsession['bigbluebuttonbn']->id); |
| 359 | 359 | // Merge the recordings |
| 360 | - $recordings = array_merge( $recordings, $recordings_imported ); |
|
| 360 | + $recordings = array_merge($recordings, $recordings_imported); |
|
| 361 | 361 | // Render the table |
| 362 | - $output .= bigbluebutton_output_recording_table($bbbsession, $recordings)."\n"; |
|
| 362 | + $output .= bigbluebutton_output_recording_table($bbbsession, $recordings) . "\n"; |
|
| 363 | 363 | |
| 364 | - if ( $bbbsession['managerecordings'] && bigbluebuttonbn_get_cfg_importrecordings_enabled() ) { |
|
| 365 | - $button_import_recordings = html_writer::tag( 'input', '', array('type' => 'button', 'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'), 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='.$bbbsession['bigbluebuttonbn']->id.'\'') ); |
|
| 364 | + if ($bbbsession['managerecordings'] && bigbluebuttonbn_get_cfg_importrecordings_enabled()) { |
|
| 365 | + $button_import_recordings = html_writer::tag('input', '', array('type' => 'button', 'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'), 'onclick' => 'window.location=\'' . $CFG->wwwroot . '/mod/bigbluebuttonbn/import_view.php?bn=' . $bbbsession['bigbluebuttonbn']->id . '\'')); |
|
| 366 | 366 | $output .= html_writer::start_tag('br'); |
| 367 | 367 | $output .= html_writer::tag('span', $button_import_recordings, ['id'=>"import_recording_links_button"]); |
| 368 | 368 | $output .= html_writer::tag('span', '', ['id'=>"import_recording_links_table"]); |
@@ -84,8 +84,9 @@ discard block |
||
| 84 | 84 | $bbbsession['voicebridge'] = ($bigbluebuttonbn->voicebridge > 0)? 70000 + $bigbluebuttonbn->voicebridge: $bigbluebuttonbn->voicebridge; |
| 85 | 85 | $bbbsession['wait'] = $bigbluebuttonbn->wait; |
| 86 | 86 | $bbbsession['record'] = $bigbluebuttonbn->record; |
| 87 | -if( $bigbluebuttonbn->record ) |
|
| 87 | +if( $bigbluebuttonbn->record ) { |
|
| 88 | 88 | $bbbsession['welcome'] .= '<br><br>'.get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
| 89 | +} |
|
| 89 | 90 | $bbbsession['tagging'] = $bigbluebuttonbn->tagging; |
| 90 | 91 | |
| 91 | 92 | $bbbsession['openingtime'] = $bigbluebuttonbn->openingtime; |
@@ -112,22 +113,24 @@ discard block |
||
| 112 | 113 | // Validates if the BigBlueButton server is running |
| 113 | 114 | $serverVersion = bigbluebuttonbn_getServerVersion($bbbsession['endpoint']); |
| 114 | 115 | if ( !isset($serverVersion) ) { //Server is not working |
| 115 | - if ( $bbbsession['administrator'] ) |
|
| 116 | - print_error( 'view_error_unable_join', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
|
| 117 | - else if ( $bbbsession['moderator'] ) |
|
| 118 | - print_error( 'view_error_unable_join_teacher', 'bigbluebuttonbn', $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course ); |
|
| 119 | - else |
|
| 120 | - print_error( 'view_error_unable_join_student', 'bigbluebuttonbn', $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course ); |
|
| 121 | -} else { |
|
| 122 | - $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getMeetingsURL( $bbbsession['endpoint'], $bbbsession['shared_secret'] ) ); |
|
| 123 | - if ( !isset($xml) || !isset($xml->returncode) || $xml->returncode == 'FAILED' ){ // The shared secret is wrong |
|
| 124 | - if ( $bbbsession['administrator'] ) |
|
| 116 | + if ( $bbbsession['administrator'] ) { |
|
| 125 | 117 | print_error( 'view_error_unable_join', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
| 126 | - else if ( $bbbsession['moderator'] ) |
|
| 118 | + } else if ( $bbbsession['moderator'] ) { |
|
| 127 | 119 | print_error( 'view_error_unable_join_teacher', 'bigbluebuttonbn', $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course ); |
| 128 | - else |
|
| 120 | + } else { |
|
| 129 | 121 | print_error( 'view_error_unable_join_student', 'bigbluebuttonbn', $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course ); |
| 130 | 122 | } |
| 123 | + } else { |
|
| 124 | + $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getMeetingsURL( $bbbsession['endpoint'], $bbbsession['shared_secret'] ) ); |
|
| 125 | + if ( !isset($xml) || !isset($xml->returncode) || $xml->returncode == 'FAILED' ){ // The shared secret is wrong |
|
| 126 | + if ( $bbbsession['administrator'] ) { |
|
| 127 | + print_error( 'view_error_unable_join', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
|
| 128 | + } else if ( $bbbsession['moderator'] ) { |
|
| 129 | + print_error( 'view_error_unable_join_teacher', 'bigbluebuttonbn', $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course ); |
|
| 130 | + } else { |
|
| 131 | + print_error( 'view_error_unable_join_student', 'bigbluebuttonbn', $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course ); |
|
| 132 | + } |
|
| 133 | + } |
|
| 131 | 134 | } |
| 132 | 135 | |
| 133 | 136 | // Mark viewed by user (if required) |
@@ -343,7 +346,9 @@ discard block |
||
| 343 | 346 | } |
| 344 | 347 | //Generates the meetingID string |
| 345 | 348 | foreach ($mIDs as $mID) { |
| 346 | - if (strlen($meetingID) > 0) $meetingID .= ','; |
|
| 349 | + if (strlen($meetingID) > 0) { |
|
| 350 | + $meetingID .= ','; |
|
| 351 | + } |
|
| 347 | 352 | $meetingID .= $mID; |
| 348 | 353 | } |
| 349 | 354 | } |