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('textarea', 'content', $strcontent, array('rows'=>15, 'cols'=>40));
14 $mform->setType('content', PARAM_RAW
);
15 $mform->addRule('content', get_string('nocontent', 'notes'), 'required', null, 'client');
16 $mform->setHelpButton('content', 'writing');
18 $mform->addElement('select', 'publishstate', $strpublishstate, note_get_state_names());
19 $mform->setDefault('publishstate', NOTES_STATE_PUBLIC
);
20 $mform->setType('publishstate', PARAM_ALPHA
);
21 $mform->setHelpButton('publishstate', array('status', $strpublishstate, 'notes'));
23 $this->add_action_buttons();
25 $mform->addElement('hidden', 'course');
26 $mform->setType('course', PARAM_INT
);
28 $mform->addElement('hidden', 'user');
29 $mform->setType('user', PARAM_INT
);
31 $mform->addElement('hidden', 'note');
32 $mform->setType('note', PARAM_INT
);