@@ -11,8 +11,8 @@ discard block |
||
| 11 | 11 | |
| 12 | 12 | defined('MOODLE_INTERNAL') || die(); |
| 13 | 13 | |
| 14 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
| 15 | -require_once($CFG->dirroot.'/course/moodleform_mod.php'); |
|
| 14 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
| 15 | +require_once($CFG->dirroot . '/course/moodleform_mod.php'); |
|
| 16 | 16 | |
| 17 | 17 | class mod_bigbluebuttonbn_mod_form extends moodleform_mod { |
| 18 | 18 | |
@@ -50,24 +50,24 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | //Validates if the BigBlueButton server is running |
| 52 | 52 | $serverVersion = bigbluebuttonbn_getServerVersion($endpoint); |
| 53 | - if ( !isset($serverVersion) ) { |
|
| 54 | - print_error( 'general_error_unable_connect', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
|
| 53 | + if (!isset($serverVersion)) { |
|
| 54 | + print_error('general_error_unable_connect', 'bigbluebuttonbn', $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - $mform =& $this->_form; |
|
| 58 | - $current_activity =& $this->current; |
|
| 57 | + $mform = & $this->_form; |
|
| 58 | + $current_activity = & $this->current; |
|
| 59 | 59 | |
| 60 | 60 | //------------------------------------------------------------------------------- |
| 61 | 61 | // First block starts here |
| 62 | 62 | //------------------------------------------------------------------------------- |
| 63 | 63 | $mform->addElement('header', 'general', get_string('mod_form_block_general', 'bigbluebuttonbn')); |
| 64 | 64 | |
| 65 | - $mform->addElement('text', 'name', get_string('mod_form_field_name','bigbluebuttonbn'), 'maxlength="64" size="32"'); |
|
| 65 | + $mform->addElement('text', 'name', get_string('mod_form_field_name', 'bigbluebuttonbn'), 'maxlength="64" size="32"'); |
|
| 66 | 66 | $mform->setType('name', PARAM_TEXT); |
| 67 | 67 | $mform->addRule('name', null, 'required', null, 'client'); |
| 68 | 68 | |
| 69 | 69 | $version_major = bigbluebuttonbn_get_moodle_version_major(); |
| 70 | - if ( $version_major < '2015051100' ) { |
|
| 70 | + if ($version_major < '2015051100') { |
|
| 71 | 71 | //This is valid before v2.9 |
| 72 | 72 | $this->add_intro_editor(false, get_string('mod_form_field_intro', 'bigbluebuttonbn')); |
| 73 | 73 | } else { |
@@ -77,60 +77,60 @@ discard block |
||
| 77 | 77 | $mform->setAdvanced('introeditor'); |
| 78 | 78 | $mform->setAdvanced('showdescription'); |
| 79 | 79 | |
| 80 | - $mform->addElement('textarea', 'welcome', get_string('mod_form_field_welcome','bigbluebuttonbn'), 'wrap="virtual" rows="5" cols="60"'); |
|
| 80 | + $mform->addElement('textarea', 'welcome', get_string('mod_form_field_welcome', 'bigbluebuttonbn'), 'wrap="virtual" rows="5" cols="60"'); |
|
| 81 | 81 | $mform->addHelpButton('welcome', 'mod_form_field_welcome', 'bigbluebuttonbn'); |
| 82 | 82 | $mform->setType('welcome', PARAM_TEXT); |
| 83 | 83 | $mform->setAdvanced('welcome'); |
| 84 | 84 | |
| 85 | - if ( $voicebridge_editable ) { |
|
| 86 | - $mform->addElement('text', 'voicebridge', get_string('mod_form_field_voicebridge','bigbluebuttonbn'), array('maxlength'=>4, 'size'=>6)); |
|
| 85 | + if ($voicebridge_editable) { |
|
| 86 | + $mform->addElement('text', 'voicebridge', get_string('mod_form_field_voicebridge', 'bigbluebuttonbn'), array('maxlength'=>4, 'size'=>6)); |
|
| 87 | 87 | $mform->addRule('voicebridge', get_string('mod_form_field_voicebridge_format_error', 'bigbluebuttonbn'), 'numeric', '####', 'server'); |
| 88 | - $mform->setDefault( 'voicebridge', 0 ); |
|
| 88 | + $mform->setDefault('voicebridge', 0); |
|
| 89 | 89 | $mform->addHelpButton('voicebridge', 'mod_form_field_voicebridge', 'bigbluebuttonbn'); |
| 90 | 90 | $mform->setAdvanced('voicebridge'); |
| 91 | 91 | } |
| 92 | 92 | $mform->setType('voicebridge', PARAM_INT); |
| 93 | 93 | |
| 94 | - if ( $waitformoderator_editable ) { |
|
| 94 | + if ($waitformoderator_editable) { |
|
| 95 | 95 | $mform->addElement('checkbox', 'wait', get_string('mod_form_field_wait', 'bigbluebuttonbn')); |
| 96 | 96 | $mform->addHelpButton('wait', 'mod_form_field_wait', 'bigbluebuttonbn'); |
| 97 | - $mform->setDefault( 'wait', $waitformoderator_default ); |
|
| 97 | + $mform->setDefault('wait', $waitformoderator_default); |
|
| 98 | 98 | $mform->setAdvanced('wait'); |
| 99 | 99 | } else { |
| 100 | - $mform->addElement('hidden', 'wait', $waitformoderator_default ); |
|
| 100 | + $mform->addElement('hidden', 'wait', $waitformoderator_default); |
|
| 101 | 101 | } |
| 102 | 102 | $mform->setType('wait', PARAM_INT); |
| 103 | 103 | |
| 104 | - if ( $userlimit_editable ) { |
|
| 105 | - $mform->addElement('text', 'userlimit', get_string('mod_form_field_userlimit','bigbluebuttonbn'), 'maxlength="3" size="5"' ); |
|
| 104 | + if ($userlimit_editable) { |
|
| 105 | + $mform->addElement('text', 'userlimit', get_string('mod_form_field_userlimit', 'bigbluebuttonbn'), 'maxlength="3" size="5"'); |
|
| 106 | 106 | $mform->addHelpButton('userlimit', 'mod_form_field_userlimit', 'bigbluebuttonbn'); |
| 107 | - $mform->setDefault( 'userlimit', $userlimit_default ); |
|
| 107 | + $mform->setDefault('userlimit', $userlimit_default); |
|
| 108 | 108 | } else { |
| 109 | - $mform->addElement('hidden', 'userlimit', $userlimit_default ); |
|
| 109 | + $mform->addElement('hidden', 'userlimit', $userlimit_default); |
|
| 110 | 110 | } |
| 111 | 111 | $mform->setType('userlimit', PARAM_TEXT); |
| 112 | 112 | |
| 113 | - if ( floatval($serverVersion) >= 0.8 ) { |
|
| 114 | - if ( $recording_editable ) { |
|
| 113 | + if (floatval($serverVersion) >= 0.8) { |
|
| 114 | + if ($recording_editable) { |
|
| 115 | 115 | $mform->addElement('checkbox', 'record', get_string('mod_form_field_record', 'bigbluebuttonbn')); |
| 116 | - $mform->setDefault( 'record', $recording_default ); |
|
| 116 | + $mform->setDefault('record', $recording_default); |
|
| 117 | 117 | $mform->setAdvanced('record'); |
| 118 | 118 | } else { |
| 119 | 119 | $mform->addElement('hidden', 'record', $recording_default); |
| 120 | 120 | } |
| 121 | 121 | $mform->setType('record', PARAM_INT); |
| 122 | 122 | |
| 123 | - if ( $recording_tagging_editable ) { |
|
| 123 | + if ($recording_tagging_editable) { |
|
| 124 | 124 | $mform->addElement('checkbox', 'tagging', get_string('mod_form_field_recordingtagging', 'bigbluebuttonbn')); |
| 125 | 125 | $mform->setDefault('tagging', $recording_tagging_default); |
| 126 | 126 | $mform->setAdvanced('tagging'); |
| 127 | 127 | } else { |
| 128 | - $mform->addElement('hidden', 'tagging', $recording_tagging_default ); |
|
| 128 | + $mform->addElement('hidden', 'tagging', $recording_tagging_default); |
|
| 129 | 129 | } |
| 130 | 130 | $mform->setType('tagging', PARAM_INT); |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | - if ( $sendnotifications_enabled ) { |
|
| 133 | + if ($sendnotifications_enabled) { |
|
| 134 | 134 | $mform->addElement('checkbox', 'notification', get_string('mod_form_field_notification', 'bigbluebuttonbn')); |
| 135 | 135 | if ($this->current->instance) { |
| 136 | 136 | $mform->addHelpButton('notification', 'mod_form_field_notification', 'bigbluebuttonbn'); |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | //------------------------------------------------------------------------------- |
| 149 | 149 | // Second block starts here |
| 150 | 150 | //------------------------------------------------------------------------------- |
| 151 | - if ( $preuploadpresentation_enabled ) { |
|
| 151 | + if ($preuploadpresentation_enabled) { |
|
| 152 | 152 | $mform->addElement('header', 'preupload', get_string('mod_form_block_presentation', 'bigbluebuttonbn')); |
| 153 | 153 | $mform->setExpanded('preupload'); |
| 154 | 154 | |
@@ -179,83 +179,83 @@ discard block |
||
| 179 | 179 | $mform->addElement('hidden', 'participants', json_encode($participant_list)); |
| 180 | 180 | $mform->setType('participants', PARAM_TEXT); |
| 181 | 181 | |
| 182 | - $html_participant_selection = ''. |
|
| 183 | - '<div id="fitem_bigbluebuttonbn_participant_selection" class="fitem fitem_fselect">'."\n". |
|
| 184 | - ' <div class="fitemtitle">'."\n". |
|
| 185 | - ' <label for="bigbluebuttonbn_participant_selectiontype">'.get_string('mod_form_field_participant_add', 'bigbluebuttonbn').' </label>'."\n". |
|
| 186 | - ' </div>'."\n". |
|
| 187 | - ' <div class="felement fselect">'."\n". |
|
| 188 | - ' <select id="bigbluebuttonbn_participant_selection_type" onchange="bigbluebuttonbn_participant_selection_set(); return 0;">'."\n". |
|
| 189 | - ' <option value="all" selected="selected">'.get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn').'</option>'."\n". |
|
| 190 | - ' <option value="role">'.get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn').'</option>'."\n". |
|
| 191 | - ' <option value="user">'.get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn').'</option>'."\n". |
|
| 192 | - ' </select>'."\n". |
|
| 193 | - ' '."\n". |
|
| 194 | - ' <select id="bigbluebuttonbn_participant_selection" disabled="disabled">'."\n". |
|
| 195 | - ' <option value="all" selected="selected">---------------</option>'."\n". |
|
| 196 | - ' </select>'."\n". |
|
| 197 | - ' '."\n". |
|
| 198 | - ' <input value="'.get_string('mod_form_field_participant_list_action_add', 'bigbluebuttonbn').'" type="button" id="id_addselectionid" onclick="bigbluebuttonbn_participant_add(); return 0;" />'."\n". |
|
| 199 | - ' </div>'."\n". |
|
| 200 | - '</div>'."\n". |
|
| 201 | - '<div id="fitem_bigbluebuttonbn_participant_list" class="fitem">'."\n". |
|
| 202 | - ' <div class="fitemtitle">'."\n". |
|
| 203 | - ' <label for="bigbluebuttonbn_participant_list">'.get_string('mod_form_field_participant_list', 'bigbluebuttonbn').' </label>'."\n". |
|
| 204 | - ' </div>'."\n". |
|
| 205 | - ' <div class="felement fselect">'."\n". |
|
| 206 | - ' <table id="participant_list_table">'."\n"; |
|
| 182 | + $html_participant_selection = '' . |
|
| 183 | + '<div id="fitem_bigbluebuttonbn_participant_selection" class="fitem fitem_fselect">' . "\n" . |
|
| 184 | + ' <div class="fitemtitle">' . "\n" . |
|
| 185 | + ' <label for="bigbluebuttonbn_participant_selectiontype">' . get_string('mod_form_field_participant_add', 'bigbluebuttonbn') . ' </label>' . "\n" . |
|
| 186 | + ' </div>' . "\n" . |
|
| 187 | + ' <div class="felement fselect">' . "\n" . |
|
| 188 | + ' <select id="bigbluebuttonbn_participant_selection_type" onchange="bigbluebuttonbn_participant_selection_set(); return 0;">' . "\n" . |
|
| 189 | + ' <option value="all" selected="selected">' . get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn') . '</option>' . "\n" . |
|
| 190 | + ' <option value="role">' . get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn') . '</option>' . "\n" . |
|
| 191 | + ' <option value="user">' . get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn') . '</option>' . "\n" . |
|
| 192 | + ' </select>' . "\n" . |
|
| 193 | + ' ' . "\n" . |
|
| 194 | + ' <select id="bigbluebuttonbn_participant_selection" disabled="disabled">' . "\n" . |
|
| 195 | + ' <option value="all" selected="selected">---------------</option>' . "\n" . |
|
| 196 | + ' </select>' . "\n" . |
|
| 197 | + ' ' . "\n" . |
|
| 198 | + ' <input value="' . get_string('mod_form_field_participant_list_action_add', 'bigbluebuttonbn') . '" type="button" id="id_addselectionid" onclick="bigbluebuttonbn_participant_add(); return 0;" />' . "\n" . |
|
| 199 | + ' </div>' . "\n" . |
|
| 200 | + '</div>' . "\n" . |
|
| 201 | + '<div id="fitem_bigbluebuttonbn_participant_list" class="fitem">' . "\n" . |
|
| 202 | + ' <div class="fitemtitle">' . "\n" . |
|
| 203 | + ' <label for="bigbluebuttonbn_participant_list">' . get_string('mod_form_field_participant_list', 'bigbluebuttonbn') . ' </label>' . "\n" . |
|
| 204 | + ' </div>' . "\n" . |
|
| 205 | + ' <div class="felement fselect">' . "\n" . |
|
| 206 | + ' <table id="participant_list_table">' . "\n"; |
|
| 207 | 207 | |
| 208 | 208 | // Add participant list |
| 209 | - foreach($participant_list as $participant){ |
|
| 209 | + foreach ($participant_list as $participant) { |
|
| 210 | 210 | $participant_selectionid = ''; |
| 211 | 211 | $participant_selectiontype = $participant['selectiontype']; |
| 212 | - if( $participant_selectiontype == 'all') { |
|
| 213 | - $participant_selectiontype = '<b><i>'.get_string('mod_form_field_participant_list_type_'.$participant_selectiontype, 'bigbluebuttonbn').'</i></b>'; |
|
| 212 | + if ($participant_selectiontype == 'all') { |
|
| 213 | + $participant_selectiontype = '<b><i>' . get_string('mod_form_field_participant_list_type_' . $participant_selectiontype, 'bigbluebuttonbn') . '</i></b>'; |
|
| 214 | 214 | } else { |
| 215 | - if ( $participant_selectiontype == 'role') { |
|
| 215 | + if ($participant_selectiontype == 'role') { |
|
| 216 | 216 | $participant_selectionid = bigbluebuttonbn_get_role_name($participant['selectionid']); |
| 217 | 217 | } else { |
| 218 | - foreach($users as $user){ |
|
| 219 | - if( $user->id == $participant['selectionid']) { |
|
| 220 | - $participant_selectionid = $user->firstname.' '.$user->lastname; |
|
| 218 | + foreach ($users as $user) { |
|
| 219 | + if ($user->id == $participant['selectionid']) { |
|
| 220 | + $participant_selectionid = $user->firstname . ' ' . $user->lastname; |
|
| 221 | 221 | break; |
| 222 | 222 | } |
| 223 | 223 | } |
| 224 | 224 | } |
| 225 | - $participant_selectiontype = '<b><i>'.get_string('mod_form_field_participant_list_type_'.$participant_selectiontype, 'bigbluebuttonbn').':</i></b> '; |
|
| 225 | + $participant_selectiontype = '<b><i>' . get_string('mod_form_field_participant_list_type_' . $participant_selectiontype, 'bigbluebuttonbn') . ':</i></b> '; |
|
| 226 | 226 | } |
| 227 | 227 | |
| 228 | - $html_participant_selection .= ''. |
|
| 229 | - ' <tr id="participant_list_tr_'.$participant['selectiontype'].'-'.$participant['selectionid'].'">'."\n". |
|
| 230 | - ' <td width="20px"><a onclick="bigbluebuttonbn_participant_remove(\''.$participant['selectiontype'].'\', \''.$participant['selectionid'].'\'); return 0;" title="'.get_string('mod_form_field_participant_list_action_remove', 'bigbluebuttonbn').'">x</a></td>'."\n". |
|
| 231 | - ' <td width="125px">'.$participant_selectiontype.'</td>'."\n". |
|
| 232 | - ' <td>'.$participant_selectionid.'</td>'."\n". |
|
| 233 | - ' <td><i> '.get_string('mod_form_field_participant_list_text_as', 'bigbluebuttonbn').' </i>'."\n". |
|
| 234 | - ' <select id="participant_list_role_'.$participant['selectiontype'].'-'.$participant['selectionid'].'" onchange="bigbluebuttonbn_participant_list_role_update(\''.$participant['selectiontype'].'\', \''.$participant['selectionid'].'\'); return 0;">'."\n". |
|
| 235 | - ' <option value="'.BIGBLUEBUTTONBN_ROLE_VIEWER.'" '.($participant['role'] == BIGBLUEBUTTONBN_ROLE_VIEWER? 'selected="selected" ': '').'>'.get_string('mod_form_field_participant_bbb_role_'.BIGBLUEBUTTONBN_ROLE_VIEWER, 'bigbluebuttonbn').'</option>'."\n". |
|
| 236 | - ' <option value="'.BIGBLUEBUTTONBN_ROLE_MODERATOR.'" '.($participant['role'] == BIGBLUEBUTTONBN_ROLE_MODERATOR? 'selected="selected" ': '').'>'.get_string('mod_form_field_participant_bbb_role_'.BIGBLUEBUTTONBN_ROLE_MODERATOR, 'bigbluebuttonbn').'</option><select>'."\n". |
|
| 237 | - ' </td>'."\n". |
|
| 238 | - ' </tr>'."\n"; |
|
| 228 | + $html_participant_selection .= '' . |
|
| 229 | + ' <tr id="participant_list_tr_' . $participant['selectiontype'] . '-' . $participant['selectionid'] . '">' . "\n" . |
|
| 230 | + ' <td width="20px"><a onclick="bigbluebuttonbn_participant_remove(\'' . $participant['selectiontype'] . '\', \'' . $participant['selectionid'] . '\'); return 0;" title="' . get_string('mod_form_field_participant_list_action_remove', 'bigbluebuttonbn') . '">x</a></td>' . "\n" . |
|
| 231 | + ' <td width="125px">' . $participant_selectiontype . '</td>' . "\n" . |
|
| 232 | + ' <td>' . $participant_selectionid . '</td>' . "\n" . |
|
| 233 | + ' <td><i> ' . get_string('mod_form_field_participant_list_text_as', 'bigbluebuttonbn') . ' </i>' . "\n" . |
|
| 234 | + ' <select id="participant_list_role_' . $participant['selectiontype'] . '-' . $participant['selectionid'] . '" onchange="bigbluebuttonbn_participant_list_role_update(\'' . $participant['selectiontype'] . '\', \'' . $participant['selectionid'] . '\'); return 0;">' . "\n" . |
|
| 235 | + ' <option value="' . BIGBLUEBUTTONBN_ROLE_VIEWER . '" ' . ($participant['role'] == BIGBLUEBUTTONBN_ROLE_VIEWER ? 'selected="selected" ' : '') . '>' . get_string('mod_form_field_participant_bbb_role_' . BIGBLUEBUTTONBN_ROLE_VIEWER, 'bigbluebuttonbn') . '</option>' . "\n" . |
|
| 236 | + ' <option value="' . BIGBLUEBUTTONBN_ROLE_MODERATOR . '" ' . ($participant['role'] == BIGBLUEBUTTONBN_ROLE_MODERATOR ? 'selected="selected" ' : '') . '>' . get_string('mod_form_field_participant_bbb_role_' . BIGBLUEBUTTONBN_ROLE_MODERATOR, 'bigbluebuttonbn') . '</option><select>' . "\n" . |
|
| 237 | + ' </td>' . "\n" . |
|
| 238 | + ' </tr>' . "\n"; |
|
| 239 | 239 | } |
| 240 | 240 | |
| 241 | - $html_participant_selection .= ''. |
|
| 242 | - ' </table>'."\n". |
|
| 243 | - ' </div>'."\n". |
|
| 244 | - '</div>'."\n". |
|
| 245 | - '<script type="text/javascript" src="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/mod_form.js">'."\n". |
|
| 246 | - '</script>'."\n"; |
|
| 241 | + $html_participant_selection .= '' . |
|
| 242 | + ' </table>' . "\n" . |
|
| 243 | + ' </div>' . "\n" . |
|
| 244 | + '</div>' . "\n" . |
|
| 245 | + '<script type="text/javascript" src="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/mod_form.js">' . "\n" . |
|
| 246 | + '</script>' . "\n"; |
|
| 247 | 247 | |
| 248 | 248 | $mform->addElement('html', $html_participant_selection); |
| 249 | 249 | |
| 250 | 250 | // Add data |
| 251 | - $mform->addElement('html', '<script type="text/javascript">var bigbluebuttonbn_participant_selection = {"all": [], "role": '.json_encode($roles).', "user": '.bigbluebuttonbn_get_users_json($users).'}; </script>'); |
|
| 252 | - $mform->addElement('html', '<script type="text/javascript">var bigbluebuttonbn_participant_list = '.json_encode($participant_list).'; </script>'); |
|
| 253 | - $bigbluebuttonbn_strings = Array( "as" => get_string('mod_form_field_participant_list_text_as', 'bigbluebuttonbn'), |
|
| 251 | + $mform->addElement('html', '<script type="text/javascript">var bigbluebuttonbn_participant_selection = {"all": [], "role": ' . json_encode($roles) . ', "user": ' . bigbluebuttonbn_get_users_json($users) . '}; </script>'); |
|
| 252 | + $mform->addElement('html', '<script type="text/javascript">var bigbluebuttonbn_participant_list = ' . json_encode($participant_list) . '; </script>'); |
|
| 253 | + $bigbluebuttonbn_strings = Array("as" => get_string('mod_form_field_participant_list_text_as', 'bigbluebuttonbn'), |
|
| 254 | 254 | "viewer" => get_string('mod_form_field_participant_bbb_role_viewer', 'bigbluebuttonbn'), |
| 255 | 255 | "moderator" => get_string('mod_form_field_participant_bbb_role_moderator', 'bigbluebuttonbn'), |
| 256 | 256 | "remove" => get_string('mod_form_field_participant_list_action_remove', 'bigbluebuttonbn'), |
| 257 | 257 | ); |
| 258 | - $mform->addElement('html', '<script type="text/javascript">var bigbluebuttonbn_strings = '.json_encode($bigbluebuttonbn_strings).'; </script>'); |
|
| 258 | + $mform->addElement('html', '<script type="text/javascript">var bigbluebuttonbn_strings = ' . json_encode($bigbluebuttonbn_strings) . '; </script>'); |
|
| 259 | 259 | //------------------------------------------------------------------------------- |
| 260 | 260 | // Third block ends here |
| 261 | 261 | //------------------------------------------------------------------------------- |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | // Fourth block starts here |
| 266 | 266 | //------------------------------------------------------------------------------- |
| 267 | 267 | $mform->addElement('header', 'schedule', get_string('mod_form_block_schedule', 'bigbluebuttonbn')); |
| 268 | - if( isset($current_activity->openingtime) && $current_activity->openingtime != 0 || isset($current_activity->closingtime) && $current_activity->closingtime != 0 ) |
|
| 268 | + if (isset($current_activity->openingtime) && $current_activity->openingtime != 0 || isset($current_activity->closingtime) && $current_activity->closingtime != 0) |
|
| 269 | 269 | $mform->setExpanded('schedule'); |
| 270 | 270 | |
| 271 | 271 | $mform->addElement('date_time_selector', 'openingtime', get_string('mod_form_field_openingtime', 'bigbluebuttonbn'), array('optional' => true)); |
@@ -293,8 +293,8 @@ discard block |
||
| 293 | 293 | $draftitemid = file_get_submitted_draft_itemid('presentation'); |
| 294 | 294 | file_prepare_draft_area($draftitemid, $this->context->id, 'mod_bigbluebuttonbn', 'presentation', 0, array('subdirs'=>0, 'maxbytes' => 0, 'maxfiles' => 1, 'mainfile' => true)); |
| 295 | 295 | $default_values['presentation'] = $draftitemid; |
| 296 | - } catch (Exception $e){ |
|
| 297 | - error_log("Presentation could not be loaded: ".$e->getMessage()); |
|
| 296 | + } catch (Exception $e) { |
|
| 297 | + error_log("Presentation could not be loaded: " . $e->getMessage()); |
|
| 298 | 298 | return NULL; |
| 299 | 299 | } |
| 300 | 300 | } |
@@ -303,14 +303,14 @@ discard block |
||
| 303 | 303 | function validation($data, $files) { |
| 304 | 304 | $errors = parent::validation($data, $files); |
| 305 | 305 | |
| 306 | - if ( isset($data['openingtime']) && isset($data['closingtime']) ) { |
|
| 307 | - if ( $data['openingtime'] != 0 && $data['closingtime'] != 0 && $data['closingtime'] < $data['openingtime']) { |
|
| 306 | + if (isset($data['openingtime']) && isset($data['closingtime'])) { |
|
| 307 | + if ($data['openingtime'] != 0 && $data['closingtime'] != 0 && $data['closingtime'] < $data['openingtime']) { |
|
| 308 | 308 | $errors['closingtime'] = get_string('bbbduetimeoverstartingtime', 'bigbluebuttonbn'); |
| 309 | 309 | } |
| 310 | 310 | } |
| 311 | 311 | |
| 312 | - if ( isset($data['voicebridge']) ) { |
|
| 313 | - if ( !bigbluebuttonbn_voicebridge_unique($data['voicebridge'], $data['instance'])) { |
|
| 312 | + if (isset($data['voicebridge'])) { |
|
| 313 | + if (!bigbluebuttonbn_voicebridge_unique($data['voicebridge'], $data['instance'])) { |
|
| 314 | 314 | $errors['voicebridge'] = get_string('mod_form_field_voicebridge_notunique_error', 'bigbluebuttonbn'); |
| 315 | 315 | } |
| 316 | 316 | } |
@@ -13,52 +13,52 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | global $BIGBLUEBUTTONBN_CFG; |
| 15 | 15 | |
| 16 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
| 16 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
| 17 | 17 | |
| 18 | 18 | if ($ADMIN->fulltree) { |
| 19 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_server_url) || |
|
| 20 | - !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_shared_secret) ) { |
|
| 21 | - $settings->add( new admin_setting_heading('bigbluebuttonbn_config_general', |
|
| 19 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_server_url) || |
|
| 20 | + !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_shared_secret)) { |
|
| 21 | + $settings->add(new admin_setting_heading('bigbluebuttonbn_config_general', |
|
| 22 | 22 | get_string('config_general', 'bigbluebuttonbn'), |
| 23 | 23 | get_string('config_general_description', 'bigbluebuttonbn'))); |
| 24 | 24 | |
| 25 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_server_url) ) { |
|
| 26 | - $settings->add( new admin_setting_configtext( 'bigbluebuttonbn_server_url', |
|
| 27 | - get_string( 'config_server_url', 'bigbluebuttonbn' ), |
|
| 28 | - get_string( 'config_server_url_description', 'bigbluebuttonbn' ), |
|
| 25 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_server_url)) { |
|
| 26 | + $settings->add(new admin_setting_configtext('bigbluebuttonbn_server_url', |
|
| 27 | + get_string('config_server_url', 'bigbluebuttonbn'), |
|
| 28 | + get_string('config_server_url_description', 'bigbluebuttonbn'), |
|
| 29 | 29 | BIGBLUEBUTTONBN_DEFAULT_SERVER_URL)); |
| 30 | 30 | } |
| 31 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_shared_secret) ) { |
|
| 32 | - $settings->add( new admin_setting_configtext( 'bigbluebuttonbn_shared_secret', |
|
| 33 | - get_string( 'config_shared_secret', 'bigbluebuttonbn' ), |
|
| 34 | - get_string( 'config_shared_secret_description', 'bigbluebuttonbn' ), |
|
| 31 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_shared_secret)) { |
|
| 32 | + $settings->add(new admin_setting_configtext('bigbluebuttonbn_shared_secret', |
|
| 33 | + get_string('config_shared_secret', 'bigbluebuttonbn'), |
|
| 34 | + get_string('config_shared_secret_description', 'bigbluebuttonbn'), |
|
| 35 | 35 | BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET)); |
| 36 | 36 | } |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | //// Configuration for 'recording' feature |
| 40 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_default) || |
|
| 40 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_default) || |
|
| 41 | 41 | !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_editable) || |
| 42 | - !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_icons_enabled) ) { |
|
| 43 | - $settings->add( new admin_setting_heading('bigbluebuttonbn_recording', |
|
| 42 | + !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_icons_enabled)) { |
|
| 43 | + $settings->add(new admin_setting_heading('bigbluebuttonbn_recording', |
|
| 44 | 44 | get_string('config_feature_recording', 'bigbluebuttonbn'), |
| 45 | 45 | get_string('config_feature_recording_description', 'bigbluebuttonbn'))); |
| 46 | 46 | |
| 47 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_default) ) { |
|
| 47 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_default)) { |
|
| 48 | 48 | // default value for 'recording' feature |
| 49 | 49 | $settings->add(new admin_setting_configcheckbox('bigbluebuttonbn_recording_default', |
| 50 | 50 | get_string('config_feature_recording_default', 'bigbluebuttonbn'), |
| 51 | 51 | get_string('config_feature_recording_default_description', 'bigbluebuttonbn'), |
| 52 | 52 | 1)); |
| 53 | 53 | } |
| 54 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_editable) ) { |
|
| 54 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_editable)) { |
|
| 55 | 55 | // UI for 'recording' feature |
| 56 | 56 | $settings->add(new admin_setting_configcheckbox('bigbluebuttonbn_recording_editable', |
| 57 | 57 | get_string('config_feature_recording_editable', 'bigbluebuttonbn'), |
| 58 | 58 | get_string('config_feature_recording_editable_description', 'bigbluebuttonbn'), |
| 59 | 59 | 1)); |
| 60 | 60 | } |
| 61 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_icons_enabled) ) { |
|
| 61 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_icons_enabled)) { |
|
| 62 | 62 | // Front panel for 'recording' managment feature |
| 63 | 63 | $settings->add(new admin_setting_configcheckbox('bigbluebuttonbn_recording_icons_enabled', |
| 64 | 64 | get_string('config_feature_recording_icons_enabled', 'bigbluebuttonbn'), |
@@ -68,13 +68,13 @@ discard block |
||
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | //// Configuration for 'recording tagging' feature |
| 71 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_default) || |
|
| 72 | - !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_editable) ) { |
|
| 73 | - $settings->add( new admin_setting_heading('bigbluebuttonbn_recordingtagging', |
|
| 71 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_default) || |
|
| 72 | + !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_editable)) { |
|
| 73 | + $settings->add(new admin_setting_heading('bigbluebuttonbn_recordingtagging', |
|
| 74 | 74 | get_string('config_feature_recordingtagging', 'bigbluebuttonbn'), |
| 75 | 75 | get_string('config_feature_recordingtagging_description', 'bigbluebuttonbn'))); |
| 76 | 76 | |
| 77 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_default) ) { |
|
| 77 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_default)) { |
|
| 78 | 78 | // default value for 'recording tagging' feature |
| 79 | 79 | $settings->add(new admin_setting_configcheckbox('bigbluebuttonbn_recordingtagging_default', |
| 80 | 80 | get_string('config_feature_recordingtagging_default', 'bigbluebuttonbn'), |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | 0)); |
| 83 | 83 | } |
| 84 | 84 | // UI for 'recording tagging' feature |
| 85 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_editable) ) { |
|
| 85 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_editable)) { |
|
| 86 | 86 | $settings->add(new admin_setting_configcheckbox('bigbluebuttonbn_recordingtagging_editable', |
| 87 | 87 | get_string('config_feature_recordingtagging_editable', 'bigbluebuttonbn'), |
| 88 | 88 | get_string('config_feature_recordingtagging_editable_description', 'bigbluebuttonbn'), |
@@ -91,20 +91,20 @@ discard block |
||
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | //// Configuration for 'import recordings' feature |
| 94 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_enabled) || |
|
| 95 | - !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled) ) { |
|
| 96 | - $settings->add( new admin_setting_heading('bigbluebuttonbn_importrecordings', |
|
| 94 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_enabled) || |
|
| 95 | + !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled)) { |
|
| 96 | + $settings->add(new admin_setting_heading('bigbluebuttonbn_importrecordings', |
|
| 97 | 97 | get_string('config_feature_importrecordings', 'bigbluebuttonbn'), |
| 98 | 98 | get_string('config_feature_importrecordings_description', 'bigbluebuttonbn'))); |
| 99 | 99 | |
| 100 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_enabled) ) { |
|
| 100 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_enabled)) { |
|
| 101 | 101 | // default value for 'import recordings' feature |
| 102 | 102 | $settings->add(new admin_setting_configcheckbox('bigbluebuttonbn_importrecordings_enabled', |
| 103 | 103 | get_string('config_feature_importrecordings_enabled', 'bigbluebuttonbn'), |
| 104 | 104 | get_string('config_feature_importrecordings_enabled_description', 'bigbluebuttonbn'), |
| 105 | 105 | 0)); |
| 106 | 106 | } |
| 107 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled) ) { |
|
| 107 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled)) { |
|
| 108 | 108 | // consider deleted activities for 'import recordings' feature |
| 109 | 109 | $settings->add(new admin_setting_configcheckbox('bigbluebuttonbn_importrecordings_from_deleted_activities_enabled', |
| 110 | 110 | get_string('config_feature_importrecordings_from_deleted_activities_enabled', 'bigbluebuttonbn'), |
@@ -114,36 +114,36 @@ discard block |
||
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | //// Configuration for wait for moderator feature |
| 117 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_default) || |
|
| 117 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_default) || |
|
| 118 | 118 | !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_editable) || |
| 119 | 119 | !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_ping_interval) || |
| 120 | - !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_cache_ttl) ) { |
|
| 121 | - $settings->add( new admin_setting_heading('bigbluebuttonbn_feature_waitformoderator', |
|
| 120 | + !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_cache_ttl)) { |
|
| 121 | + $settings->add(new admin_setting_heading('bigbluebuttonbn_feature_waitformoderator', |
|
| 122 | 122 | get_string('config_feature_waitformoderator', 'bigbluebuttonbn'), |
| 123 | 123 | get_string('config_feature_waitformoderator_description', 'bigbluebuttonbn'))); |
| 124 | 124 | |
| 125 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_default) ) { |
|
| 125 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_default)) { |
|
| 126 | 126 | //default value for 'wait for moderator' feature |
| 127 | 127 | $settings->add(new admin_setting_configcheckbox('bigbluebuttonbn_waitformoderator_default', |
| 128 | 128 | get_string('config_feature_waitformoderator_default', 'bigbluebuttonbn'), |
| 129 | 129 | get_string('config_feature_waitformoderator_default_description', 'bigbluebuttonbn'), |
| 130 | 130 | 0)); |
| 131 | 131 | } |
| 132 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_editable) ) { |
|
| 132 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_editable)) { |
|
| 133 | 133 | // UI for 'wait for moderator' feature |
| 134 | 134 | $settings->add(new admin_setting_configcheckbox('bigbluebuttonbn_waitformoderator_editable', |
| 135 | 135 | get_string('config_feature_waitformoderator_editable', 'bigbluebuttonbn'), |
| 136 | 136 | get_string('config_feature_waitformoderator_editable_description', 'bigbluebuttonbn'), |
| 137 | 137 | 1)); |
| 138 | 138 | } |
| 139 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_ping_interval) ) { |
|
| 139 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_ping_interval)) { |
|
| 140 | 140 | //ping interval value for 'wait for moderator' feature |
| 141 | 141 | $settings->add(new admin_setting_configtext('bigbluebuttonbn_waitformoderator_ping_interval', |
| 142 | 142 | get_string('config_feature_waitformoderator_ping_interval', 'bigbluebuttonbn'), |
| 143 | 143 | get_string('config_feature_waitformoderator_ping_interval_description', 'bigbluebuttonbn'), |
| 144 | 144 | 10, PARAM_INT)); |
| 145 | 145 | } |
| 146 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_cache_ttl) ) { |
|
| 146 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_cache_ttl)) { |
|
| 147 | 147 | //cache TTL value for 'wait for moderator' feature |
| 148 | 148 | $settings->add(new admin_setting_configtext('bigbluebuttonbn_waitformoderator_cache_ttl', |
| 149 | 149 | get_string('config_feature_waitformoderator_cache_ttl', 'bigbluebuttonbn'), |
@@ -153,8 +153,8 @@ discard block |
||
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | //// Configuration for "static voice bridge" feature |
| 156 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_voicebridge_editable) ) { |
|
| 157 | - $settings->add( new admin_setting_heading('bigbluebuttonbn_feature_voicebridge', |
|
| 156 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_voicebridge_editable)) { |
|
| 157 | + $settings->add(new admin_setting_heading('bigbluebuttonbn_feature_voicebridge', |
|
| 158 | 158 | get_string('config_feature_voicebridge', 'bigbluebuttonbn'), |
| 159 | 159 | get_string('config_feature_voicebridge_description', 'bigbluebuttonbn'))); |
| 160 | 160 | |
@@ -166,10 +166,10 @@ discard block |
||
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | //// Configuration for "preupload presentation" feature |
| 169 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_preuploadpresentation_enabled) ) { |
|
| 169 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_preuploadpresentation_enabled)) { |
|
| 170 | 170 | // This feature only works if curl is installed |
| 171 | 171 | if (extension_loaded('curl')) { |
| 172 | - $settings->add( new admin_setting_heading('bigbluebuttonbn_feature_preuploadpresentation', |
|
| 172 | + $settings->add(new admin_setting_heading('bigbluebuttonbn_feature_preuploadpresentation', |
|
| 173 | 173 | get_string('config_feature_preuploadpresentation', 'bigbluebuttonbn'), |
| 174 | 174 | get_string('config_feature_preuploadpresentation_description', 'bigbluebuttonbn') |
| 175 | 175 | )); |
@@ -180,29 +180,29 @@ discard block |
||
| 180 | 180 | get_string('config_feature_preuploadpresentation_enabled_description', 'bigbluebuttonbn'), |
| 181 | 181 | 0)); |
| 182 | 182 | } else { |
| 183 | - $settings->add( new admin_setting_heading('bigbluebuttonbn_feature_preuploadpresentation', |
|
| 183 | + $settings->add(new admin_setting_heading('bigbluebuttonbn_feature_preuploadpresentation', |
|
| 184 | 184 | get_string('config_feature_preuploadpresentation', 'bigbluebuttonbn'), |
| 185 | - get_string('config_feature_preuploadpresentation_description', 'bigbluebuttonbn').'<br><br>'. |
|
| 186 | - '<div class="form-defaultinfo">'.get_string('config_warning_curl_not_installed', 'bigbluebuttonbn').'</div><br>' |
|
| 185 | + get_string('config_feature_preuploadpresentation_description', 'bigbluebuttonbn') . '<br><br>' . |
|
| 186 | + '<div class="form-defaultinfo">' . get_string('config_warning_curl_not_installed', 'bigbluebuttonbn') . '</div><br>' |
|
| 187 | 187 | )); |
| 188 | 188 | } |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | //// Configuration for "user limit" feature |
| 192 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_default) || |
|
| 193 | - !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_editable) ) { |
|
| 194 | - $settings->add( new admin_setting_heading('config_userlimit', |
|
| 192 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_default) || |
|
| 193 | + !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_editable)) { |
|
| 194 | + $settings->add(new admin_setting_heading('config_userlimit', |
|
| 195 | 195 | get_string('config_feature_userlimit', 'bigbluebuttonbn'), |
| 196 | 196 | get_string('config_feature_userlimit_description', 'bigbluebuttonbn'))); |
| 197 | 197 | |
| 198 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_default) ) { |
|
| 198 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_default)) { |
|
| 199 | 199 | //default value for 'user limit' feature |
| 200 | 200 | $settings->add(new admin_setting_configtext('bigbluebuttonbn_userlimit_default', |
| 201 | 201 | get_string('config_feature_userlimit_default', 'bigbluebuttonbn'), |
| 202 | 202 | get_string('config_feature_userlimit_default_description', 'bigbluebuttonbn'), |
| 203 | 203 | 0, PARAM_INT)); |
| 204 | 204 | } |
| 205 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_editable) ) { |
|
| 205 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_editable)) { |
|
| 206 | 206 | // UI for 'user limit' feature |
| 207 | 207 | $settings->add(new admin_setting_configcheckbox('bigbluebuttonbn_userlimit_editable', |
| 208 | 208 | get_string('config_feature_userlimit_editable', 'bigbluebuttonbn'), |
@@ -212,8 +212,8 @@ discard block |
||
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | //// Configuration for "scheduled duration" feature |
| 215 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_scheduled_duration_enabled) ) { |
|
| 216 | - $settings->add( new admin_setting_heading('config_scheduled', |
|
| 215 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_scheduled_duration_enabled)) { |
|
| 216 | + $settings->add(new admin_setting_heading('config_scheduled', |
|
| 217 | 217 | get_string('config_scheduled', 'bigbluebuttonbn'), |
| 218 | 218 | get_string('config_scheduled_description', 'bigbluebuttonbn'))); |
| 219 | 219 | |
@@ -237,8 +237,8 @@ discard block |
||
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | //// Configuration for defining the default role/user that will be moderator on new activities |
| 240 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_moderator_default) ) { |
|
| 241 | - $settings->add( new admin_setting_heading('bigbluebuttonbn_permission', |
|
| 240 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_moderator_default)) { |
|
| 241 | + $settings->add(new admin_setting_heading('bigbluebuttonbn_permission', |
|
| 242 | 242 | get_string('config_permission', 'bigbluebuttonbn'), |
| 243 | 243 | get_string('config_permission_description', 'bigbluebuttonbn'))); |
| 244 | 244 | |
@@ -252,8 +252,8 @@ discard block |
||
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | //// Configuration for "send notifications" feature |
| 255 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_sendnotifications_enabled) ) { |
|
| 256 | - $settings->add( new admin_setting_heading('bigbluebuttonbn_feature_sendnotifications', |
|
| 255 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_sendnotifications_enabled)) { |
|
| 256 | + $settings->add(new admin_setting_heading('bigbluebuttonbn_feature_sendnotifications', |
|
| 257 | 257 | get_string('config_feature_sendnotifications', 'bigbluebuttonbn'), |
| 258 | 258 | get_string('config_feature_sendnotifications_description', 'bigbluebuttonbn'))); |
| 259 | 259 | |
@@ -265,10 +265,10 @@ discard block |
||
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 | //// Configuration for extended BN capabilities |
| 268 | - if( bigbluebuttonbn_server_offers_bn_capabilities() ) { |
|
| 268 | + if (bigbluebuttonbn_server_offers_bn_capabilities()) { |
|
| 269 | 269 | //// Configuration for 'notify users when recording ready' feature |
| 270 | - if( !isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingready_enabled) ) { |
|
| 271 | - $settings->add( new admin_setting_heading('bigbluebuttonbn_extended_capabilities', |
|
| 270 | + if (!isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingready_enabled)) { |
|
| 271 | + $settings->add(new admin_setting_heading('bigbluebuttonbn_extended_capabilities', |
|
| 272 | 272 | get_string('config_extended_capabilities', 'bigbluebuttonbn'), |
| 273 | 273 | get_string('config_extended_capabilities_description', 'bigbluebuttonbn'))); |
| 274 | 274 | |
@@ -81,49 +81,49 @@ |
||
| 81 | 81 | $can_join = false; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - if( $bbbsession['administrator'] || $bbbsession['moderator'] ) { |
|
| 84 | + if ($bbbsession['administrator'] || $bbbsession['moderator']) { |
|
| 85 | 85 | $end_button_text = get_string('view_conference_action_end', 'bigbluebuttonbn'); |
| 86 | 86 | $can_end = true; |
| 87 | - $status_can_end = '"can_end": true, "end_button_text": "'.$end_button_text.'", '; |
|
| 87 | + $status_can_end = '"can_end": true, "end_button_text": "' . $end_button_text . '", '; |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | } else { |
| 91 | 91 | // If user is administrator, moderator or if is viewer and no waiting is required |
| 92 | 92 | $join_button_text = get_string('view_conference_action_join', 'bigbluebuttonbn'); |
| 93 | - if ( $bbbsession['administrator'] || $bbbsession['moderator'] || !$bbbsession['wait'] ) { |
|
| 93 | + if ($bbbsession['administrator'] || $bbbsession['moderator'] || !$bbbsession['wait']) { |
|
| 94 | 94 | $initial_message = get_string('view_message_conference_room_ready', 'bigbluebuttonbn'); |
| 95 | 95 | $can_join = true; |
| 96 | 96 | |
| 97 | 97 | } else { |
| 98 | 98 | $initial_message = get_string('view_message_conference_not_started', 'bigbluebuttonbn'); |
| 99 | - if ( $bbbsession['wait'] ) { |
|
| 100 | - $initial_message .= ' '.get_string('view_message_conference_wait_for_moderator', 'bigbluebuttonbn'); |
|
| 99 | + if ($bbbsession['wait']) { |
|
| 100 | + $initial_message .= ' ' . get_string('view_message_conference_wait_for_moderator', 'bigbluebuttonbn'); |
|
| 101 | 101 | } |
| 102 | 102 | $can_join = false; |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | - if( $bbbsession['tagging'] && ($bbbsession['administrator'] || $bbbsession['moderator']) ) { |
|
| 105 | + if ($bbbsession['tagging'] && ($bbbsession['administrator'] || $bbbsession['moderator'])) { |
|
| 106 | 106 | $can_tag = true; |
| 107 | 107 | |
| 108 | 108 | } else { |
| 109 | 109 | $can_tag = false; |
| 110 | 110 | } |
| 111 | - $status_can_end = '"can_tag": '.($can_tag? 'true': 'false').', '; |
|
| 111 | + $status_can_end = '"can_tag": ' . ($can_tag ? 'true' : 'false') . ', '; |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | - echo $params['callback'].'({ "running": '.($meeting_running? 'true':'false').', "info": '.json_encode($meeting_info).', "status": {"can_join": '.($can_join? 'true':'false').',"join_url": "'.$bbbsession['joinURL'].'","join_button_text": "'.$join_button_text.'", '.$status_can_end.$status_can_tag.'"message": "'.$initial_message.'"} });'; |
|
| 114 | + echo $params['callback'] . '({ "running": ' . ($meeting_running ? 'true' : 'false') . ', "info": ' . json_encode($meeting_info) . ', "status": {"can_join": ' . ($can_join ? 'true' : 'false') . ',"join_url": "' . $bbbsession['joinURL'] . '","join_button_text": "' . $join_button_text . '", ' . $status_can_end . $status_can_tag . '"message": "' . $initial_message . '"} });'; |
|
| 115 | 115 | break; |
| 116 | 116 | case 'meeting_end': |
| 117 | - if( $bbbsession['administrator'] || $bbbsession['moderator'] ) { |
|
| 117 | + if ($bbbsession['administrator'] || $bbbsession['moderator']) { |
|
| 118 | 118 | //Execute the end command |
| 119 | 119 | $meeting_info = bigbluebuttonbn_bbb_broker_do_end_meeting($params['id'], $bbbsession['modPW']); |
| 120 | 120 | // Moodle event logger: Create an event for meeting ended |
| 121 | - if( isset($bigbluebuttonbn) ) |
|
| 121 | + if (isset($bigbluebuttonbn)) |
|
| 122 | 122 | bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_ENDED, $bigbluebuttonbn, $context, $cm); |
| 123 | 123 | // Update the cache |
| 124 | 124 | $meeting_info = bigbluebuttonbn_bbb_broker_get_meeting_info($params['id'], $bbbsession['modPW'], true); |
| 125 | 125 | |
| 126 | - echo $params['callback'].'({ "status": true });'; |
|
| 126 | + echo $params['callback'] . '({ "status": true });'; |
|
| 127 | 127 | } else { |
| 128 | 128 | error_log("ERROR: User not authorized to execute end command"); |
| 129 | 129 | header("HTTP/1.0 401 Unauthorized. User not authorized to execute end command"); |
@@ -38,8 +38,8 @@ |
||
| 38 | 38 | * @return string |
| 39 | 39 | */ |
| 40 | 40 | public function get_description() { |
| 41 | - $rid = isset($this->other['rid'])? $this->other['rid']: ''; |
|
| 42 | - $a = (object) array('userid' => $this->userid, 'recordingid' => $rid, 'courseid' => $this->contextinstanceid); |
|
| 41 | + $rid = isset($this->other['rid']) ? $this->other['rid'] : ''; |
|
| 42 | + $a = (object)array('userid' => $this->userid, 'recordingid' => $rid, 'courseid' => $this->contextinstanceid); |
|
| 43 | 43 | return "The user with id '$a->userid' has deleted a recording with id '$a->recordingid' from the course id '$a->courseid'."; |
| 44 | 44 | } |
| 45 | 45 | |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | * @return string |
| 39 | 39 | */ |
| 40 | 40 | public function get_description() { |
| 41 | - $a = (object) array('userid' => $this->userid, 'bigbluebuttonbnid' => $this->objectid, 'courseid' => $this->contextinstanceid); |
|
| 41 | + $a = (object)array('userid' => $this->userid, 'bigbluebuttonbnid' => $this->objectid, 'courseid' => $this->contextinstanceid); |
|
| 42 | 42 | return "The user with id '$a->userid' viewed the bigbluebuttonbn activity with id '$a->bigbluebuttonbnid' for " . |
| 43 | 43 | "the course id '$a->courseid'."; |
| 44 | 44 | } |
@@ -38,8 +38,8 @@ |
||
| 38 | 38 | * @return string |
| 39 | 39 | */ |
| 40 | 40 | public function get_description() { |
| 41 | - $rid = isset($this->other['rid'])? $this->other['rid']: ''; |
|
| 42 | - $a = (object) array('userid' => $this->userid, 'recordingid' => $rid, 'courseid' => $this->contextinstanceid); |
|
| 41 | + $rid = isset($this->other['rid']) ? $this->other['rid'] : ''; |
|
| 42 | + $a = (object)array('userid' => $this->userid, 'recordingid' => $rid, 'courseid' => $this->contextinstanceid); |
|
| 43 | 43 | return "The user with id '$a->userid' has unpublished a recording with id '$a->recordingid' in the course id '$a->courseid'."; |
| 44 | 44 | } |
| 45 | 45 | |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | * @return string |
| 39 | 39 | */ |
| 40 | 40 | public function get_description() { |
| 41 | - $a = (object) array('userid' => $this->userid, 'bigbluebuttonbnid' => $this->objectid, 'courseid' => $this->contextinstanceid); |
|
| 41 | + $a = (object)array('userid' => $this->userid, 'bigbluebuttonbnid' => $this->objectid, 'courseid' => $this->contextinstanceid); |
|
| 42 | 42 | return "The user with id '$a->userid' has joined a bigbluebutton meeting for the bigbluebuttonbn activity with id '$a->bigbluebuttonbnid' for the course id '$a->courseid'."; |
| 43 | 43 | } |
| 44 | 44 | |
@@ -38,8 +38,8 @@ |
||
| 38 | 38 | * @return string |
| 39 | 39 | */ |
| 40 | 40 | public function get_description() { |
| 41 | - $rid = isset($this->other['rid'])? $this->other['rid']: ''; |
|
| 42 | - $a = (object) array('userid' => $this->userid, 'recordingid' => $rid, 'courseid' => $this->contextinstanceid); |
|
| 41 | + $rid = isset($this->other['rid']) ? $this->other['rid'] : ''; |
|
| 42 | + $a = (object)array('userid' => $this->userid, 'recordingid' => $rid, 'courseid' => $this->contextinstanceid); |
|
| 43 | 43 | return "The user with id '$a->userid' has imported a recording with id '$a->recordingid' into the course id '$a->courseid'."; |
| 44 | 44 | } |
| 45 | 45 | |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | * @return string |
| 39 | 39 | */ |
| 40 | 40 | public function get_description() { |
| 41 | - $a = (object) array('userid' => $this->userid, 'bigbluebuttonbnid' => $this->objectid, 'courseid' => $this->contextinstanceid); |
|
| 41 | + $a = (object)array('userid' => $this->userid, 'bigbluebuttonbnid' => $this->objectid, 'courseid' => $this->contextinstanceid); |
|
| 42 | 42 | return "The user with id '$a->userid' created a bigbluebutton meeting for the bigbluebuttonbn activity with id '$a->bigbluebuttonbnid' for the course id '$a->courseid'."; |
| 43 | 43 | } |
| 44 | 44 | |