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 2023 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_block20', get_string('settingsblock20', 'theme_monocolor'));
|
|
|
29 |
|
|
|
30 |
$name = 'theme_monocolor/displayblock20';
|
|
|
31 |
$title = get_string('turnon', 'theme_monocolor');
|
|
|
32 |
$description = get_string('displayblock20_desc', 'theme_monocolor');
|
|
|
33 |
$default = 0;
|
|
|
34 |
$setting = new admin_setting_configcheckbox($name, $title .
|
|
|
35 |
'<span class="badge badge-sq badge-dark ml-2">Block #20</span>', $description, $default);
|
|
|
36 |
$page->add($setting);
|
|
|
37 |
|
|
|
38 |
$name = 'theme_monocolor/displayhrblock20';
|
|
|
39 |
$title = get_string('displayblockhr', 'theme_monocolor');
|
|
|
40 |
$description = get_string('displayblockhr_desc', 'theme_monocolor');
|
|
|
41 |
$default = 1;
|
|
|
42 |
$setting = new admin_setting_configcheckbox($name, $title, $description, $default);
|
|
|
43 |
$page->add($setting);
|
|
|
44 |
|
|
|
45 |
$name = 'theme_monocolor/block20id';
|
|
|
46 |
$title = get_string('additionalid', 'theme_monocolor');
|
|
|
47 |
$description = get_string('additionalid_desc', 'theme_monocolor');
|
|
|
48 |
$default = '';
|
|
|
49 |
$setting = new admin_setting_configtext($name, $title, $description, $default);
|
|
|
50 |
$page->add($setting);
|
|
|
51 |
|
|
|
52 |
$name = 'theme_monocolor/block20class';
|
|
|
53 |
$title = get_string('additionalclass', 'theme_monocolor');
|
|
|
54 |
$description = get_string('additionalclass_desc', 'theme_monocolor');
|
|
|
55 |
$default = '';
|
|
|
56 |
$setting = new admin_setting_configtext($name, $title, $description, $default);
|
|
|
57 |
$page->add($setting);
|
|
|
58 |
|
|
|
59 |
$name = 'theme_monocolor/block20textalign';
|
|
|
60 |
$title = get_string('blocktextalign', 'theme_monocolor');
|
|
|
61 |
$description = get_string('blocktextalign_desc', 'theme_monocolor');
|
|
|
62 |
$options = [];
|
|
|
63 |
$options['left'] = get_string('left', 'theme_monocolor');
|
|
|
64 |
$options['center'] = get_string('center', 'theme_monocolor');
|
|
|
65 |
$options['right'] = get_string('right', 'theme_monocolor');
|
|
|
66 |
$setting = new admin_setting_configselect($name, $title, $description, 'center', $options);
|
|
|
67 |
$page->add($setting);
|
|
|
68 |
|
|
|
69 |
$name = 'theme_monocolor/block20introsubtitle';
|
|
|
70 |
$title = get_string('blockintrosubtitle', 'theme_monocolor');
|
|
|
71 |
$description = get_string('blockintrosubtitle_desc', 'theme_monocolor');
|
|
|
72 |
$default = '';
|
|
|
73 |
$setting = new admin_setting_configtextarea($name, $title, $description, $default);
|
|
|
74 |
$page->add($setting);
|
|
|
75 |
|
|
|
76 |
$name = 'theme_monocolor/block20introtitle';
|
|
|
77 |
$title = get_string('blockintrotitle', 'theme_monocolor');
|
|
|
78 |
$description = get_string('blockintrotitle_desc', 'theme_monocolor');
|
|
|
79 |
$default = '';
|
|
|
80 |
$setting = new admin_setting_configtextarea($name, $title, $description, $default);
|
|
|
81 |
$page->add($setting);
|
|
|
82 |
|
|
|
83 |
$name = 'theme_monocolor/block20titlesize';
|
|
|
84 |
$title = get_string('blocktitlesize', 'theme_monocolor');
|
|
|
85 |
$description = get_string('blocktitlesize_desc', 'theme_monocolor');
|
|
|
86 |
$default = 1;
|
|
|
87 |
$choices = array(0 => 'Normal', 1 => 'Large', 2 => 'Extra Large');
|
|
|
88 |
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
|
|
|
89 |
$page->add($setting);
|
|
|
90 |
|
|
|
91 |
$name = 'theme_monocolor/block20titlecolor';
|
|
|
92 |
$title = get_string('blocktitlecolor', 'theme_monocolor');
|
|
|
93 |
$description = get_string('blocktitlecolor_desc', 'theme_monocolor');
|
|
|
94 |
$default = 1;
|
|
|
95 |
$choices = array(0 => 'White', 1 => 'Black', 2 => 'Gradient');
|
|
|
96 |
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
|
|
|
97 |
$page->add($setting);
|
|
|
98 |
|
|
|
99 |
$name = 'theme_monocolor/block20titleweight';
|
|
|
100 |
$title = get_string('blocktitleweight', 'theme_monocolor');
|
|
|
101 |
$description = get_string('blocktitleweight_desc', 'theme_monocolor');
|
|
|
102 |
$default = 1;
|
|
|
103 |
$choices = array(0 => 'Normal', 1 => 'Medium', 2 => 'Bold');
|
|
|
104 |
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
|
|
|
105 |
$page->add($setting);
|
|
|
106 |
|
|
|
107 |
$name = 'theme_monocolor/block20introcontent';
|
|
|
108 |
$title = get_string('blockintrocontent', 'theme_monocolor');
|
|
|
109 |
$description = get_string('blockintrocontent_desc', 'theme_monocolor');
|
|
|
110 |
$default = '';
|
|
|
111 |
$setting = new admin_setting_configtextarea($name, $title, $description, $default);
|
|
|
112 |
$page->add($setting);
|
|
|
113 |
|
|
|
114 |
$name = 'theme_monocolor/block20htmlcontent';
|
|
|
115 |
$title = get_string('blockhtmlcontent', 'theme_monocolor');
|
|
|
116 |
$description = get_string('blockhtmlcontent_desc', 'theme_monocolor');
|
|
|
117 |
$default = '';
|
|
|
118 |
$setting = new admin_setting_configtextarea($name, $title, $description, $default);
|
|
|
119 |
$page->add($setting);
|
|
|
120 |
|
|
|
121 |
$name = 'theme_monocolor/block20footercontent';
|
|
|
122 |
$title = get_string('blockfootercontent', 'theme_monocolor');
|
|
|
123 |
$description = get_string('blockfootercontent_desc', 'theme_monocolor');
|
|
|
124 |
$default = '';
|
|
|
125 |
$setting = new admin_setting_configtextarea($name, $title, $description, $default);
|
|
|
126 |
$page->add($setting);
|
|
|
127 |
|
|
|
128 |
$fileid = 'block20bg';
|
|
|
129 |
$name = 'theme_monocolor/block20bg';
|
|
|
130 |
$title = get_string('blockbg', 'theme_monocolor');
|
|
|
131 |
$description = get_string('blockbg_desc', 'theme_monocolor');
|
|
|
132 |
$opts = array('accepted_types' => array('.png', '.jpg', '.gif', '.webp', '.tiff', '.svg'), 'maxfiles' => 1);
|
|
|
133 |
$setting = new admin_setting_configstoredfile($name, $title, $description, $fileid, 0, $opts);
|
|
|
134 |
$setting->set_updatedcallback('theme_reset_all_caches');
|
|
|
135 |
$page->add($setting);
|
|
|
136 |
|
|
|
137 |
$name = 'theme_monocolor/block20customcss';
|
|
|
138 |
$title = get_string('blockcustomcss', 'theme_monocolor');
|
|
|
139 |
$description = get_string('blockcustomcss_desc', 'theme_monocolor');
|
|
|
140 |
$default = 'background: linear-gradient(to top right, #9f9ef6, #feedba);';
|
|
|
141 |
$setting = new admin_setting_configtextarea($name, $title, $description, $default);
|
|
|
142 |
$page->add($setting);
|
|
|
143 |
|
|
|
144 |
$settings->add($page);
|