mod_form.php 1.92 KB
Newer Older
1
<?php
Petr Skoda's avatar
Petr Skoda committed
2
3
4
5
6

defined('MOODLE_INTERNAL') || die;

require_once($CFG->dirroot.'/mod/book/locallib.php');
require_once($CFG->dirroot.'/course/moodleform_mod.php');
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

class mod_book_mod_form extends moodleform_mod {

    function definition() {

        global $CFG;
        $mform =& $this->_form;

//-------------------------------------------------------------------------------
        $mform->addElement('header', 'general', get_string('general', 'form'));

        $mform->addElement('text', 'name', get_string('name'), array('size'=>'64'));
        $mform->setType('name', PARAM_TEXT);
        $mform->addRule('name', null, 'required', null, 'client');

        $mform->addElement('htmleditor', 'summary', get_string('summary'));
        $mform->setType('summary', PARAM_RAW);
        $mform->addRule('summary', null, 'required', null, 'client');
        $mform->setHelpButton('summary', array('writing', 'questions', 'richtext'), false, 'editorhelpbutton');

        $mform->addElement('select', 'numbering', get_string('numbering', 'book'), book_get_numbering_types());
        $mform->setHelpButton('numbering', array('numberingtype', get_string('numbering', 'book'), 'book'));

        $mform->addElement('checkbox', 'disableprinting', get_string('disableprinting', 'book'));
        $mform->setHelpButton('disableprinting', array('disableprinting', get_string('disableprinting', 'book'), 'book'));
        $mform->setDefault('disableprinting', 0);

        $mform->addElement('checkbox', 'customtitles', get_string('customtitles', 'book'));
        $mform->setHelpButton('customtitles', array('customtitles', get_string('customtitles', 'book'), 'book'));
        $mform->setDefault('customtitles', 0);

38
        $this->standard_coursemodule_elements(array('groups'=>false, 'groupmembersonly'=>true, 'gradecat'=>false));
39
40
41
42
43
44
45
46

//-------------------------------------------------------------------------------
        // buttons
        $this->add_action_buttons();
    }


}