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 editsection_form
extends moodleform
{
11 function definition() {
14 $mform = $this->_form
;
15 $course = $this->_customdata
['course'];
17 $mform->addElement('checkbox', 'usedefaultname', get_string('sectionusedefaultname'));
18 $mform->setDefault('usedefaultname', true);
20 $mform->addElement('text', 'name', get_string('sectionname'), array('size'=>'30'));
21 $mform->setType('name', PARAM_TEXT
);
22 $mform->disabledIf('name','usedefaultname','checked');
24 /// Prepare course and the editor
26 $mform->addElement('editor', 'summary_editor', get_string('summary'), null, $this->_customdata
['editoroptions']);
27 $mform->addHelpButton('summary_editor', 'summary');
28 $mform->setType('summary_editor', PARAM_RAW
);
30 $mform->addElement('hidden', 'id');
31 $mform->setType('id', PARAM_INT
);
33 //--------------------------------------------------------------------------------
34 $this->add_action_buttons();