|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* Config all BigBlueButtonBN instances in this course. |
|
4
|
|
|
* |
|
5
|
|
|
* @package mod_bigbluebuttonbn |
|
6
|
|
|
* @author Fred Dixon (ffdixon [at] blindsidenetworks [dt] com) |
|
7
|
|
|
* @author Jesus Federico (jesus [at] blindsidenetworks [dt] com) |
|
8
|
|
|
* @copyright 2010-2015 Blindside Networks Inc. |
|
9
|
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v2 or later |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
defined('MOODLE_INTERNAL') || die(); |
|
13
|
|
|
|
|
14
|
|
|
require_once(dirname(__FILE__).'/locallib.php'); |
|
15
|
|
|
require_once($CFG->dirroot.'/course/moodleform_mod.php'); |
|
16
|
|
|
|
|
17
|
|
|
class mod_bigbluebuttonbn_mod_form extends moodleform_mod { |
|
18
|
|
|
|
|
19
|
|
|
function definition() { |
|
|
|
|
|
|
20
|
|
|
global $CFG, $DB, $USER, $BIGBLUEBUTTONBN_CFG; |
|
21
|
|
|
|
|
22
|
|
|
$course_id = optional_param('course', 0, PARAM_INT); // course ID, or |
|
23
|
|
|
$course_module_id = optional_param('update', 0, PARAM_INT); // course_module ID, or |
|
24
|
|
|
if ($course_id) { |
|
25
|
|
|
$course = $DB->get_record('course', array('id' => $course_id), '*', MUST_EXIST); |
|
26
|
|
|
$bigbluebuttonbn = null; |
|
27
|
|
|
} else if ($course_module_id) { |
|
28
|
|
|
$cm = get_coursemodule_from_id('bigbluebuttonbn', $course_module_id, 0, false, MUST_EXIST); |
|
29
|
|
|
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST); |
|
30
|
|
|
$bigbluebuttonbn = $DB->get_record('bigbluebuttonbn', array('id' => $cm->instance), '*', MUST_EXIST); |
|
31
|
|
|
} |
|
32
|
|
|
|
|
33
|
|
|
$context = bigbluebuttonbn_get_context_course($course->id); |
|
|
|
|
|
|
34
|
|
|
|
|
35
|
|
|
//BigBlueButton server data |
|
36
|
|
|
$endpoint = bigbluebuttonbn_get_cfg_server_url(); |
|
37
|
|
|
|
|
38
|
|
|
//UI configuration options |
|
39
|
|
|
$voicebridge_editable = bigbluebuttonbn_get_cfg_voicebridge_editable(); |
|
40
|
|
|
$recording_default = bigbluebuttonbn_get_cfg_recording_default(); |
|
41
|
|
|
$recording_editable = bigbluebuttonbn_get_cfg_recording_editable(); |
|
42
|
|
|
$recording_tagging_default = bigbluebuttonbn_get_cfg_recording_tagging_default(); |
|
43
|
|
|
$recording_tagging_editable = bigbluebuttonbn_get_cfg_recording_tagging_editable(); |
|
44
|
|
|
$waitformoderator_default = bigbluebuttonbn_get_cfg_waitformoderator_default(); |
|
45
|
|
|
$waitformoderator_editable = bigbluebuttonbn_get_cfg_waitformoderator_editable(); |
|
46
|
|
|
$userlimit_default = bigbluebuttonbn_get_cfg_userlimit_default(); |
|
47
|
|
|
$userlimit_editable = bigbluebuttonbn_get_cfg_userlimit_editable(); |
|
48
|
|
|
$preuploadpresentation_enabled = bigbluebuttonbn_get_cfg_preuploadpresentation_enabled(); |
|
49
|
|
|
$sendnotifications_enabled = bigbluebuttonbn_get_cfg_sendnotifications_enabled(); |
|
50
|
|
|
|
|
51
|
|
|
//Validates if the BigBlueButton server is running |
|
52
|
|
|
$serverVersion = bigbluebuttonbn_getServerVersion($endpoint); |
|
53
|
|
|
if ( !isset($serverVersion) ) { |
|
54
|
|
|
print_error( 'general_error_unable_connect', 'bigbluebuttonbn', $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn' ); |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
$mform =& $this->_form; |
|
58
|
|
|
$current_activity =& $this->current; |
|
59
|
|
|
|
|
60
|
|
|
//------------------------------------------------------------------------------- |
|
61
|
|
|
// First block starts here |
|
62
|
|
|
//------------------------------------------------------------------------------- |
|
63
|
|
|
$mform->addElement('header', 'general', get_string('mod_form_block_general', 'bigbluebuttonbn')); |
|
64
|
|
|
|
|
65
|
|
|
$mform->addElement('text', 'name', get_string('mod_form_field_name','bigbluebuttonbn'), 'maxlength="64" size="32"'); |
|
66
|
|
|
$mform->setType('name', PARAM_TEXT); |
|
67
|
|
|
$mform->addRule('name', null, 'required', null, 'client'); |
|
68
|
|
|
|
|
69
|
|
|
$version_major = bigbluebuttonbn_get_moodle_version_major(); |
|
70
|
|
|
if ( $version_major < '2015051100' ) { |
|
71
|
|
|
//This is valid before v2.9 |
|
72
|
|
|
$this->add_intro_editor(false, get_string('mod_form_field_intro', 'bigbluebuttonbn')); |
|
73
|
|
|
} else { |
|
74
|
|
|
//This is valid after v2.9 |
|
75
|
|
|
$this->standard_intro_elements(get_string('mod_form_field_intro', 'bigbluebuttonbn')); |
|
76
|
|
|
} |
|
77
|
|
|
$mform->setAdvanced('introeditor'); |
|
78
|
|
|
$mform->setAdvanced('showdescription'); |
|
79
|
|
|
|
|
80
|
|
|
$mform->addElement('textarea', 'welcome', get_string('mod_form_field_welcome','bigbluebuttonbn'), 'wrap="virtual" rows="5" cols="60"'); |
|
81
|
|
|
$mform->addHelpButton('welcome', 'mod_form_field_welcome', 'bigbluebuttonbn'); |
|
82
|
|
|
$mform->setType('welcome', PARAM_TEXT); |
|
83
|
|
|
$mform->setAdvanced('welcome'); |
|
84
|
|
|
|
|
85
|
|
|
if ( $voicebridge_editable ) { |
|
86
|
|
|
$mform->addElement('text', 'voicebridge', get_string('mod_form_field_voicebridge','bigbluebuttonbn'), array('maxlength'=>4, 'size'=>6)); |
|
87
|
|
|
$mform->addRule('voicebridge', get_string('mod_form_field_voicebridge_format_error', 'bigbluebuttonbn'), 'numeric', '####', 'server'); |
|
88
|
|
|
$mform->setDefault( 'voicebridge', 0 ); |
|
89
|
|
|
$mform->addHelpButton('voicebridge', 'mod_form_field_voicebridge', 'bigbluebuttonbn'); |
|
90
|
|
|
$mform->setAdvanced('voicebridge'); |
|
91
|
|
|
} |
|
92
|
|
|
$mform->setType('voicebridge', PARAM_INT); |
|
93
|
|
|
|
|
94
|
|
View Code Duplication |
if ( $waitformoderator_editable ) { |
|
|
|
|
|
|
95
|
|
|
$mform->addElement('checkbox', 'wait', get_string('mod_form_field_wait', 'bigbluebuttonbn')); |
|
96
|
|
|
$mform->addHelpButton('wait', 'mod_form_field_wait', 'bigbluebuttonbn'); |
|
97
|
|
|
$mform->setDefault( 'wait', $waitformoderator_default ); |
|
98
|
|
|
$mform->setAdvanced('wait'); |
|
99
|
|
|
} else { |
|
100
|
|
|
$mform->addElement('hidden', 'wait', $waitformoderator_default ); |
|
101
|
|
|
} |
|
102
|
|
|
$mform->setType('wait', PARAM_INT); |
|
103
|
|
|
|
|
104
|
|
View Code Duplication |
if ( $userlimit_editable ) { |
|
|
|
|
|
|
105
|
|
|
$mform->addElement('text', 'userlimit', get_string('mod_form_field_userlimit','bigbluebuttonbn'), 'maxlength="3" size="5"' ); |
|
106
|
|
|
$mform->addHelpButton('userlimit', 'mod_form_field_userlimit', 'bigbluebuttonbn'); |
|
107
|
|
|
$mform->setDefault( 'userlimit', $userlimit_default ); |
|
108
|
|
|
} else { |
|
109
|
|
|
$mform->addElement('hidden', 'userlimit', $userlimit_default ); |
|
110
|
|
|
} |
|
111
|
|
|
$mform->setType('userlimit', PARAM_TEXT); |
|
112
|
|
|
|
|
113
|
|
|
if ( floatval($serverVersion) >= 0.8 ) { |
|
114
|
|
View Code Duplication |
if ( $recording_editable ) { |
|
|
|
|
|
|
115
|
|
|
$mform->addElement('checkbox', 'record', get_string('mod_form_field_record', 'bigbluebuttonbn')); |
|
116
|
|
|
$mform->setDefault( 'record', $recording_default ); |
|
117
|
|
|
$mform->setAdvanced('record'); |
|
118
|
|
|
} else { |
|
119
|
|
|
$mform->addElement('hidden', 'record', $recording_default); |
|
120
|
|
|
} |
|
121
|
|
|
$mform->setType('record', PARAM_INT); |
|
122
|
|
|
|
|
123
|
|
View Code Duplication |
if ( $recording_tagging_editable ) { |
|
|
|
|
|
|
124
|
|
|
$mform->addElement('checkbox', 'tagging', get_string('mod_form_field_recordingtagging', 'bigbluebuttonbn')); |
|
125
|
|
|
$mform->setDefault('tagging', $recording_tagging_default); |
|
126
|
|
|
$mform->setAdvanced('tagging'); |
|
127
|
|
|
} else { |
|
128
|
|
|
$mform->addElement('hidden', 'tagging', $recording_tagging_default ); |
|
129
|
|
|
} |
|
130
|
|
|
$mform->setType('tagging', PARAM_INT); |
|
131
|
|
|
} |
|
132
|
|
|
|
|
133
|
|
|
if ( $sendnotifications_enabled ) { |
|
134
|
|
|
$mform->addElement('checkbox', 'notification', get_string('mod_form_field_notification', 'bigbluebuttonbn')); |
|
135
|
|
|
if ($this->current->instance) { |
|
136
|
|
|
$mform->addHelpButton('notification', 'mod_form_field_notification', 'bigbluebuttonbn'); |
|
137
|
|
|
} else { |
|
138
|
|
|
$mform->addHelpButton('notification', 'mod_form_field_notification', 'bigbluebuttonbn'); |
|
139
|
|
|
} |
|
140
|
|
|
$mform->setDefault('notification', 0); |
|
141
|
|
|
} |
|
142
|
|
|
$mform->setType('notification', PARAM_INT); |
|
143
|
|
|
//------------------------------------------------------------------------------- |
|
144
|
|
|
// First block ends here |
|
145
|
|
|
//------------------------------------------------------------------------------- |
|
146
|
|
|
|
|
147
|
|
|
|
|
148
|
|
|
//------------------------------------------------------------------------------- |
|
149
|
|
|
// Second block starts here |
|
150
|
|
|
//------------------------------------------------------------------------------- |
|
151
|
|
|
if ( $preuploadpresentation_enabled ) { |
|
152
|
|
|
$mform->addElement('header', 'preupload', get_string('mod_form_block_presentation', 'bigbluebuttonbn')); |
|
153
|
|
|
$mform->setExpanded('preupload'); |
|
154
|
|
|
|
|
155
|
|
|
$filemanager_options = array(); |
|
156
|
|
|
$filemanager_options['accepted_types'] = '*'; |
|
157
|
|
|
$filemanager_options['maxbytes'] = 0; //$this->course->maxbytes; |
|
|
|
|
|
|
158
|
|
|
$filemanager_options['subdirs'] = 0; |
|
159
|
|
|
$filemanager_options['maxfiles'] = 1; |
|
160
|
|
|
$filemanager_options['mainfile'] = true; |
|
161
|
|
|
|
|
162
|
|
|
$mform->addElement('filemanager', 'presentation', get_string('selectfiles'), null, $filemanager_options); |
|
163
|
|
|
//$mform->addHelpButton('presentation', 'mod_form_field_presentation', 'bigbluebuttonbn'); |
|
|
|
|
|
|
164
|
|
|
} |
|
165
|
|
|
//------------------------------------------------------------------------------- |
|
166
|
|
|
// Second block ends here |
|
167
|
|
|
//------------------------------------------------------------------------------- |
|
168
|
|
|
|
|
169
|
|
|
|
|
170
|
|
|
//------------------------------------------------------------------------------- |
|
171
|
|
|
// Third block starts here |
|
172
|
|
|
//------------------------------------------------------------------------------- |
|
173
|
|
|
$mform->addElement('header', 'permission', get_string('mod_form_block_participants', 'bigbluebuttonbn')); |
|
174
|
|
|
|
|
175
|
|
|
// Data required for "Add participant" and initial "Participant list" setup |
|
176
|
|
|
$roles = bigbluebuttonbn_get_roles(); |
|
177
|
|
|
$users = bigbluebuttonbn_get_users($context); |
|
178
|
|
|
|
|
179
|
|
|
$participant_list = bigbluebuttonbn_get_participant_list($bigbluebuttonbn, $context); |
|
|
|
|
|
|
180
|
|
|
$mform->addElement('hidden', 'participants', json_encode($participant_list)); |
|
181
|
|
|
$mform->setType('participants', PARAM_TEXT); |
|
182
|
|
|
|
|
183
|
|
|
$html_participant_selection = ''. |
|
184
|
|
|
'<div id="fitem_bigbluebuttonbn_participant_selection" class="fitem fitem_fselect">'."\n". |
|
185
|
|
|
' <div class="fitemtitle">'."\n". |
|
186
|
|
|
' <label for="bigbluebuttonbn_participant_selectiontype">'.get_string('mod_form_field_participant_add', 'bigbluebuttonbn').' </label>'."\n". |
|
187
|
|
|
' </div>'."\n". |
|
188
|
|
|
' <div class="felement fselect">'."\n". |
|
189
|
|
|
' <select id="bigbluebuttonbn_participant_selection_type" onchange="bigbluebuttonbn_participant_selection_set(); return 0;">'."\n". |
|
190
|
|
|
' <option value="all" selected="selected">'.get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn').'</option>'."\n". |
|
191
|
|
|
' <option value="role">'.get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn').'</option>'."\n". |
|
192
|
|
|
' <option value="user">'.get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn').'</option>'."\n". |
|
193
|
|
|
' </select>'."\n". |
|
194
|
|
|
' '."\n". |
|
195
|
|
|
' <select id="bigbluebuttonbn_participant_selection" disabled="disabled">'."\n". |
|
196
|
|
|
' <option value="all" selected="selected">---------------</option>'."\n". |
|
197
|
|
|
' </select>'."\n". |
|
198
|
|
|
' '."\n". |
|
199
|
|
|
' <input value="'.get_string('mod_form_field_participant_list_action_add', 'bigbluebuttonbn').'" type="button" id="id_addselectionid" onclick="bigbluebuttonbn_participant_add(); return 0;" />'."\n". |
|
200
|
|
|
' </div>'."\n". |
|
201
|
|
|
'</div>'."\n". |
|
202
|
|
|
'<div id="fitem_bigbluebuttonbn_participant_list" class="fitem">'."\n". |
|
203
|
|
|
' <div class="fitemtitle">'."\n". |
|
204
|
|
|
' <label for="bigbluebuttonbn_participant_list">'.get_string('mod_form_field_participant_list', 'bigbluebuttonbn').' </label>'."\n". |
|
205
|
|
|
' </div>'."\n". |
|
206
|
|
|
' <div class="felement fselect">'."\n". |
|
207
|
|
|
' <table id="participant_list_table">'."\n"; |
|
208
|
|
|
|
|
209
|
|
|
// Add participant list |
|
210
|
|
|
foreach($participant_list as $participant){ |
|
211
|
|
|
$participant_selectionid = ''; |
|
212
|
|
|
$participant_selectiontype = $participant['selectiontype']; |
|
213
|
|
|
if( $participant_selectiontype == 'all') { |
|
214
|
|
|
$participant_selectiontype = '<b><i>'.get_string('mod_form_field_participant_list_type_'.$participant_selectiontype, 'bigbluebuttonbn').'</i></b>'; |
|
215
|
|
|
} else { |
|
216
|
|
|
if ( $participant_selectiontype == 'role') { |
|
217
|
|
|
$participant_selectionid = bigbluebuttonbn_get_role_name($participant['selectionid']); |
|
218
|
|
|
} else { |
|
219
|
|
|
foreach($users as $user){ |
|
220
|
|
|
if( $user->id == $participant['selectionid']) { |
|
221
|
|
|
$participant_selectionid = $user->firstname.' '.$user->lastname; |
|
222
|
|
|
break; |
|
223
|
|
|
} |
|
224
|
|
|
} |
|
225
|
|
|
} |
|
226
|
|
|
$participant_selectiontype = '<b><i>'.get_string('mod_form_field_participant_list_type_'.$participant_selectiontype, 'bigbluebuttonbn').':</i></b> '; |
|
227
|
|
|
} |
|
228
|
|
|
$participant_role = get_string('mod_form_field_participant_bbb_role_'.$participant['role'], 'bigbluebuttonbn'); |
|
|
|
|
|
|
229
|
|
|
|
|
230
|
|
|
$html_participant_selection .= ''. |
|
231
|
|
|
' <tr id="participant_list_tr_'.$participant['selectiontype'].'-'.$participant['selectionid'].'">'."\n". |
|
232
|
|
|
' <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". |
|
233
|
|
|
' <td width="125px">'.$participant_selectiontype.'</td>'."\n". |
|
234
|
|
|
' <td>'.$participant_selectionid.'</td>'."\n". |
|
235
|
|
|
' <td><i> '.get_string('mod_form_field_participant_list_text_as', 'bigbluebuttonbn').' </i>'."\n". |
|
236
|
|
|
' <select id="participant_list_role_'.$participant['selectiontype'].'-'.$participant['selectionid'].'" onchange="bigbluebuttonbn_participant_list_role_update(\''.$participant['selectiontype'].'\', \''.$participant['selectionid'].'\'); return 0;">'."\n". |
|
237
|
|
|
' <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". |
|
238
|
|
|
' <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". |
|
239
|
|
|
' </td>'."\n". |
|
240
|
|
|
' </tr>'."\n"; |
|
241
|
|
|
} |
|
242
|
|
|
|
|
243
|
|
|
$html_participant_selection .= ''. |
|
244
|
|
|
' </table>'."\n". |
|
245
|
|
|
' </div>'."\n". |
|
246
|
|
|
'</div>'."\n". |
|
247
|
|
|
'<script type="text/javascript" src="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/mod_form.js">'."\n". |
|
248
|
|
|
'</script>'."\n"; |
|
249
|
|
|
|
|
250
|
|
|
$mform->addElement('html', $html_participant_selection); |
|
251
|
|
|
|
|
252
|
|
|
// Add data |
|
253
|
|
|
$mform->addElement('html', '<script type="text/javascript">var bigbluebuttonbn_participant_selection = {"all": [], "role": '.json_encode($roles).', "user": '.bigbluebuttonbn_get_users_json($users).'}; </script>'); |
|
254
|
|
|
$mform->addElement('html', '<script type="text/javascript">var bigbluebuttonbn_participant_list = '.json_encode($participant_list).'; </script>'); |
|
255
|
|
|
$bigbluebuttonbn_strings = Array( "as" => get_string('mod_form_field_participant_list_text_as', 'bigbluebuttonbn'), |
|
256
|
|
|
"viewer" => get_string('mod_form_field_participant_bbb_role_viewer', 'bigbluebuttonbn'), |
|
257
|
|
|
"moderator" => get_string('mod_form_field_participant_bbb_role_moderator', 'bigbluebuttonbn'), |
|
258
|
|
|
"remove" => get_string('mod_form_field_participant_list_action_remove', 'bigbluebuttonbn'), |
|
259
|
|
|
); |
|
260
|
|
|
$mform->addElement('html', '<script type="text/javascript">var bigbluebuttonbn_strings = '.json_encode($bigbluebuttonbn_strings).'; </script>'); |
|
261
|
|
|
//------------------------------------------------------------------------------- |
|
262
|
|
|
// Third block ends here |
|
263
|
|
|
//------------------------------------------------------------------------------- |
|
264
|
|
|
|
|
265
|
|
|
|
|
266
|
|
|
//------------------------------------------------------------------------------- |
|
267
|
|
|
// Fourth block starts here |
|
268
|
|
|
//------------------------------------------------------------------------------- |
|
269
|
|
|
$mform->addElement('header', 'schedule', get_string('mod_form_block_schedule', 'bigbluebuttonbn')); |
|
270
|
|
|
if( isset($current_activity->openingtime) && $current_activity->openingtime != 0 || isset($current_activity->closingtime) && $current_activity->closingtime != 0 ) |
|
271
|
|
|
$mform->setExpanded('schedule'); |
|
272
|
|
|
|
|
273
|
|
|
$mform->addElement('date_time_selector', 'openingtime', get_string('mod_form_field_openingtime', 'bigbluebuttonbn'), array('optional' => true)); |
|
274
|
|
|
$mform->setDefault('openingtime', 0); |
|
275
|
|
|
$mform->addElement('date_time_selector', 'closingtime', get_string('mod_form_field_closingtime', 'bigbluebuttonbn'), array('optional' => true)); |
|
276
|
|
|
$mform->setDefault('closingtime', 0); |
|
277
|
|
|
//------------------------------------------------------------------------------- |
|
278
|
|
|
// Fourth block ends here |
|
279
|
|
|
//------------------------------------------------------------------------------- |
|
280
|
|
|
|
|
281
|
|
|
|
|
282
|
|
|
//------------------------------------------------------------------------------- |
|
283
|
|
|
// add standard elements, common to all modules |
|
284
|
|
|
$this->standard_coursemodule_elements(); |
|
285
|
|
|
|
|
286
|
|
|
//------------------------------------------------------------------------------- |
|
287
|
|
|
// add standard buttons, common to all modules |
|
288
|
|
|
$this->add_action_buttons(); |
|
289
|
|
|
} |
|
290
|
|
|
|
|
291
|
|
|
function data_preprocessing(&$default_values) { |
|
|
|
|
|
|
292
|
|
|
if ($this->current->instance) { |
|
293
|
|
|
// Editing existing instance - copy existing files into draft area. |
|
294
|
|
|
try { |
|
295
|
|
|
$draftitemid = file_get_submitted_draft_itemid('presentation'); |
|
296
|
|
|
file_prepare_draft_area($draftitemid, $this->context->id, 'mod_bigbluebuttonbn', 'presentation', 0, array('subdirs'=>0, 'maxbytes' => 0, 'maxfiles' => 1, 'mainfile' => true)); |
|
297
|
|
|
$default_values['presentation'] = $draftitemid; |
|
298
|
|
|
} catch (Exception $e){ |
|
299
|
|
|
error_log("Presentation could not be loaded: ".$e->getMessage()); |
|
300
|
|
|
return NULL; |
|
301
|
|
|
} |
|
302
|
|
|
} |
|
303
|
|
|
} |
|
304
|
|
|
|
|
305
|
|
|
function validation($data, $files) { |
|
|
|
|
|
|
306
|
|
|
$errors = parent::validation($data, $files); |
|
307
|
|
|
|
|
308
|
|
|
if ( isset($data['openingtime']) && isset($data['closingtime']) ) { |
|
309
|
|
|
if ( $data['openingtime'] != 0 && $data['closingtime'] != 0 && $data['closingtime'] < $data['openingtime']) { |
|
310
|
|
|
$errors['closingtime'] = get_string('bbbduetimeoverstartingtime', 'bigbluebuttonbn'); |
|
311
|
|
|
} |
|
312
|
|
|
} |
|
313
|
|
|
|
|
314
|
|
|
if ( isset($data['voicebridge']) ) { |
|
315
|
|
|
if ( !bigbluebuttonbn_voicebridge_unique($data['voicebridge'], $data['instance'])) { |
|
316
|
|
|
$errors['voicebridge'] = get_string('mod_form_field_voicebridge_notunique_error', 'bigbluebuttonbn'); |
|
317
|
|
|
} |
|
318
|
|
|
} |
|
319
|
|
|
|
|
320
|
|
|
return $errors; |
|
321
|
|
|
} |
|
322
|
|
|
} |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.