|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00003 if (!defined('MOODLE_INTERNAL')) { 00004 die('Direct access to this script is forbidden.'); 00005 } 00006 00007 require_once($CFG->libdir.'/formslib.php'); 00008 00009 class note_edit_form extends moodleform { 00010 00011 function definition() { 00012 $mform =& $this->_form; 00013 $mform->addElement('header', 'general', get_string('note', 'notes')); 00014 00015 $mform->addElement('textarea', 'content', get_string('content', 'notes'), array('rows'=>15, 'cols'=>40)); 00016 $mform->setType('content', PARAM_RAW); 00017 $mform->addRule('content', get_string('nocontent', 'notes'), 'required', null, 'client'); 00018 00019 $mform->addElement('select', 'publishstate', get_string('publishstate', 'notes'), note_get_state_names()); 00020 $mform->setDefault('publishstate', NOTES_STATE_PUBLIC); 00021 $mform->setType('publishstate', PARAM_ALPHA); 00022 $mform->addHelpButton('publishstate', 'publishstate', 'notes'); 00023 00024 $this->add_action_buttons(); 00025 00026 $mform->addElement('hidden', 'courseid'); 00027 $mform->setType('course', PARAM_INT); 00028 00029 $mform->addElement('hidden', 'userid'); 00030 $mform->setType('user', PARAM_INT); 00031 00032 $mform->addElement('hidden', 'id'); 00033 $mform->setType('id', PARAM_INT); 00034 } 00035 }