[ Index ]

PHP Cross Reference of Moodle 1.9.3 [Build 15-Oct-2008]

title

Body

[close]

/mod/chat/ -> mod_form.php (source)

   1  <?php
   2  require_once ($CFG->dirroot.'/course/moodleform_mod.php');
   3  
   4  class mod_chat_mod_form extends moodleform_mod {
   5  
   6      function definition() {
   7  
   8          global $CFG;
   9          $mform    =& $this->_form;
  10  
  11  //-------------------------------------------------------------------------------
  12          $mform->addElement('header', 'general', get_string('general', 'form'));
  13  
  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);
  19          }
  20          $mform->addRule('name', null, 'required', null, 'client');
  21  
  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');
  26  
  27          $mform->addElement('date_time_selector', 'chattime', get_string('chattime', 'chat'));
  28  
  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);
  35  
  36  
  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);
  51  
  52          $mform->addElement('selectyesno', 'studentlogs', get_string('studentseereports', 'chat'));
  53  
  54          $features = new stdClass;
  55          $features->groups = true;
  56          $features->groupings = true;
  57          $features->groupmembersonly = true;
  58          $this->standard_coursemodule_elements($features);
  59  
  60          $this->add_action_buttons();
  61      }
  62  
  63  
  64  
  65  }
  66  ?>


Generated: Wed Jan 14 11:33:29 2009 Cross-referenced by PHPXref 0.7