MDL-26523 grade: fixed a called to addHelpButton() that was asking for a non-existent...
[moodle.git] / mod / chat / mod_form.php
blob860253932079352e14cf0155524676d1172afd65
1 <?php
2 if (!defined('MOODLE_INTERNAL')) {
3 die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
6 require_once ($CFG->dirroot.'/course/moodleform_mod.php');
8 class mod_chat_mod_form extends moodleform_mod {
10 function definition() {
11 global $CFG;
13 $mform = $this->_form;
15 //-------------------------------------------------------------------------------
16 $mform->addElement('header', 'general', get_string('general', 'form'));
18 $mform->addElement('text', 'name', get_string('chatname', 'chat'), array('size'=>'64'));
19 if (!empty($CFG->formatstringstriptags)) {
20 $mform->setType('name', PARAM_TEXT);
21 } else {
22 $mform->setType('name', PARAM_CLEANHTML);
24 $mform->addRule('name', null, 'required', null, 'client');
26 $this->add_intro_editor(true, get_string('chatintro', 'chat'));
28 $mform->addElement('date_time_selector', 'chattime', get_string('chattime', 'chat'));
30 $options=array();
31 $options[0] = get_string('donotusechattime', 'chat');
32 $options[1] = get_string('repeatnone', 'chat');
33 $options[2] = get_string('repeatdaily', 'chat');
34 $options[3] = get_string('repeatweekly', 'chat');
35 $mform->addElement('select', 'schedule', get_string('repeattimes', 'chat'), $options);
38 $options=array();
39 $options[0] = get_string('neverdeletemessages', 'chat');
40 $options[365] = get_string('numdays', '', 365);
41 $options[180] = get_string('numdays', '', 180);
42 $options[150] = get_string('numdays', '', 150);
43 $options[120] = get_string('numdays', '', 120);
44 $options[90] = get_string('numdays', '', 90);
45 $options[60] = get_string('numdays', '', 60);
46 $options[30] = get_string('numdays', '', 30);
47 $options[21] = get_string('numdays', '', 21);
48 $options[14] = get_string('numdays', '', 14);
49 $options[7] = get_string('numdays', '', 7);
50 $options[2] = get_string('numdays', '', 2);
51 $mform->addElement('select', 'keepdays', get_string('savemessages', 'chat'), $options);
53 $mform->addElement('selectyesno', 'studentlogs', get_string('studentseereports', 'chat'));
54 $mform->addHelpButton('studentlogs', 'studentseereports', 'chat');
56 $this->standard_coursemodule_elements();
58 $this->add_action_buttons();