Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/mod/chat/mod_form.php
Go to the documentation of this file.
00001 <?php
00002 if (!defined('MOODLE_INTERNAL')) {
00003     die('Direct access to this script is forbidden.');    
00004 }
00005 
00006 require_once ($CFG->dirroot.'/course/moodleform_mod.php');
00007 
00008 class mod_chat_mod_form extends moodleform_mod {
00009 
00010     function definition() {
00011         global $CFG;
00012 
00013         $mform = $this->_form;
00014 
00015 //-------------------------------------------------------------------------------
00016         $mform->addElement('header', 'general', get_string('general', 'form'));
00017 
00018         $mform->addElement('text', 'name', get_string('chatname', 'chat'), array('size'=>'64'));
00019         if (!empty($CFG->formatstringstriptags)) {
00020             $mform->setType('name', PARAM_TEXT);
00021         } else {
00022             $mform->setType('name', PARAM_CLEANHTML);
00023         }
00024         $mform->addRule('name', null, 'required', null, 'client');
00025 
00026         $this->add_intro_editor(true, get_string('chatintro', 'chat'));
00027 
00028         $mform->addElement('date_time_selector', 'chattime', get_string('chattime', 'chat'));
00029 
00030         $options=array();
00031         $options[0]  = get_string('donotusechattime', 'chat');
00032         $options[1]  = get_string('repeatnone', 'chat');
00033         $options[2]  = get_string('repeatdaily', 'chat');
00034         $options[3]  = get_string('repeatweekly', 'chat');
00035         $mform->addElement('select', 'schedule', get_string('repeattimes', 'chat'), $options);
00036 
00037 
00038         $options=array();
00039         $options[0]    = get_string('neverdeletemessages', 'chat');
00040         $options[365]  = get_string('numdays', '', 365);
00041         $options[180]  = get_string('numdays', '', 180);
00042         $options[150]  = get_string('numdays', '', 150);
00043         $options[120]  = get_string('numdays', '', 120);
00044         $options[90]   = get_string('numdays', '', 90);
00045         $options[60]   = get_string('numdays', '', 60);
00046         $options[30]   = get_string('numdays', '', 30);
00047         $options[21]   = get_string('numdays', '', 21);
00048         $options[14]   = get_string('numdays', '', 14);
00049         $options[7]    = get_string('numdays', '', 7);
00050         $options[2]    = get_string('numdays', '', 2);
00051         $mform->addElement('select', 'keepdays', get_string('savemessages', 'chat'), $options);
00052 
00053         $mform->addElement('selectyesno', 'studentlogs', get_string('studentseereports', 'chat'));
00054         $mform->addHelpButton('studentlogs', 'studentseereports', 'chat');
00055 
00056         $this->standard_coursemodule_elements();
00057 
00058         $this->add_action_buttons();
00059     }
00060 }
 All Data Structures Namespaces Files Functions Variables Enumerations