Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
<?php
2
// This file is part of Moodle - http://moodle.org/
3
//
4
// Moodle is free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, either version 3 of the License, or
7
// (at your option) any later version.
8
//
9
// Moodle is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
// GNU General Public License for more details.
13
//
14
// You should have received a copy of the GNU General Public License
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
16
 
17
/**
18
 *
19
 * @package   theme_monocolor
20
 * @copyright 2022 - 2023 Marcin Czaja (https://rosea.io)
21
 * @license   Commercial https://themeforest.net/licenses
22
 *
23
 */
24
 
25
defined('MOODLE_INTERNAL') || die();
26
 
27
$page = new admin_settingpage('theme_monocolor_settingstopbar', get_string('settingstopbar', 'theme_monocolor'));
28
 
29
// Prepare hide nodes options.
30
$hidenodesoptions = array(
31
    'home' => get_string('home'),
32
    'myhome' => get_string('myhome'),
33
    'courses' => get_string('mycourses')
34
);
35
 
36
// Setting: Hide nodes in primary navigation.
37
$name = 'theme_monocolor/hidenodesprimarynavigation';
38
$title = get_string('hidenodesprimarynavigationsetting', 'theme_monocolor', null, true);
39
$description = get_string('hidenodesprimarynavigationsetting_desc', 'theme_monocolor', null, true);
40
$setting = new admin_setting_configmulticheckbox($name, $title, $description, array(), $hidenodesoptions);
41
$setting->set_updatedcallback('theme_reset_all_caches');
42
$page->add($setting);
43
 
44
$name = 'theme_monocolor/topbareditmode';
45
$title = get_string('topbareditmode', 'theme_monocolor');
46
$description = get_string('topbareditmode_desc', 'theme_monocolor');
47
$default = 0;
48
$setting = new admin_setting_configcheckbox($name, $title, $description, $default);
49
$setting->set_updatedcallback('theme_reset_all_caches');
50
$page->add($setting);
51
 
52
$name = 'theme_monocolor/topbarlogoareaon';
53
$title = get_string('topbarlogoareaon', 'theme_monocolor');
54
$description = get_string('topbarlogoareaon_desc', 'theme_monocolor');
55
$default = 1;
56
$setting = new admin_setting_configcheckbox($name, $title, $description, $default);
57
$setting->set_updatedcallback('theme_reset_all_caches');
58
$page->add($setting);
59
 
60
$name = 'theme_monocolor/customlogo';
61
$title = get_string('customlogo', 'theme_monocolor');
62
$description = get_string('customlogo_desc', 'theme_monocolor');
63
$opts = array('accepted_types' => array('.png', '.jpg', '.svg', 'gif'));
64
$setting = new admin_setting_configstoredfile($name, $title, $description, 'customlogo', 0, $opts);
65
$page->add($setting);
66
 
67
$name = 'theme_monocolor/customdmlogo';
68
$title = get_string('customdmlogo', 'theme_monocolor');
69
$description = get_string('customdmlogo_desc', 'theme_monocolor');
70
$opts = array('accepted_types' => array('.png', '.jpg', '.svg', 'gif'));
71
$setting = new admin_setting_configstoredfile($name, $title, $description, 'customdmlogo', 0, $opts);
72
$page->add($setting);
73
 
74
$name = 'theme_monocolor/customlogoandname';
75
$title = get_string('customlogoandname', 'theme_monocolor');
76
$description = get_string('customlogoandname_desc', 'theme_monocolor');
77
$default = 1;
78
$setting = new admin_setting_configcheckbox($name, $title, $description, $default);
79
$setting->set_updatedcallback('theme_reset_all_caches');
80
$page->add($setting);
81
 
82
$name = 'theme_monocolor/customlogotxt';
83
$title = get_string('customlogotxt', 'theme_monocolor');
84
$description = get_string('customlogotxt_desc', 'theme_monocolor');
85
$default = 'monocolor';
86
$setting = new admin_setting_configtext($name, $title, $description, $default);
87
$page->add($setting);
88
 
