-
Notifications
You must be signed in to change notification settings - Fork 45
/
settings.php
78 lines (67 loc) · 4.18 KB
/
settings.php
1
2
3
4
5
6
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Settings for format.
*
* @package format_onetopic
* @copyright 2023 David Herney Bernal - cirano. https://bambuco.co
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die;
require_once($CFG->dirroot. '/course/format/onetopic/lib.php');
if ($ADMIN->fulltree) {
$settings->add(new admin_setting_configcheckbox('format_onetopic/enablecustomstyles',
get_string('enablecustomstyles', 'format_onetopic'),
get_string('enablecustomstyles_help', 'format_onetopic'), 1));
$settings->add(new admin_setting_configcheckbox('format_onetopic/anchortotabstree',
get_string('enableanchorposition', 'format_onetopic'),
get_string('enableanchorposition_help', 'format_onetopic'), 1));
$options = ['0' => get_string('disable'), '1' => get_string('enable')];
$settings->add(new admin_setting_configselect('format_onetopic/courseindex',
get_string('courseindex', 'format_onetopic'),
get_string('courseindex_help', 'format_onetopic'), 1, $options));
$options = [
\format_onetopic::SECTIONSNAVIGATION_SUPPORT => new lang_string('sectionsnavigation_support', 'format_onetopic'),
\format_onetopic::SECTIONSNAVIGATION_NOT => new lang_string('sectionsnavigation_not', 'format_onetopic'),
\format_onetopic::SECTIONSNAVIGATION_BOTTOM => new lang_string('sectionsnavigation_bottom', 'format_onetopic'),
\format_onetopic::SECTIONSNAVIGATION_BOTH => new lang_string('sectionsnavigation_both', 'format_onetopic'),
\format_onetopic::SECTIONSNAVIGATION_SLIDES => new lang_string('sectionsnavigation_slides', 'format_onetopic'),
];
$settings->add(new admin_setting_configselect('format_onetopic/defaultsectionsnavigation',
get_string('defaultsectionsnavigation', 'format_onetopic'),
get_string('defaultsectionsnavigation_help', 'format_onetopic'),
\format_onetopic::SECTIONSNAVIGATION_SUPPORT,
$options));
$options = [
\format_onetopic::SCOPE_MOD => new lang_string('scope_mod', 'format_onetopic'),
\format_onetopic::SCOPE_SCORM => new lang_string('scope_scorm', 'format_onetopic'),
];
$settings->add(new admin_setting_configmulticheckbox('format_onetopic/defaultscope',
get_string('defaultscope', 'format_onetopic'),
get_string('defaultscope_help', 'format_onetopic'),
\format_onetopic::SCOPE_MOD,
$options));
// Styles settings.
$name = 'format_onetopic/settingsheaderstyles';
$heading = get_string('settingsheaderstyles', 'format_onetopic');
$setting = new admin_setting_heading($name, $heading, '');
$settings->add($setting);
$name = 'format_onetopic/tabstyles';
$title = get_string('tabstyles', 'format_onetopic');
$description = get_string('tabstyles_help', 'format_onetopic');
$setting = new \format_onetopic\tabstyles($name, $title, $description, '');
$settings->add($setting);
}