fix recent typo
[moodle.git] / mod_form.php
CommitLineData
dab784a3 1<?php
2c1e98e6
PS
2// This file is part of Book module for Moodle - http://moodle.org/
3//
4// Moodle is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// Moodle is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
16
17/**
18 * Instance add/edit form
19 *
20 * @package mod
21 * @subpackage book
22 * @copyright 2004-2010 Petr Skoda {@link http://skodak.org}
23 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
24 */
e355240d
PS
25
26defined('MOODLE_INTERNAL') || die;
27
28require_once($CFG->dirroot.'/mod/book/locallib.php');
29require_once($CFG->dirroot.'/course/moodleform_mod.php');
dab784a3
PS
30
31class mod_book_mod_form extends moodleform_mod {
32
33 function definition() {
dab784a3 34 global $CFG;
2c1e98e6
PS
35
36 $mform = $this->_form;
dab784a3
PS
37
38//-------------------------------------------------------------------------------
39 $mform->addElement('header', 'general', get_string('general', 'form'));
40
41 $mform->addElement('text', 'name', get_string('name'), array('size'=>'64'));
2c1e98e6
PS
42 if (!empty($CFG->formatstringstriptags)) {
43 $mform->setType('name', PARAM_TEXT);
44 } else {
45 $mform->setType('name', PARAM_CLEANHTML);
46 }
dab784a3
PS
47 $mform->addRule('name', null, 'required', null, 'client');
48
2c1e98e6
PS
49 $this->add_intro_editor(true, get_string('summary'));
50
dab784a3
PS
51
52 $mform->addElement('select', 'numbering', get_string('numbering', 'book'), book_get_numbering_types());
0834c016 53 $mform->addHelpButton('numbering', 'numbering', 'mod_book');
dab784a3 54
dab784a3 55 $mform->addElement('checkbox', 'customtitles', get_string('customtitles', 'book'));
0834c016 56 $mform->addHelpButton('customtitles', 'customtitles', 'mod_book');
dab784a3
PS
57 $mform->setDefault('customtitles', 0);
58
2c1e98e6
PS
59//-------------------------------------------------------------------------------
60 $this->standard_coursemodule_elements();
dab784a3
PS
61
62//-------------------------------------------------------------------------------
dab784a3
PS
63 $this->add_action_buttons();
64 }
65
66
67}