89
$name = 'theme_monocolor/topbarcustomhtml';
90
$title = get_string('topbarcustomhtml', 'theme_monocolor');
91
$description = get_string('topbarcustomhtml_desc', 'theme_monocolor');
92
$default = '';
93
$setting = new admin_setting_confightmleditor($name, $title, $description, $default);
94
$page->add($setting);
95
 
96
// Additional Button next to the Log in button.
97
$name = 'theme_monocolor/topbaradditionalbtn';
98
$title = get_string('topbaradditionalbtn', 'theme_monocolor');
99
$description = get_string('topbaradditionalbtn_desc', 'theme_monocolor');
100
$default = 1;
101
$setting = new admin_setting_configcheckbox($name, $title, $description, $default);
102
$setting->set_updatedcallback('theme_reset_all_caches');
103
$page->add($setting);
104
 
105
$name = 'theme_monocolor/stopbaradditionalbtn';
106
$title = get_string('stopbaradditionalbtn', 'theme_monocolor');
107
$description = get_string('stopbaradditionalbtn_desc', 'theme_monocolor');
108
$default = '';
109
$setting = new admin_setting_configtextarea($name, $title, $description, $default);
110
$page->add($setting);
111
 
112
$name = 'theme_monocolor/topbaradditionalbtnurl';
113
$title = get_string('topbaradditionalbtnurl', 'theme_monocolor');
114
$description = get_string('topbaradditionalbtnurl_desc', 'theme_monocolor');
115
$default = '';
116
$setting = new admin_setting_configtext($name, $title, $description, $default);
117
$page->add($setting);
118
 
119
// Colors.
120
$name = 'theme_monocolor/htopbarcolors';
121
$heading = get_string('htopbarcolors', 'theme_monocolor');
122
$title = get_string('htopbarcolors_desc', 'theme_monocolor');
123
$setting = new admin_setting_heading($name, $heading, format_text($title, FORMAT_MARKDOWN));
124
$page->add($setting);
125
 
126
$name = 'theme_monocolor/colortopbarbg';
127
$title = get_string('colortopbarbg', 'theme_monocolor');
128
$description = get_string('color_desc', 'theme_monocolor');
129
$setting = new admin_setting_configcolourpicker($name, $title, $description, '');
130
$setting->set_updatedcallback('theme_reset_all_caches');
131
$page->add($setting);
132
 
133
$name = 'theme_monocolor/colortopbartext';
134
$title = get_string('colortopbartext', 'theme_monocolor');
135
$description = get_string('color_desc', 'theme_monocolor');
136
$setting = new admin_setting_configcolourpicker($name, $title, $description, '');
137
$setting->set_updatedcallback('theme_reset_all_caches');
138
$page->add($setting);
139
 
140
$name = 'theme_monocolor/colortopbarbtn';
141
$title = get_string('colortopbarbtn', 'theme_monocolor');
142
$description = get_string('color_desc', 'theme_monocolor');
143
$setting = new admin_setting_configcolourpicker($name, $title, $description, '');
144
$setting->set_updatedcallback('theme_reset_all_caches');
145
$page->add($setting);
146
 
147
$name = 'theme_monocolor/colortopbarbtntext';
148
$title = get_string('colortopbarbtntext', 'theme_monocolor');
149
$description = get_string('color_desc', 'theme_monocolor');
150
$setting = new admin_setting_configcolourpicker($name, $title, $description, '');
151
$setting->set_updatedcallback('theme_reset_all_caches');
152
$page->add($setting);
153
 
154
$name = 'theme_monocolor/colortopbarbtnhover';
155
$title = get_string('colortopbarbtnhover', 'theme_monocolor');
156
$description = get_string('color_desc', 'theme_monocolor');
157
$setting = new admin_setting_configcolourpicker($name, $title, $description, '');
158
$setting->set_updatedcallback('theme_reset_all_caches');
159
$page->add($setting);
160
 
161
$name = 'theme_monocolor/colortopbarbtnhovertext';
162
$title = get_string('colortopbarbtnhovertext', 'theme_monocolor');
163
$description = get_string('color_desc', 'theme_monocolor');
164
$setting = new admin_setting_configcolourpicker($name, $title, $description, '');
165
$setting->set_updatedcallback('theme_reset_all_caches');
166
$page->add($setting);
167
 
168
// Must add the page after definiting all the settings!
169
$settings->add($page);