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