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 2024 Marcin Czaja (https://rosea.io)
|
|
|
21 |
* @license Commercial https://themeforest.net/licenses
|
|
|
22 |
*
|
|
|
23 |
*/
|
|
|
24 |
|
|
|
25 |
|
|
|
26 |
defined('MOODLE_INTERNAL') || die();
|
|
|
27 |
|
|
|
28 |
$page = new admin_settingpage('theme_monocolor_customemail', get_string('customemailsettings', 'theme_monocolor'));
|
|
|
29 |
|
|
|
30 |
$name = 'theme_monocolor/email_preview';
|
|
|
31 |
$title = get_string('email_preview', 'theme_monocolor');
|
|
|
32 |
$description = get_string('email_preview_desc', 'theme_monocolor');
|
|
|
33 |
$setting = new admin_setting_heading($name, $title, $description);
|
|
|
34 |
$page->add($setting);
|
|
|
35 |
|
|
|
36 |
$name = 'theme_monocolor/email_logo_heading';
|
|
|
37 |
$title = get_string('email_logo_heading', 'theme_monocolor');
|
|
|
38 |
$description = get_string('empty_desc', 'theme_monocolor');
|
|
|
39 |
$setting = new admin_setting_heading($name, $title, $description);
|
|
|
40 |
$page->add($setting);
|
|
|
41 |
|
|
|
42 |
$name = 'theme_monocolor/email_logo_file';
|
|
|
43 |
$title = get_string('email_logo_file', 'theme_monocolor');
|
|
|
44 |
$description = get_string('email_logo_file_desc', 'theme_monocolor');
|
|
|
45 |
$opts = array('accepted_types' => array('.png', '.jpg', '.gif'), 'maxfiles' => 1);
|
|
|
46 |
$setting = new admin_setting_configstoredfile($name, $title, $description, 'email_logo_file', 0, $opts);
|
|
|
47 |
$setting->set_updatedcallback('theme_reset_all_caches');
|
|
|
48 |
$page->add($setting);
|
|
|
49 |
|
|
|
50 |
// Logo Height
|
|
|
51 |
$name = 'theme_monocolor/email_logo_height';
|
|
|
52 |
$title = get_string('email_logo_height', 'theme_monocolor');
|
|
|
53 |
$description = get_string('empty_desc', 'theme_monocolor');
|
|
|
54 |
$default = '40px';
|
|
|
55 |
$setting = new admin_setting_configtext($name, $title, $description, $default);
|
|
|
56 |
$setting->set_updatedcallback('theme_reset_all_caches');
|
|
|
57 |
$page->add($setting);
|
|
|
58 |
|
|
|
59 |
// Logo <img> alt value
|
|
|
60 |
$name = 'theme_monocolor/email_logo_alt';
|
|
|
61 |
$title = get_string('email_logo_alt', 'theme_monocolor');
|
|
|
62 |
$description = get_string('empty_desc', 'theme_monocolor');
|
|
|
63 |
$default = '';
|
|
|
64 |
$setting = new admin_setting_configtext($name, $title, $description, $default);
|
|
|
65 |
$setting->set_updatedcallback('theme_reset_all_caches');
|
|
|
66 |
$page->add($setting);
|
|
|
67 |
|
|
|
68 |
// Logo <a> href value
|
|
|
69 |
$name = 'theme_monocolor/email_logo_href';
|
|
|
70 |
$title = get_string('email_logo_href', 'theme_monocolor');
|
|
|
71 |
$description = get_string('empty_desc', 'theme_monocolor');
|
|
|
72 |
$default = '';
|
|
|
73 |
$setting = new admin_setting_configtext($name, $title, $description, $default);
|
|
|
74 |
$setting->set_updatedcallback('theme_reset_all_caches');
|
|
|
75 |
$page->add($setting);
|
|
|
76 |
|
|
|
77 |
$name = 'theme_monocolor/email_typo_heading';
|
|
|
78 |
$title = get_string('email_typo_heading', 'theme_monocolor');
|
|
|
79 |
$description = get_string('empty_desc', 'theme_monocolor');
|
|
|
80 |
$setting = new admin_setting_heading($name, $title, $description);
|
|
|
81 |
$page->add($setting);
|
|
|
82 |
|
|
|
83 |
// Font family.
|
|
|
84 |
$name = 'theme_monocolor/email_typo_fontfamily';
|
|
|
85 |
$title = get_string('email_typo_fontfamily', 'theme_monocolor');
|
|
|
86 |
$description = get_string('empty_desc', 'theme_monocolor');
|
|
|
87 |
$default = 'Verdana,Arial,sans-serif';
|
|
|
88 |
$choices = array();
|
|
|
89 |
$choices['Arial,Verdana,sans-serif'] = 'Arial';
|
|
|
90 |
$choices['Verdana,Arial,sans-serif'] = 'Verdana';
|
|
|
91 |
$choices['Helvetica,Verdana,Arial,sans-serif'] = 'Helvetica';
|
|
|
92 |
$choices['Georgia,Times,Times New Roman,serif'] = 'Georgia';
|
|
|
93 |
$choices['Tahoma,Verdana,Arial,sans-serif'] = 'Tahoma';
|
|
|
94 |
$choices['Trebuchet MS,Lucida Grande,Lucida Sans Unicode,Lucida Sans,Tahoma,sans-serif'] = 'Trebuchet';
|
|
|
95 |
$choices['Times,Georgia,Times New Roman,serif'] = 'Times';
|
|
|
96 |
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
|
|
|
97 |
$setting->set_updatedcallback('theme_reset_all_caches');
|
|
|
98 |
$page->add($setting);
|
|
|
99 |
|
|
|
100 |
// Text font size.
|
|
|
101 |
$name = 'theme_monocolor/email_typo_text_fontsize';
|
|
|
102 |
$title = get_string('email_typo_text_fontsize', 'theme_monocolor');
|
|
|
103 |
$description = get_string('empty_desc', 'theme_monocolor');
|
|
|
104 |
$default = '15px';
|
|
|
105 |
$choices = array();
|
|
|
106 |
$choices['12px'] = '12px';
|
|
|
107 |
$choices['13px'] = '13px';
|
|
|
108 |
$choices['14px'] = '14px';
|
|
|
109 |
$choices['15px'] = '15px';
|
|
|
110 |
$choices['16px'] = '16px';
|
|
|
111 |
$choices['17px'] = '17px';
|
|
|
112 |
$choices['18px'] = '18px';
|
|
|
113 |
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
|
|
|
114 |
$setting->set_updatedcallback('theme_reset_all_caches');
|
|
|
115 |
$page->add($setting);
|
|
|
116 |
|
|
|
117 |
// Text font color.
|
|
|
118 |
$name = 'theme_monocolor/email_typo_text_color';
|
|
|
119 |
$title = get_string('email_typo_text_color', 'theme_monocolor');
|
|
|
120 |
$description = get_string('empty_desc', 'theme_monocolor');
|
|
|
121 |
$setting = new admin_setting_configcolourpicker($name, $title, $description, '#000000');
|
|
|
122 |
$setting->set_updatedcallback('theme_reset_all_caches');
|
|
|
123 |
$page->add($setting);
|
|
|
124 |
|
|
|
125 |
$name = 'theme_monocolor/email_typo_link_color';
|
|
|
126 |
$title = get_string('email_typo_link_color', 'theme_monocolor');
|
|
|
127 |
$description = get_string('empty_desc', 'theme_monocolor');
|
|
|
128 |
$setting = new admin_setting_configcolourpicker($name, $title, $description, '#0d80cb');
|
|
|
129 |
$setting->set_updatedcallback('theme_reset_all_caches');
|
|
|
130 |
$page->add($setting);
|
|
|
131 |
|
|
|
132 |
// Footer font size.
|
|
|
133 |
$name = 'theme_monocolor/email_typo_footer_fontsize';
|
|
|
134 |
$title = get_string('email_typo_footer_fontsize', 'theme_monocolor');
|
|
|
135 |
$description = get_string('empty_desc', 'theme_monocolor');
|
|
|
136 |
$default = '15px';
|
|
|
137 |
$choices = array();
|
|
|
138 |
$choices['12px'] = '12px';
|
|
|
139 |
$choices['13px'] = '13px';
|
|
|
140 |
$choices['14px'] = '14px';
|
|
|
141 |
$choices['15px'] = '15px';
|
|
|
142 |
$choices['16px'] = '16px';
|
|
|
143 |
$choices['17px'] = '17px';
|
|
|
144 |
$choices['18px'] = '18px';
|
|
|
145 |
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
|
|
|
146 |
$setting->set_updatedcallback('theme_reset_all_caches');
|
|
|
147 |
$page->add($setting);
|
|
|
148 |
|
|
|
149 |
// Footer font color.
|
|
|
150 |
$name = 'theme_monocolor/email_typo_footer_color';
|
|
|
151 |
$title = get_string('email_typo_footer_color', 'theme_monocolor');
|
|
|
152 |
$description = get_string('empty_desc', 'theme_monocolor');
|
|
|
153 |
$setting = new admin_setting_configcolourpicker($name, $title, $description, '#6c757d');
|
|
|
154 |
$setting->set_updatedcallback('theme_reset_all_caches');
|
|
|
155 |
$page->add($setting);
|
|
|
156 |
|
|
|
157 |
|
|
|
158 |
// Title.
|
|
|
159 |
$name = 'theme_monocolor/email_footer_heading';
|
|
|
160 |
$title = get_string('email_footer_heading', 'theme_monocolor');
|
|
|
161 |
$description = get_string('empty_desc', 'theme_monocolor');
|
|
|
162 |
$setting = new admin_setting_heading($name, $title, $description);
|
|
|
163 |
$page->add($setting);
|
|
|
164 |
|
|
|
165 |
// Text.
|
|
|
166 |
$name = 'theme_monocolor/email_footer_text';
|
|
|
167 |
$title = get_string('email_footer_text', 'theme_monocolor');
|
|
|
168 |
$description = get_string('empty_desc', 'theme_monocolor');
|
|
|
169 |
$default = '';
|
|
|
170 |
$setting = new admin_setting_configtextarea($name, $title, $description, $default);
|
|
|
171 |
$setting->set_updatedcallback('theme_reset_all_caches');
|
|
|
172 |
$page->add($setting);
|
|
|
173 |
|
|
|
174 |
// Copyright.
|
|
|
175 |
$name = 'theme_monocolor/email_footer_copyright';
|
|
|
176 |
$title = get_string('email_footer_copyright', 'theme_monocolor');
|
|
|
177 |
$description = get_string('empty_desc', 'theme_monocolor');
|
|
|
178 |
$default = '';
|
|
|
179 |
$setting = new admin_setting_configtext($name, $title, $description, $default);
|
|
|
180 |
$setting->set_updatedcallback('theme_reset_all_caches');
|
|
|
181 |
$page->add($setting);
|
|
|
182 |
|
|
|
183 |
// Display logo
|
|
|
184 |
$name = 'theme_monocolor/email_footer_displaylogo';
|
|
|
185 |
$title = get_string('email_footer_displaylogo', 'theme_monocolor');
|
|
|
186 |
$description = get_string('empty_desc', 'theme_monocolor');
|
|
|
187 |
$default = 1;
|
|
|
188 |
$setting = new admin_setting_configcheckbox($name, $title, $description, $default);
|
|
|
189 |
$setting->set_updatedcallback('theme_reset_all_caches');
|
|
|
190 |
$page->add($setting);
|
|
|
191 |
|
|
|
192 |
$settings->add($page);
|