Merge branch 'MDL-40604-master' of git://github.com/danpoltawski/moodle
[moodle.git] / notes / edit_form.php
blobe66c4346cc27e32472826c49e142eaf17de11934
1 <?php
3 if (!defined('MOODLE_INTERNAL')) {
4 die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
7 require_once($CFG->libdir.'/formslib.php');
9 class note_edit_form extends moodleform {
11 function definition() {
12 $mform =& $this->_form;
13 $mform->addElement('header', 'general', get_string('note', 'notes'));
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');
19 $mform->addElement('select', 'publishstate', get_string('publishstate', 'notes'), note_get_state_names());
20 $mform->setDefault('publishstate', NOTES_STATE_PUBLIC);
21 $mform->setType('publishstate', PARAM_ALPHA);
22 $mform->addHelpButton('publishstate', 'publishstate', 'notes');
24 $this->add_action_buttons();
26 $mform->addElement('hidden', 'courseid');
27 $mform->setType('courseid', PARAM_INT);
29 $mform->addElement('hidden', 'userid');
30 $mform->setType('userid', PARAM_INT);
32 $mform->addElement('hidden', 'id');
33 $mform->setType('id', PARAM_INT);