-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsignup_form.php
45 lines (34 loc) · 1.42 KB
/
signup_form.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
require_once "$CFG->dirroot/lib/formslib.php";
class mod_webinar_signup_form extends moodleform {
function definition()
{
global $CFG;
$mform =& $this->_form;
$manageremail = $this->_customdata['manageremail'];
$mform->addElement('hidden', 's', $this->_customdata['s']);
$mform->addElement('hidden', 'backtoallsessions', $this->_customdata['backtoallsessions']);
if ($manageremail === false) {
$mform->addElement('hidden', 'manageremail', '');
}
else {
$mform->addElement('html', get_string('manageremailinstructionconfirm', 'webinar')); // instructions
$mform->addElement('text', 'manageremail', get_string('manageremail', 'webinar'), 'size="35"');
$mform->addRule('manageremail', null, 'required', null, 'client');
$mform->addRule('manageremail', null, 'email', null, 'client');
$mform->setType('manageremail', PARAM_TEXT);
}
$this->add_action_buttons(true, get_string('signup', 'webinar'));
}
function validation($data, $files)
{
$errors = parent::validation($data, $files);
$manageremail = $data['manageremail'];
if (!empty($manageremail)) {
if (!webinar_check_manageremail($manageremail)) {
$errors['manageremail'] = webinar_get_manageremailformat();
}
}
return $errors;
}
}