Commit 97619edd authored by Petr Skoda's avatar Petr Skoda
Browse files

add numbering default setting

parent c5832d6b
...@@ -67,6 +67,7 @@ class mod_book_mod_form extends moodleform_mod { ...@@ -67,6 +67,7 @@ class mod_book_mod_form extends moodleform_mod {
} }
$mform->addElement('select', 'numbering', get_string('numbering', 'book'), $options); $mform->addElement('select', 'numbering', get_string('numbering', 'book'), $options);
$mform->addHelpButton('numbering', 'numbering', 'mod_book'); $mform->addHelpButton('numbering', 'numbering', 'mod_book');
$mform->setDefault('numbering', $config->numbering);
$mform->addElement('checkbox', 'customtitles', get_string('customtitles', 'book')); $mform->addElement('checkbox', 'customtitles', get_string('customtitles', 'book'));
$mform->addHelpButton('customtitles', 'customtitles', 'mod_book'); $mform->addHelpButton('customtitles', 'customtitles', 'mod_book');
......
...@@ -28,6 +28,8 @@ defined('MOODLE_INTERNAL') || die; ...@@ -28,6 +28,8 @@ defined('MOODLE_INTERNAL') || die;
if ($ADMIN->fulltree) { if ($ADMIN->fulltree) {
require_once("$CFG->dirroot/mod/book/lib.php"); require_once("$CFG->dirroot/mod/book/lib.php");
//--- general settings -----------------------------------------------------------------------------------
$settings->add(new admin_setting_configcheckbox('book/requiremodintro', $settings->add(new admin_setting_configcheckbox('book/requiremodintro',
get_string('requiremodintro', 'admin'), get_string('configrequiremodintro', 'admin'), 1)); get_string('requiremodintro', 'admin'), get_string('configrequiremodintro', 'admin'), 1));
...@@ -37,4 +39,11 @@ if ($ADMIN->fulltree) { ...@@ -37,4 +39,11 @@ if ($ADMIN->fulltree) {
get_string('numberingoptions', 'mod_book'), get_string('numberingoptions_help', 'mod_book'), get_string('numberingoptions', 'mod_book'), get_string('numberingoptions_help', 'mod_book'),
array_keys($options), $options)); array_keys($options), $options));
//--- modedit defaults -----------------------------------------------------------------------------------
$settings->add(new admin_setting_heading('bookmodeditdefaults', get_string('modeditdefaults', 'admin'), get_string('condifmodeditdefaults', 'admin')));
$settings->add(new admin_setting_configselect('book/numbering',
get_string('numbering', 'mod_book'), '', BOOK_NUM_NUMBERS, $options));
} }
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment