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');
17 $mform->addElement('select', 'publishstate', $strpublishstate, note_get_state_names());
18 $mform->setDefault('publishstate', NOTES_STATE_PUBLIC
);
19 $mform->setType('publishstate', PARAM_ALPHA
);
20 $mform->setHelpButton('publishstate', array('status', $strpublishstate, 'notes'));
22 $this->add_action_buttons();
24 $mform->addElement('hidden', 'course');
25 $mform->setType('course', PARAM_INT
);
27 $mform->addElement('hidden', 'user');
28 $mform->setType('user', PARAM_INT
);
30 $mform->addElement('hidden', 'note');
31 $mform->setType('note', PARAM_INT
);