Commit | Line | Data |
---|---|---|
0a4abb73 SH |
1 | <?php |
2 | ||
3 | // This file is part of Moodle - http://moodle.org/ | |
4 | // | |
5 | // Moodle is free software: you can redistribute it and/or modify | |
6 | // it under the terms of the GNU General Public License as published by | |
7 | // the Free Software Foundation, either version 3 of the License, or | |
8 | // (at your option) any later version. | |
9 | // | |
10 | // Moodle is distributed in the hope that it will be useful, | |
11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | // GNU General Public License for more details. | |
14 | // | |
15 | // You should have received a copy of the GNU General Public License | |
16 | // along with Moodle. If not, see <http://www.gnu.org/licenses/>. | |
17 | ||
18 | /** | |
19 | * Settings used by the lesson module, were moved from mod_edit | |
20 | * | |
9b24f68b | 21 | * @package mod_lesson |
cc3dbaaa PS |
22 | * @copyright 2009 Sam Hemelryk |
23 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or late | |
0a4abb73 SH |
24 | **/ |
25 | ||
dbf9e4ba | 26 | defined('MOODLE_INTERNAL') || die; |
0a4abb73 | 27 | |
dbf9e4ba PS |
28 | if ($ADMIN->fulltree) { |
29 | require_once($CFG->dirroot.'/mod/lesson/locallib.php'); | |
0a4abb73 | 30 | |
dbf9e4ba PS |
31 | /** Slideshow settings */ |
32 | $settings->add(new admin_setting_configtext('lesson_slideshowwidth', get_string('slideshowwidth', 'lesson'), | |
33 | get_string('configslideshowwidth', 'lesson'), 640, PARAM_INT)); | |
0a4abb73 | 34 | |
dbf9e4ba PS |
35 | $settings->add(new admin_setting_configtext('lesson_slideshowheight', get_string('slideshowheight', 'lesson'), |
36 | get_string('configslideshowheight', 'lesson'), 480, PARAM_INT)); | |
0a4abb73 | 37 | |
dbf9e4ba PS |
38 | $settings->add(new admin_setting_configtext('lesson_slideshowbgcolor', get_string('slideshowbgcolor', 'lesson'), |
39 | get_string('configslideshowbgcolor', 'lesson'), '#FFFFFF', PARAM_TEXT)); | |
0a4abb73 | 40 | |
dbf9e4ba PS |
41 | /** Media file popup settings */ |
42 | $settings->add(new admin_setting_configtext('lesson_mediawidth', get_string('mediawidth', 'lesson'), | |
43 | get_string('configmediawidth', 'lesson'), 640, PARAM_INT)); | |
0a4abb73 | 44 | |
dbf9e4ba PS |
45 | $settings->add(new admin_setting_configtext('lesson_mediaheight', get_string('mediaheight', 'lesson'), |
46 | get_string('configmediaheight', 'lesson'), 480, PARAM_INT)); | |
0a4abb73 | 47 | |
dbf9e4ba PS |
48 | $settings->add(new admin_setting_configcheckbox('lesson_mediaclose', get_string('mediaclose', 'lesson'), |
49 | get_string('configmediaclose', 'lesson'), false, PARAM_TEXT)); | |
0a4abb73 | 50 | |
dbf9e4ba PS |
51 | /** Misc lesson settings */ |
52 | $settings->add(new admin_setting_configtext('lesson_maxhighscores', get_string('maxhighscores', 'lesson'), | |
53 | get_string('configmaxhighscores','lesson'), 10, PARAM_INT)); | |
0a4abb73 | 54 | |
dbf9e4ba PS |
55 | /** Default lesson settings */ |
56 | $numbers = array(); | |
57 | for ($i=20; $i>1; $i--) { | |
58 | $numbers[$i] = $i; | |
59 | } | |
60 | $settings->add(new admin_setting_configselect('lesson_maxanswers', get_string('maximumnumberofanswersbranches','lesson'), | |
61 | get_string('configmaxanswers', 'lesson'), 4, $numbers)); | |
62 | ||
63 | $defaultnextpages = array(); | |
64 | $defaultnextpages[0] = get_string("normal", "lesson"); | |
65 | $defaultnextpages[LESSON_UNSEENPAGE] = get_string("showanunseenpage", "lesson"); | |
66 | $defaultnextpages[LESSON_UNANSWEREDPAGE] = get_string("showanunansweredpage", "lesson"); | |
67 | $settings->add(new admin_setting_configselect('lesson_defaultnextpage', get_string('actionaftercorrectanswer','lesson'), | |
68 | get_string('configactionaftercorrectanswer', 'lesson'), 0, $defaultnextpages)); | |
d8389172 | 69 | $settings->add(new admin_setting_configcheckbox('lesson/requiremodintro', |
a6099a7a | 70 | get_string('requiremodintro', 'admin'), get_string('configrequiremodintro', 'admin'), 0)); |
d8389172 | 71 | } |