Typo: should be $COURSE not $course it seems
[moodle-linuxchix.git] / admin / user_message_form.php
blob806b1593e3ea73f767e4d4d034fc5bc3c31742e3
1 <?php //$Id$
3 require_once($CFG->libdir.'/formslib.php');
5 class user_message_form extends moodleform {
7 function definition() {
8 $mform =& $this->_form;
9 $mform->addElement('header', 'general', get_string('message', 'message'));
11 $mform->addElement('textarea', 'messagebody', get_string('messagebody'), array('rows'=>15, 'cols'=>30));
12 $mform->setType('messagebody', PARAM_CLEANHTML);
13 $mform->addRule('messagebody', '', 'required', null, 'client');
14 $mform->setHelpButton('messagebody', array('writing', 'reading', 'questions', 'richtext'), false, 'editorhelpbutton');
16 $mform->addElement('format', 'format', get_string('format'));
18 $objs = array();
19 foreach($this->_customdata['userlist'] as $k=>$u) {
20 $user = get_record('user', 'id', $u);
21 $objs[] =& $mform->createElement('static', null, null, '<input type="checkbox" name="userid['. $k .']" checked="checked" value="'.$u . '" />'. fullname($user));
23 $mform->addElement('group', 'users', 'Users', $objs, '<br />', false);
25 $objs = array();
26 $objs[] = &$mform->createElement('submit', 'send', 'Send');
27 $objs[] = &$mform->createElement('submit', 'preview', 'Preview');
28 $objs[] = &$mform->createElement('cancel');
29 $mform->addElement('group', 'buttonar', '', $objs, ' ', false);
30 $mform->closeHeaderBefore('buttonar');