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 Marcin Czaja (https://rosea.io)
21
 * @license   Commercial https://themeforest.net/licenses
22
 *
23
 */
24
 
25
defined('MOODLE_INTERNAL') || die();
26
global $PAGE, $OUTPUT;
27
 
28
// Variables Theme Settings.
29
$block3wrapperalign = theme_monocolor_get_setting('block3wrapperalign');
30
$block3titlecolor = theme_monocolor_get_setting('block3herotitlecolor');
31
$block3herotitlesize = theme_monocolor_get_setting('block3herotitlesize');
32
$block3titleweight = theme_monocolor_get_setting('block3herotitleweight');
33
$block3count = theme_monocolor_get_setting('block3count');
34
$block3wrapperbg = theme_monocolor_get_setting('block3wrapperbg');
35
$block3class = theme_monocolor_get_setting('block3class');
36
$block3introtitle = format_text(theme_monocolor_get_setting('block3introtitle'), FORMAT_HTML, array('noclean' => true));
37
$block3introcontent = format_text(theme_monocolor_get_setting('block3introcontent'), FORMAT_HTML, array('noclean' => true));
38
$block3html = format_text(theme_monocolor_get_setting('block3htmlcontent'), FORMAT_HTML, array('noclean' => true));
39
$block3footer = format_text(theme_monocolor_get_setting('block3footercontent'), FORMAT_HTML, array('noclean' => true));
40
 
41
$block3herotitle = format_text(theme_monocolor_get_setting("block3herotitle"), FORMAT_HTML, array('noclean' => true));
42
$block3herocaption = format_text(theme_monocolor_get_setting("block3herocaption"), FORMAT_HTML, array('noclean' => true));
43
$block3herocss = theme_monocolor_get_setting("block3herocss");
44
$block3heroimg = $PAGE->theme->setting_file_url("block3img", "block3img");
45
 
46
// Start Title - Alignment.
47
$block3wrapperalignclass = null;
48
if ($block3wrapperalign == 0) {
49
    $block3wrapperalignclass = 'rui-hero-content-left';
50
}
51
 
52
if ($block3wrapperalign == 1) {
53
    $block3wrapperalignclass = 'rui-hero-content-centered';
54
}
55
 
56
if ($block3wrapperalign == 2) {
57
    $block3wrapperalignclass = 'rui-hero-content-right';
58
}
59
// End.
60
 
61
// Start Title - Color.
62
$block3titlecolorclass = null;
63
if ($block3titlecolor == 0) {
64
    $block3titlecolorclass = ' rui-text--white';
65
}
66
 
67
if ($block3titlecolor == 1) {
68
    $block3titlecolorclass = ' rui-text--black';
69
}
70
 
71
if ($block3titlecolor == 2) {
72
    $block3titlecolorclass = ' rui-text--gradient';
73
}
74
// End.
75
 
76
// Start Title - Weight.
77
$block3titleweightclass = null;
78
if ($block3titleweight == 0) {
79
    $block3titleweightclass = ' rui-text--weight-normal';
80
}
81
 
82
if ($block3titleweight == 1) {
83
    $block3titleweightclass = ' rui-text--weight-medium';
84
}
85
 
86
if ($block3titleweight == 2) {
87
    $block3titleweightclass = ' rui-text--weight-bold';
88
}
89
// End.
90
 
91
// Start Title - Size.
92
$block3herotitlesizeclass = null;
93
if ($block3herotitlesize == 0) {
94
    $block3herotitlesizeclass = '';
95
}
96
 
97
if ($block3herotitlesize == 1) {
98
    $block3herotitlesizeclass = ' rui-hero-title-lg';
99
}
100
 
101
if ($block3herotitlesize == 2) {
102
    $block3herotitlesizeclass = ' rui-hero-title-xl';
103
}
104
// End.
105
 
106
 
107
 
108
if (theme_monocolor_get_setting('showblock3wrapper') == '1') {
109
    $block3heroclass = 'rui-hero-content-backdrop rui-hero-content-backdrop--block3';
110
} else {
111
    $block3heroclass = '';
112
}
113
echo '<!-- Start Block #3 -->';
114
 
115
if (theme_monocolor_get_setting('block3fw') == '1') {
116
    echo '<div id="fpblock3" class="wrapper-fw rui-fp-block--3 rui-fp-margin-bottom ' . $block3class . '">';
117
} else {
118
    echo '<div id="fpblock3" class="wrapper-xl rui-fp-block--3 rui-fp-margin-bottom ' . $block3class . '">';
119
}
120
 
121
if (!empty($block3introtitle) || !empty($block3introcontent)) {
122
    echo '<div class="wrapper-sm rui-fp-block-mb">';
123
}
124
if (!empty($block3introtitle)) {
125
    echo '<h3 class="rui-block-title">' . $block3introtitle . '</h3>';
126
}
127
if (!empty($block3introcontent)) {
128
    echo '<div class="rui-block-desc">' . $block3introcontent . '</div>';
129
}
130
if (!empty($block3introtitle) || !empty($block3introcontent)) {
131
    echo '</div>';
132
}
133
 
134
echo '<div class="rui-hero-img">';
135
 
136
if (!empty($block3herocaption) || !empty($block3herotitle)) {
137
    echo '<div class="rui-hero-content rui-hero-content--img ' .
138
    $block3heroclass .
139
    ' rui-hero-content-position ' .
140
    $block3wrapperalignclass .
141
    '">';
142
}
143
 
144
if (!empty($block3herotitle)) {
145
    echo '<h3 class="rui-hero-title ' .
146
        $block3titlecolorclass .
147
        $block3titleweightclass .
148
        $block3herotitlesizeclass .
149
        '">' .
150
        $block3herotitle .
151
        '</h3>';
152
}
153
 
154
if (!empty($block3herocaption)) {
155
    echo '<div class="rui-hero-desc ' .
156
        $block3titlecolorclass .
157
        '">' . $block3herocaption . '</div>';
158
}
159
 
160
if (!empty($block3herocaption) || !empty($block3herotitle)) {
161
    echo '</div>';
162
}
163
 
164
echo '<img class="d-flex img-fluid w-100" src="' . $block3heroimg . '" alt="' . $block3herotitle . '" />';
165
echo '</div>';
166
 
167
echo $block3html;
168
if (!empty($block3footer)) {
169
    echo '<div class="rui-block-footer wrapper-fw">' . $block3footer . '</div>';
170
}
171
echo '</div>';
172
if (theme_monocolor_get_setting("displayhrblock3") == '1') {
173
    echo '<hr class="rui-block-hr" />';
174
}
175
echo '<!-- End Block 3 -->';
176
 
177
echo '<script>function reportWindowSize(){for(var e=document.getElementsByClassName("rui-hero-content--img"),
178
    o=0,t=0|e.length;o<t;o=o+1|0){var n=e[o].offsetHeight;e[o].style.top="calc(50% - "+n/2+"px)"}}
179
    window.addEventListener("resize",reportWindowSize),window.onload=reportWindowSize();</script>';