2009-11-04 08:11:02 +00:00
|
|
|
<?php
|
2009-02-17 16:18:05 +00:00
|
|
|
|
2010-05-13 02:02:05 +00:00
|
|
|
if (!defined('MOODLE_INTERNAL')) {
|
|
|
|
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
|
|
|
|
}
|
|
|
|
|
2009-02-17 16:18:05 +00:00
|
|
|
require_once($CFG->libdir.'/formslib.php');
|
|
|
|
|
|
|
|
class editsection_form extends moodleform {
|
|
|
|
|
|
|
|
function definition() {
|
|
|
|
global $CFG, $DB;
|
|
|
|
|
|
|
|
$mform = $this->_form;
|
2010-05-27 03:07:54 +00:00
|
|
|
$course = $this->_customdata['course'];
|
2009-02-17 16:18:05 +00:00
|
|
|
|
2010-04-23 07:17:21 +00:00
|
|
|
$mform->addElement('checkbox', 'usedefaultname', get_string('sectionusedefaultname'));
|
|
|
|
$mform->setDefault('usedefaultname', true);
|
|
|
|
|
|
|
|
$mform->addElement('text', 'name', get_string('sectionname'), array('size'=>'30'));
|
|
|
|
$mform->setType('name', PARAM_TEXT);
|
|
|
|
$mform->disabledIf('name','usedefaultname','checked');
|
|
|
|
|
2010-05-27 03:07:54 +00:00
|
|
|
/// Prepare course and the editor
|
2010-06-10 18:25:06 +00:00
|
|
|
|
|
|
|
$mform->addElement('editor', 'summary_editor', get_string('summary'), null, $this->_customdata['editoroptions']);
|
2010-06-28 17:05:05 +00:00
|
|
|
$mform->addHelpButton('summary_editor', 'summary');
|
2010-06-10 18:25:06 +00:00
|
|
|
$mform->setType('summary_editor', PARAM_RAW);
|
2009-02-17 16:18:05 +00:00
|
|
|
|
|
|
|
$mform->addElement('hidden', 'id');
|
|
|
|
$mform->setType('id', PARAM_INT);
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------
|
|
|
|
$this->add_action_buttons();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|