3 require_once($CFG->libdir
.'/formslib.php');
5 class note_edit_form
extends moodleform
{
7 function definition() {
8 $mform =& $this->_form
;
10 $mform->addElement('header', 'general', get_string('general', 'form'));
12 $mform->addElement('select', 'user', get_string('user'), $this->_customdata
['userlist']);
13 $mform->addRule('user', get_string('nouser', 'notes'), 'required', null, 'client');
15 $mform->addElement('textarea', 'content', get_string('content', 'notes'), array('rows'=>15, 'cols'=>40));
16 $mform->setType('content', PARAM_RAW
);
17 $mform->addRule('content', get_string('nocontent', 'notes'), 'required', null, 'client');
18 $mform->setHelpButton('content', array('writing', 'richtext'), false, 'editorhelpbutton');
20 $mform->addElement('select', 'rating', get_string('rating', 'notes'), note_get_rating_names());
21 $mform->setDefault('rating', 3);
23 $mform->addElement('select', 'publishstate', get_string('publishstate', 'notes'), note_get_state_names());
24 $mform->setDefault('publishstate', NOTES_STATE_PUBLIC
);
25 $mform->setType('publishstate', PARAM_ALPHA
);
27 $this->add_action_buttons();
29 $mform->addElement('hidden', 'course');
30 $mform->setType('course', PARAM_INT
);
32 $mform->addElement('hidden', 'note');
33 $mform->setType('note', PARAM_INT
);