file data.php was added on branch MOODLE_19_STABLE on 2010-05-21 11:39:52 +0000
[moodle.git] / notes / edit_form.php
blob511678921df2feb2771e75d8afb5e6dda676c33b
1 <?php // $Id$
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 $strcontent = get_string('content', 'notes');
14 $strpublishstate = get_string('publishstate', 'notes');
15 $mform->addElement('header', 'general', get_string('note', 'notes'));
17 $mform->addElement('textarea', 'content', $strcontent, array('rows'=>15, 'cols'=>40));
18 $mform->setType('content', PARAM_RAW);
19 $mform->addRule('content', get_string('nocontent', 'notes'), 'required', null, 'client');
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', 'courseid');
29 $mform->setType('course', PARAM_INT);
31 $mform->addElement('hidden', 'userid');
32 $mform->setType('user', PARAM_INT);
34 $mform->addElement('hidden', 'id');
35 $mform->setType('id', PARAM_INT);