Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1288 ariadna 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 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_universe_get_setting('block3wrapperalign');
30
$block3titlecolor = theme_universe_get_setting('block3herotitlecolor');
31
$block3herotitlesize = theme_universe_get_setting('block3herotitlesize');
32
$block3titleweight = theme_universe_get_setting('block3herotitleweight');
33
$block3count = theme_universe_get_setting('block3count');
34
$block3wrapperbg = theme_universe_get_setting('block3wrapperbg');
35
$block3class = theme_universe_get_setting('block3class');
36
$block3introtitle = format_text(theme_universe_get_setting('block3introtitle'), FORMAT_HTML, array('noclean' => true));
37
$block3introcontent = format_text(theme_universe_get_setting('block3introcontent'), FORMAT_HTML, array('noclean' => true));
38
$block3html = format_text(theme_universe_get_setting('block3htmlcontent'), FORMAT_HTML, array('noclean' => true));
39
$block3footer = format_text(theme_universe_get_setting('block3footercontent'), FORMAT_HTML, array('noclean' => true));
40
 
41
$block3introsubtitle = format_text(theme_universe_get_setting('block3introsubtitle'), FORMAT_HTML, array('noclean' => true));
42
$block3herotitle = format_text(theme_universe_get_setting("block3herotitle"), FORMAT_HTML, array('noclean' => true));
43
$block3herocaption = format_text(theme_universe_get_setting("block3herocaption"), FORMAT_HTML, array('noclean' => true));
44
$block3herocss = theme_universe_get_setting("block3herocss");
45
$block3heroimg = $PAGE->theme->setting_file_url("block3img", "block3img");
46
 
47
// Customm ID for the block.
48
$block3customid = theme_universe_get_setting('block3id');
49
$fpblockid3 = 'block3';
50
if (!empty($block3customid)) {
51
    $fpblockid5 = $block3customid;
52
}
53
// End.
54
 
55
// Start Title - Alignment.
56
$block3wrapperalignclass = null;
57
if ($block3wrapperalign == 0) {
58
    $block3wrapperalignclass = 'rui-hero-content-left';
59
}
60
 
61
if ($block3wrapperalign == 1) {
62
    $block3wrapperalignclass = 'rui-hero-content-centered';
63
}
64
 
65
if ($block3wrapperalign == 2) {
66
    $block3wrapperalignclass = 'rui-hero-content-right';
67
}
68
// End.
69
 
70
// Start Title - Color.
71
$block3titlecolorclass = null;
72
if ($block3titlecolor == 0) {
73
    $block3titlecolorclass = ' rui-text--white';
74
}
75
 
76
if ($block3titlecolor == 1) {
77
    $block3titlecolorclass = ' rui-text--black';
78
}
79
 
80
if ($block3titlecolor == 2) {
81
    $block3titlecolorclass = ' rui-text--gradient';
82
}
83
// End.
84
 
85
// Start Title - Weight.
86
$block3titleweightclass = null;
87
if ($block3titleweight == 0) {
88
    $block3titleweightclass = ' rui-text--weight-normal';
89
}
90
 
91
if ($block3titleweight == 1) {
92
    $block3titleweightclass = ' rui-text--weight-medium';
93
}
94
 
95
if ($block3titleweight == 2) {
96
    $block3titleweightclass = ' rui-text--weight-bold';
97
}
98
// End.
99
 
100
// Start Title - Size.
101
$block3herotitlesizeclass = null;
102
if ($block3herotitlesize == 0) {
103
    $block3herotitlesizeclass = '';
104
}
105
 
106
if ($block3herotitlesize == 1) {
107
    $block3herotitlesizeclass = ' rui-hero-title-lg';
108
}
109
 
110
if ($block3herotitlesize == 2) {
111
    $block3herotitlesizeclass = ' rui-hero-title-xl';
112
}
113
// End.
114
 
115
 
116
 
117
if (theme_universe_get_setting('showblock3wrapper') == '1') {
118
    $block3heroclass = 'rui-hero-content-backdrop rui-hero-content-backdrop--block3';
119
} else {
120
    $block3heroclass = '';
121
}
122
echo '<!-- Start Block #3 -->';
123
 
124
if (theme_universe_get_setting('block3fw') == '1') {
125
    echo '<div id="' . $fpblockid3 . '" class="wrapper-fw rui-fp-block--3 rui-fp-margin-bottom ' . $block3class . '">';
126
} else {
127
    echo '<div id="' . $fpblockid3 . '" class="wrapper-lg rui-fp-block--3 rui-fp-margin-bottom ' . $block3class . '">';
128
}
129
 
130
if (!empty($block3introtitle) || !empty($block3introcontent)) {
131
    echo '<div class="wrapper-sm rui-fp-block-mb">';
132
}
133
if (!empty($block3introsubtitle)) {
134
    echo '<h4 class="rui-block-subtitle">' . $block3introsubtitle . '</h4>';
135
}
136
if (!empty($block3introtitle)) {
137
    echo '<h3 class="rui-block-title">' . $block3introtitle . '</h3>';
138
}
139
if (!empty($block3introcontent)) {
140
    echo '<div class="rui-block-desc">' . $block3introcontent . '</div>';
141
}
142
if (!empty($block3introtitle) || !empty($block3introcontent)) {
143
    echo '</div>';
144
}
145
 
146
echo '<div class="rui-hero-img">';
147
 
148
if (!empty($block3herocaption) || !empty($block3herotitle)) {
149
    echo '<div class="rui-hero-content rui-hero-content--img ' .
150
    $block3heroclass .
151
    ' rui-hero-content-position ' .
152
    $block3wrapperalignclass .
153
    '">';
154
}
155
 
156
if (!empty($block3herotitle)) {
157
    echo '<h3 class="rui-hero-title ' .
158
        $block3titlecolorclass .
159
        $block3titleweightclass .
160
        $block3herotitlesizeclass .
161
        '">' .
162
        $block3herotitle .
163
        '</h3>';
164
}
165
 
166
if (!empty($block3herocaption)) {
167
    echo '<div class="rui-hero-desc ' .
168
        $block3titlecolorclass .
169
        '">' . $block3herocaption . '</div>';
170
}
171
 
172
if (!empty($block3herocaption) || !empty($block3herotitle)) {
173
    echo '</div>';
174
}
175
 
176
echo '<img class="d-flex img-fluid w-100" src="' . $block3heroimg . '" alt="' . $block3herotitle . '" />';
177
echo '</div>';
178
 
179
echo $block3html;
180
if (!empty($block3footer)) {
181
    echo '<div class="rui-block-footer wrapper-fw">' . $block3footer . '</div>';
182
}
183
echo '</div>';
184
if (theme_universe_get_setting("displayhrblock3") == '1') {
185
    echo '<hr class="rui-block-hr" />';
186
}
187
echo '<!-- End Block 3 -->';
188
 
189
echo '<script>function reportWindowSize(){for(var e=document.getElementsByClassName("rui-hero-content--img"),
190
    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)"}}
191
    window.addEventListener("resize",reportWindowSize),window.onload=reportWindowSize();</script>';