MDL-46921 lib: Update get_all_user_name_fields() plus unit tests.
[moodle.git] / mod / lesson / settings.php
blobcd909a6c01bcd62bb3cba784b027d758e4f967fe
1 <?php
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.
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/>.
18 /**
19 * Settings used by the lesson module, were moved from mod_edit
21 * @package mod_lesson
22 * @copyright 2009 Sam Hemelryk
23 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or late
24 **/
26 defined('MOODLE_INTERNAL') || die;
28 if ($ADMIN->fulltree) {
29 require_once($CFG->dirroot.'/mod/lesson/locallib.php');
31 /** Slideshow settings */
32 $settings->add(new admin_setting_configtext('lesson_slideshowwidth', get_string('slideshowwidth', 'lesson'),
33 get_string('configslideshowwidth', 'lesson'), 640, PARAM_INT));
35 $settings->add(new admin_setting_configtext('lesson_slideshowheight', get_string('slideshowheight', 'lesson'),
36 get_string('configslideshowheight', 'lesson'), 480, PARAM_INT));
38 $settings->add(new admin_setting_configtext('lesson_slideshowbgcolor', get_string('slideshowbgcolor', 'lesson'),
39 get_string('configslideshowbgcolor', 'lesson'), '#FFFFFF', PARAM_TEXT));
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));
45 $settings->add(new admin_setting_configtext('lesson_mediaheight', get_string('mediaheight', 'lesson'),
46 get_string('configmediaheight', 'lesson'), 480, PARAM_INT));
48 $settings->add(new admin_setting_configcheckbox('lesson_mediaclose', get_string('mediaclose', 'lesson'),
49 get_string('configmediaclose', 'lesson'), false, PARAM_TEXT));
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));
55 /** Default lesson settings */
56 $numbers = array();
57 for ($i=20; $i>1; $i--) {
58 $numbers[$i] = $i;
60 $settings->add(new admin_setting_configselect('lesson_maxanswers', get_string('maximumnumberofanswersbranches','lesson'),
61 get_string('configmaxanswers', 'lesson'), 4, $numbers));
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));