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