forked from catalyst/moodle-local_envbar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.php
134 lines (108 loc) · 5.61 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<?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/>.
/**
* Environment bar settings.
*
* @package local_envbar
* @author Grigory Baleevskiy ([email protected])
* @author Nicholas Hoobin <[email protected]>
* @copyright Catalyst IT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
use local_envbar\local\envbarlib;
if (!defined('MOODLE_INTERNAL')) {
die('Direct access to this script is forbidden.'); // It must be included from a Moodle page.
}
if ($hassiteconfig) {
$ADMIN->add('localplugins', new admin_category('envbar', get_string('pluginname', 'local_envbar')));
$envsettings = new admin_externalpage('local_envbar_settings',
get_string('menuenvsettings', 'local_envbar', null, true),
new moodle_url('/local/envbar/index.php'));
$lastrefresh = new admin_externalpage('local_envbar_lastrefresh',
get_string('menulastrefresh', 'local_envbar', null, true),
new moodle_url('/local/envbar/last_refresh.php'));
$presentation = new admin_settingpage('local_envbar_presentation',
get_string('menupresentation', 'local_envbar', null, true));
$presentation->add(new admin_setting_heading('local_envbar/envbarheading',
get_string('envbarheading', 'local_envbar', null, true),
''));
$presentation->add(new admin_setting_configtextarea('local_envbar/extracss',
get_string('extracss', 'local_envbar', null, true),
get_string('extracss_desc', 'local_envbar', null, true),
envbarlib::get_default_extra_css(),
PARAM_RAW,
50,
10));
$presentation->add(new admin_setting_configtext('local_envbar/stringseparator',
get_string('stringseparator', 'local_envbar', null, true),
get_string('stringseparator_desc', 'local_envbar', null, true),
'-',
PARAM_CLEANHTML));
$presentation->add(new admin_setting_configcheckbox('local_envbar/showconfiglink',
get_string('showconfiglink', 'local_envbar', null, true),
get_string('showconfiglink_desc', 'local_envbar', null, true),
true));
$presentation->add(new admin_setting_configcheckbox('local_envbar/showdebugging',
get_string('showdebugging', 'local_envbar', null, true),
get_string('showdebugging_desc', 'local_envbar', null, true),
true));
$presentation->add(new admin_setting_heading('local_envbar/menuheading',
get_string('menuheading', 'local_envbar', null, true),
''));
$presentation->add(new admin_setting_configcheckbox('local_envbar/enablemenu',
get_string('enablemenu', 'local_envbar', null, true),
get_string('enablemenu_desc', 'local_envbar', null, true),
true));
$presentation->add(new admin_setting_configtext('local_envbar/menuselector',
get_string('menuselector', 'local_envbar', null, true),
get_string('menuselector_desc', 'local_envbar', null, true),
'.usermenu .menu',
PARAM_RAW));
$presentation->add(new admin_setting_configtext('local_envbar/dividerselector',
get_string('dividerselector', 'local_envbar', null, true),
get_string('dividerselector_desc', 'local_envbar', null, true),
'filler',
PARAM_RAW));
$presentation->add(new admin_setting_heading('local_envbar/linksheading',
get_string('linksheading', 'local_envbar', null, true),
''));
$presentation->add(new admin_setting_configcheckbox('local_envbar/highlightlinks',
get_string('highlightlinks', 'local_envbar', null, true),
get_string('highlightlinks_desc', 'local_envbar', null, true),
true));
$presentation->add(new admin_setting_configcheckbox('local_envbar/highlightlinksenvbar',
get_string('highlightlinksenvbar', 'local_envbar', null, true),
get_string('highlightlinksenvbar_desc', 'local_envbar', null, true),
true));
$presentation->add(new admin_setting_heading('local_envbar/faviconheading',
get_string('faviconheading', 'local_envbar', null, true),
''));
$presentation->add(new admin_setting_configcheckbox('local_envbar/enablefaviconcolorize',
get_string('enablefaviconcolorize', 'local_envbar', null, true),
get_string('enablefaviconcolorize_desc', 'local_envbar', null, true),
true));
$presentation->add(new admin_setting_heading('local_envbar/titleheading',
get_string('titleheading', 'local_envbar', null, true),
''));
$presentation->add(new admin_setting_configcheckbox('local_envbar/enabletitleprefix',
get_string('enabletitleprefix', 'local_envbar', null, true),
get_string('enabletitleprefix_desc', 'local_envbar', null, true),
true));
$ADMIN->add('envbar', $envsettings);
$ADMIN->add('envbar', $lastrefresh);
$ADMIN->add('envbar', $presentation);
$settings = null;
}