forked from michael-milette/moodle-filter_filtercodes
-
Notifications
You must be signed in to change notification settings - Fork 1
/
settings.php
63 lines (58 loc) · 2.84 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
<?php
// This file is part of FilterCodes for Moodle - http://moodle.org/
//
// FilterCodes 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.
//
// FilterCodes 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 page for FilterCodes.
*
* @package filter_filtercodes
* @copyright 2017-2020 TNG Consulting Inc. - www.tngcosulting.ca
* @author Michael Milette
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
if ($hassiteconfig) {
if ($ADMIN->fulltree) {
// Option to enable experimental support for filtercodes in custom navigation menu.
if ($CFG->branch >= 32 && $CFG->branch <= 34) { // Only supported in Moodle 3.2 to 3.4.
// See https://github.com/michael-milette/moodle-filter_filtercodes/issues/67 for details.
$default = 0;
$name = 'filter_filtercodes/enable_customnav';
$title = get_string('enable_customnav', 'filter_filtercodes');
$description = get_string('enable_customnav_description', 'filter_filtercodes');
$setting = new admin_setting_configcheckbox($name, $title, $description, $default);
} else { // Disable for all other versions of Moodle.
set_config('disabled_customnav', 0, 'filter_filtercodes');
$name = 'filter_filtercodes/disabled_customnav';
$title = '';
$description = get_string('disabled_customnav_description', 'filter_filtercodes');
$setting = new admin_setting_heading($name, $title, $description);
}
$settings->add($setting);
// Course List Columns.
$default = '1';
$name = 'filter_filtercodes/escapebraces';
$title = get_string('escapebraces', 'filter_filtercodes');
$description = get_string('escapebraces_desc', 'filter_filtercodes');
$setting = new admin_setting_configcheckbox($name, $title, $description, $default);
$settings->add($setting);
// Option to enable scrape tag.
$default = 0;
$name = 'filter_filtercodes/enable_scrape';
$title = get_string('enable_scrape', 'filter_filtercodes');
$description = get_string('enable_scrape_description', 'filter_filtercodes');
$setting = new admin_setting_configcheckbox($name, $title, $description, $default);
$settings->add($setting);
}
}