3 require_once($CFG->libdir
.'/formslib.php');
5 class note_edit_form
extends moodleform
{
7 function definition() {
8 $mform =& $this->_form
;
9 $strcontent = get_string('content', 'notes');
10 $strpublishstate = get_string('publishstate', 'notes');
11 $mform->addElement('header', 'general', get_string('note', 'notes'));
13 $mform->addElement('select', 'user', get_string('user'), $this->_customdata
['userlist']);
14 $mform->addRule('user', get_string('nouser', 'notes'), 'required', null, 'client');
16 $mform->addElement('textarea', 'content', $strcontent, array('rows'=>15, 'cols'=>40));
17 $mform->setType('content', PARAM_RAW
);
18 $mform->addRule('content', get_string('nocontent', 'notes'), 'required', null, 'client');
19 $mform->setHelpButton('content', 'writing');
21 $mform->addElement('select', 'publishstate', $strpublishstate, note_get_state_names());
22 $mform->setDefault('publishstate', NOTES_STATE_PUBLIC
);
23 $mform->setType('publishstate', PARAM_ALPHA
);
24 $mform->setHelpButton('publishstate', array('status', $strpublishstate, 'notes'));
26 $this->add_action_buttons();
28 $mform->addElement('hidden', 'course');
29 $mform->setType('course', PARAM_INT
);
31 $mform->addElement('hidden', 'note');
32 $mform->setType('note', PARAM_INT
);