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_universe
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_universe_block18', get_string('settingsblock18', 'theme_universe'));
29
 
30
$name = 'theme_universe/displayblock18';
31
$title = get_string('turnon', 'theme_universe');
32
$description = get_string('displayblock18_desc', 'theme_universe');
33
$default = 0;
34
$setting = new admin_setting_configcheckbox($name, $title .
35
'<span class="badge badge-sq badge-dark ml-2">Block #18</span>', $description, $default);
36
$page->add($setting);
37
 
38
$name = 'theme_universe/displayhrblock18';
39
$title = get_string('displayblockhr', 'theme_universe');
40
$description = get_string('displayblockhr_desc', 'theme_universe');
41
$default = 1;
42
$setting = new admin_setting_configcheckbox($name, $title, $description, $default);
43
$page->add($setting);
44
 
45
$name = 'theme_universe/block18id';
46
$title = get_string('additionalid', 'theme_universe');
47
$description = get_string('additionalid_desc', 'theme_universe');
48
$default = '';
49
$setting = new admin_setting_configtext($name, $title, $description, $default);
50
$page->add($setting);
51
 
52
$name = 'theme_universe/block18class';
53
$title = get_string('additionalclass', 'theme_universe');
54
$description = get_string('additionalclass_desc', 'theme_universe');
55
$default = '';
56
$setting = new admin_setting_configtext($name, $title, $description, $default);
57
$page->add($setting);
58
 
59
$name = 'theme_universe/block18introsubtitle';
60
$title = get_string('blockintrosubtitle', 'theme_universe');
61
$description = get_string('blockintrosubtitle_desc', 'theme_universe');
62
$default = '';
63
$setting = new admin_setting_configtextarea($name, $title, $description, $default);
64
$page->add($setting);
65
 
66
$name = 'theme_universe/block18introtitle';
67
$title = get_string('blockintrotitle', 'theme_universe');
68
$description = get_string('blockintrotitle_desc', 'theme_universe');
69
$default = 'Help & Support';
70
$setting = new admin_setting_configtextarea($name, $title, $description, $default);
71
$page->add($setting);
72
 
73
$name = 'theme_universe/block18introcontent';
74
$title = get_string('blockintrocontent', 'theme_universe');
75
$description = get_string('blockintrocontent_desc', 'theme_universe');
76
$default = '';
77
$setting = new admin_setting_configtextarea($name, $title, $description, $default);
78
$page->add($setting);
79
 
80
$name = 'theme_universe/block18footercontent';
81
$title = get_string('blockfootercontent', 'theme_universe');
82
$description = get_string('blockfootercontent_desc', 'theme_universe');
83
$default = 'Lorem ipsum dolar set...';
84
$setting = new admin_setting_configtextarea($name, $title, $description, $default);
85
$page->add($setting);
86
 
87
$name = 'theme_universe/hblock18';
88
$heading = get_string('hblock18', 'theme_universe');
89
$title = get_string('hblock18_desc', 'theme_universe');
90
$setting = new admin_setting_heading($name, $heading, format_text($title, FORMAT_MARKDOWN));
91
$page->add($setting);
92
 
93
$name = 'theme_universe/block18htmlcontent';
94
$title = get_string('blockhtmlcontent', 'theme_universe');
95
$description = get_string('blockhtmlcontent_desc', 'theme_universe');
96
$default = '';
97
$setting = new universe_setting_confightmleditor($name, $title, $description, $default);
98
$page->add($setting);
99
 
100
$name = 'theme_universe/block18customcss';
101
$title = get_string('blockcustomcss', 'theme_universe');
102
$description = get_string('blockcustomcss_desc', 'theme_universe');
103
$default = '';
104
$setting = new admin_setting_configtextarea($name, $title, $description, $default);
105
$page->add($setting);
106
 
107
$name = 'theme_universe/hblock18_2';
108
$heading = get_string('hblock18_2', 'theme_universe');
109
$title = get_string('hblock18_2_desc', 'theme_universe');
110
$setting = new admin_setting_heading($name, $heading, format_text($title, FORMAT_MARKDOWN));
111
$page->add($setting);
112
 
113
$name = 'theme_universe/block18count';
114
$title = get_string('block18count', 'theme_universe');
115
$description = get_string('block18count_desc', 'theme_universe');
116
$default = 1;
117
$options = array();
118
for ($i = 1; $i <= 20; $i++) {
119
    $options[$i] = $i;
120
}
121
$setting = new admin_setting_configselect($name, $title, $description, $default, $options);
122
$page->add($setting);
123
 
124
$block18count = get_config('theme_universe', 'block18count');
125
 
126
if (!$block18count) {
127
    $block18count = 1;
128
}
129
 
130
for ($block18index = 1; $block18index <= $block18count; $block18index++) {
131
    $name = 'theme_universe/block18question' . $block18index;
132
    $title = get_string('block18question', 'theme_universe');
133
    $description = get_string('block18question_desc', 'theme_universe');
134
    $default = '';
135
    $setting = new admin_setting_configtextarea($name, '<span class="rui-admin-no">'.
136
    $block18index .
137
    '</span>' .
138
    $title, $description, $default);
139
    $page->add($setting);
140
 
141
    $name = 'theme_universe/block18answer' . $block18index;
142
    $title = get_string('block18answer', 'theme_universe');
143
    $description = get_string('block18answer_desc', 'theme_universe');
144
    $default = '';
145
    $setting = new universe_setting_confightmleditor($name, '<span class="rui-admin-no">' .
146
    $block18index .
147
    '</span>' .
148
    $title, $description, $default);
149
    $page->add($setting);
150
}
151
 
152
$settings->add($page);