book should be now compatible with 1.8
[moodle.git] / mod_form.php
CommitLineData
dab784a3
PS
1<?php
2require_once($CFG->dirroot.'/mod/book/lib.php');
3require_once('moodleform_mod.php');
4
5class mod_book_mod_form extends moodleform_mod {
6
7 function definition() {
8
9 global $CFG;
10 $mform =& $this->_form;
11
12//-------------------------------------------------------------------------------
13 $mform->addElement('header', 'general', get_string('general', 'form'));
14
15 $mform->addElement('text', 'name', get_string('name'), array('size'=>'64'));
16 $mform->setType('name', PARAM_TEXT);
17 $mform->addRule('name', null, 'required', null, 'client');
18
19 $mform->addElement('htmleditor', 'summary', get_string('summary'));
20 $mform->setType('summary', PARAM_RAW);
21 $mform->addRule('summary', null, 'required', null, 'client');
22 $mform->setHelpButton('summary', array('writing', 'questions', 'richtext'), false, 'editorhelpbutton');
23
24 $mform->addElement('select', 'numbering', get_string('numbering', 'book'), book_get_numbering_types());
25 $mform->setHelpButton('numbering', array('numberingtype', get_string('numbering', 'book'), 'book'));
26
27 $mform->addElement('checkbox', 'disableprinting', get_string('disableprinting', 'book'));
28 $mform->setHelpButton('disableprinting', array('disableprinting', get_string('disableprinting', 'book'), 'book'));
29 $mform->setDefault('disableprinting', 0);
30
31 $mform->addElement('checkbox', 'customtitles', get_string('customtitles', 'book'));
32 $mform->setHelpButton('customtitles', array('customtitles', get_string('customtitles', 'book'), 'book'));
33 $mform->setDefault('customtitles', 0);
34
35 $this->standard_coursemodule_elements();
36
37//-------------------------------------------------------------------------------
38 // buttons
39 $this->add_action_buttons();
40 }
41
42
43}
44?>