MDL-16221
[moodle-linuxchix.git] / mod / chat / mod_form.php
blob54fb53ac66bcca1d97b3c859e033b07b95e13672
1 <?php
2 require_once ($CFG->dirroot.'/course/moodleform_mod.php');
4 class mod_chat_mod_form extends moodleform_mod {
6 function definition() {
8 global $CFG;
9 $mform =& $this->_form;
11 //-------------------------------------------------------------------------------
12 $mform->addElement('header', 'general', get_string('general', 'form'));
14 $mform->addElement('text', 'name', get_string('chatname', 'chat'), array('size'=>'64'));
15 if (!empty($CFG->formatstringstriptags)) {
16 $mform->setType('name', PARAM_TEXT);
17 } else {
18 $mform->setType('name', PARAM_CLEAN);
20 $mform->addRule('name', null, 'required', null, 'client');
22 $mform->addElement('htmleditor', 'intro', get_string('chatintro', 'chat'));
23 $mform->setType('intro', PARAM_RAW);
24 $mform->setHelpButton('intro', array('writing', 'questions', 'richtext'), false, 'editorhelpbutton');
25 $mform->addRule('intro', get_string('required'), 'required', null, 'client');
27 $mform->addElement('date_time_selector', 'chattime', get_string('chattime', 'chat'));
29 $options=array();
30 $options[0] = get_string('donotusechattime', 'chat');
31 $options[1] = get_string('repeatnone', 'chat');
32 $options[2] = get_string('repeatdaily', 'chat');
33 $options[3] = get_string('repeatweekly', 'chat');
34 $mform->addElement('select', 'schedule', get_string('repeattimes', 'chat'), $options);
37 $options=array();
38 $options[0] = get_string('neverdeletemessages', 'chat');
39 $options[365] = get_string('numdays', '', 365);
40 $options[180] = get_string('numdays', '', 180);
41 $options[150] = get_string('numdays', '', 150);
42 $options[120] = get_string('numdays', '', 120);
43 $options[90] = get_string('numdays', '', 90);
44 $options[60] = get_string('numdays', '', 60);
45 $options[30] = get_string('numdays', '', 30);
46 $options[21] = get_string('numdays', '', 21);
47 $options[14] = get_string('numdays', '', 14);
48 $options[7] = get_string('numdays', '', 7);
49 $options[2] = get_string('numdays', '', 2);
50 $mform->addElement('select', 'keepdays', get_string('savemessages', 'chat'), $options);
52 $mform->addElement('selectyesno', 'studentlogs', get_string('studentseereports', 'chat'));
54 $features = new stdClass;
55 $features->groups = true;
56 $features->groupings = true;
57 $features->groupmembersonly = true;
58 $this->standard_coursemodule_elements($features);
60 $this->add_action_buttons();