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
$block2wrapperalign = theme_universe_get_setting('block2wrapperalign');
30
$block2titlecolor = theme_universe_get_setting('block2herotitlecolor');
31
$block2herotitlesize = theme_universe_get_setting('block2herotitlesize');
32
$block2titleweight = theme_universe_get_setting('block2herotitleweight');
33
$block2count = theme_universe_get_setting('block2count');
34
$block2class = theme_universe_get_setting('block2class');
35
$block2introtitle = format_text(theme_universe_get_setting('block2introtitle'), FORMAT_HTML, array('noclean' => true));
36
$block2introcontent = format_text(theme_universe_get_setting('block2introcontent'), FORMAT_HTML, array('noclean' => true));
37
$block2html = format_text(theme_universe_get_setting('block2htmlcontent'), FORMAT_HTML, array('noclean' => true));
38
$block2footer = format_text(theme_universe_get_setting('block2footercontent'), FORMAT_HTML, array('noclean' => true));
39
 
40
$block2introsubtitle = format_text(theme_universe_get_setting('block2introsubtitle'), FORMAT_HTML, array('noclean' => true));
41
$block2herotitle = format_text(theme_universe_get_setting("block2herotitle"), FORMAT_HTML, array('noclean' => true));
42
$block2herocaption = format_text(theme_universe_get_setting("block2herocaption"), FORMAT_HTML, array('noclean' => true));
43
$block2herocss = theme_universe_get_setting("block2herocss");
44
$block2heroimg = $PAGE->theme->setting_file_url("block2videoposter", "block2videoposter");
45
$block2heromp4 = $PAGE->theme->setting_file_url("block2videomp4", "block2videomp4");
46
$block2herowebm = $PAGE->theme->setting_file_url("block2videowebm", "block2videowebm");
47
 
48
// Customm ID for the block.
49
$block2customid = theme_universe_get_setting('block2id');
50
$fpblockid2 = 'block2';
51
if (!empty($block2customid)) {
52
    $fpblockid5 = $block2customid;
53
}
54
// End.
55
 
56
// Start Title - Alignment.
57
$block2wrapperalignclass = null;
58
if ($block2wrapperalign == 0) {
59
    $block2wrapperalignclass = 'rui-hero-content-left';
60
}
61
 
62
if ($block2wrapperalign == 1) {
63
    $block2wrapperalignclass = 'rui-hero-content-centered';
64
}
65
 
66
if ($block2wrapperalign == 2) {
67
    $block2wrapperalignclass = 'rui-hero-content-right';
68
}
69
// End.
70
 
71
// Start Title - Color.
72
$block2titlecolorclass = null;
73
if ($block2titlecolor == 0) {
74
    $block2titlecolorclass = ' rui-text--white';
75
}
76
 
77
if ($block2titlecolor == 1) {
78
    $block2titlecolorclass = ' rui-text--black';
79
}
80
 
81
if ($block2titlecolor == 2) {
82
    $block2titlecolorclass = ' rui-text--gradient';
83
}
84
// End.
85
 
86
// Start Title - Weight.
87
$block2titleweightclass = null;
88
if ($block2titleweight == 0) {
89
    $block2titleweightclass = ' rui-text--weight-normal';
90
}
91
 
92
if ($block2titleweight == 1) {
93
    $block2titleweightclass = ' rui-text--weight-medium';
94
}
95
 
96
if ($block2titleweight == 2) {
97
    $block2titleweightclass = ' rui-text--weight-bold';
98
}
99
// End.
100
 
101
// Start Title - Size.
102
$block2herotitlesizeclass = null;
103
if ($block2herotitlesize == 1) {
104
    $block2herotitlesizeclass = '';
105
}
106
 
107
if ($block2herotitlesize == 1) {
108
    $block2herotitlesizeclass = ' rui-hero-title-lg';
109
}
110
 
111
if ($block2herotitlesize == 2) {
112
    $block2herotitlesizeclass = ' rui-hero-title-xl';
113
}
114
// End.
115
 
116
if (theme_universe_get_setting('showblock2wrapper') == '1') {
117
    $block2heroclass = 'rui-hero-content-backdrop rui-hero-content-backdrop--block2';
118
} else {
119
    $block2heroclass = '';
120
}
121
echo '<!-- Start Block #2 -->';
122
 
123
 
124
if (theme_universe_get_setting('block2fw') == '1') {
125
    echo '<div id="' . $fpblockid2 . '" class="wrapper-fw rui-fp-block--2 rui-fp-margin-bottom ' . $block2class . '">';
126
} else {
127
    echo '<div id="' . $fpblockid2 . '" class="wrapper-lg rui-fp-block--2 rui-fp-margin-bottom ' . $block2class . '">';
128
}
129
 
130
if (!empty($block2introtitle) || !empty($block2introcontent)) {
131
    echo '<div class="wrapper-sm rui-fp-block-mb">';
132
}
133
if (!empty($block2introsubtitle)) {
134
    echo '<h4 class="rui-block-subtitle">' . $block2introsubtitle . '</h4>';
135
}
136
if (!empty($block2introtitle)) {
137
    echo '<h3 class="rui-block-title' .
138
        $block2titlecolorclass .
139
        $block2titleweightclass .
140
        $block2herotitlesizeclass .
141
        '">' .
142
        $block2introtitle .
143
        '</h3>';
144
}
145
if (!empty($block2introcontent)) {
146
    echo '<div class="rui-block-desc">' . $block2introcontent . '</div>';
147
}
148
if (!empty($block2introtitle) || !empty($block2introcontent)) {
149
    echo '</div>';
150
}
151
 
152
echo '<div class="rui-hero-video">';
153
 
154
if (!empty($block2herocaption) || !empty($block2herotitle)) {
155
    echo '<div class="rui-hero-content rui-hero-content--video ' .
156
    $block2heroclass .
157
    ' rui-hero-content-position ' .
158
    $block2wrapperalignclass .
159
    '">';
160
}
161
 
162
if (!empty($block2herotitle)) {
163
    echo '<h3 class="rui-hero-title ' .
164
        $block2titlecolorclass .
165
        $block2titleweightclass .
166
        $block2herotitlesizeclass .
167
        '">' .
168
        $block2herotitle .
169
        '</h3>';
170
}
171
 
172
if (!empty($block2herocaption)) {
173
    echo '<div class="rui-hero-desc '.
174
    $block2titlecolorclass .
175
    '">' . $block2herocaption . '</div>';
176
}
177
 
178
if (!empty($block2herocaption) || !empty($block2herotitle)) {
179
    echo '</div>';
180
}
181
 
182
echo '</div>';
183
 
184
echo $block2html;
185
if (!empty($block2footer)) {
186
    echo '<div class="rui-block-footer wrapper-fw">' . $block2footer . '</div>';
187
}
188
echo '</div>';
189
if (theme_universe_get_setting("displayhrblock2") == '1') {
190
    echo '<hr class="rui-block-hr" />';
191
}
192
echo '<!-- End Block #2 -->';
193
 
194
echo '<script src="theme/universe/addons/vidbg/vidbg.js"></script>';
195
echo "<script>var instance = new vidbg('.rui-hero-video',
196
{mp4: '" . $block2heromp4 . "',webm: '" . $block2herowebm . "',poster: '" . $block2heroimg . "',})</script>";
197
echo '<script>function reportWindowSize(){for(var e=document.getElementsByClassName("rui-hero-content--video"),
198
    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)"}}
199
    window.addEventListener("resize",reportWindowSize),window.onload=reportWindowSize();</script>';