|
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 editsection_form extends moodleform { 00010 00011 function definition() { 00012 global $CFG, $DB; 00013 00014 $mform = $this->_form; 00015 $course = $this->_customdata['course']; 00016 00017 $mform->addElement('checkbox', 'usedefaultname', get_string('sectionusedefaultname')); 00018 $mform->setDefault('usedefaultname', true); 00019 00020 $mform->addElement('text', 'name', get_string('sectionname'), array('size'=>'30')); 00021 $mform->setType('name', PARAM_TEXT); 00022 $mform->disabledIf('name','usedefaultname','checked'); 00023 00025 00026 $mform->addElement('editor', 'summary_editor', get_string('summary'), null, $this->_customdata['editoroptions']); 00027 $mform->addHelpButton('summary_editor', 'summary'); 00028 $mform->setType('summary_editor', PARAM_RAW); 00029 00030 $mform->addElement('hidden', 'id'); 00031 $mform->setType('id', PARAM_INT); 00032 00033 //-------------------------------------------------------------------------------- 00034 $this->add_action_buttons(); 00035 00036 } 00037 }