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 2023 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 - Settings.
29
$block20introsubtitle = format_text(theme_universe_get_setting('block20introsubtitle'), FORMAT_HTML, array('noclean' => true));
30
$block20titlecolor = theme_universe_get_setting('block20titlecolor');
31
$block20titlesize = theme_universe_get_setting('block20titlesize');
32
$block20titleweight = theme_universe_get_setting('block20titleweight');
33
 
34
$block20introtitle = format_text(theme_universe_get_setting('block20introtitle'), FORMAT_HTML, array('noclean' => true));
35
$block20introcontent = format_text(theme_universe_get_setting('block20introcontent'), FORMAT_HTML, array('noclean' => true));
36
$block20html = format_text(theme_universe_get_setting('block20htmlcontent'), FORMAT_HTML, array('noclean' => true));
37
$block20footer = format_text(theme_universe_get_setting('block20footercontent'), FORMAT_HTML, array('noclean' => true));
38
$block20css = theme_universe_get_setting('block20customcss');
39
$block20img = $PAGE->theme->setting_file_url("block20bg", "block20bg");
40
$block20textalign = theme_universe_get_setting('block20textalign');
41
$block20class = theme_universe_get_setting('block20class');
42
 
43
// Start Title - Color.
44
$block20titlecolorclass = null;
45
if ($block20titlecolor == 0) {
46
    $block20titlecolorclass = ' rui-text--white';
47
}
48
 
49
if ($block20titlecolor == 1) {
50
    $block20titlecolorclass = ' rui-text--black';
51
}
52
 
53
if ($block20titlecolor == 2) {
54
    $block20titlecolorclass = ' rui-text--gradient';
55
}
56
// End.
57
 
58
// Start Title - Weight.
59
$block20titleweightclass = null;
60
if ($block20titleweight == 0) {
61
    $block20titleweightclass = ' rui-text--weight-normal';
62
}
63
 
64
if ($block20titleweight == 1) {
65
    $block20titleweightclass = ' rui-text--weight-medium';
66
}
67
 
68
if ($block20titleweight == 2) {
69
    $block20titleweightclass = ' rui-text--weight-bold';
70
}
71
// End.
72
 
73
// Start Title - Size.
74
$block20titlesizeclass = null;
75
if ($block20titlesize == 1) {
76
    $block20titlesizeclass = '';
77
}
78
 
79
if ($block20titlesize == 1) {
80
    $block20titlesizeclass = ' rui-hero-title-lg';
81
}
82
 
83
if ($block20titlesize == 2) {
84
    $block20titlesizeclass = ' rui-hero-title-xl';
85
}
86
// End.
87
 
88
$block20customcss = '';
89
$custombg = '';
90
 
91
if (!empty($block20css)) {
92
    $block20customcss = $block20css;
93
}
94
 
95
// Customm ID for the block.
96
$block20customid = theme_universe_get_setting('block20id');
97
$fpblockid20 = 'block20';
98
if (!empty($block20customid)) {
99
    $fpblockid20 = $block20customid;
100
}
101
// End.
102
 
103
if (!empty($block20img)) {
104
    $custombg = ' background-image: url(' . $block20img . '); ';
105
}
106
 
107
echo '<!-- Start Block 20 -->';
108
echo '<div id="' . $fpblockid20 . '" class="wrapper-lg rui-block-margin-top rui-fp-block--20 rui-rounded--lg d-flex align-items-center ' .
109
        $block20class . '" style="' . $block20customcss . $custombg .'">';
110
echo '<div class="rui-cta-wrapper--' .
111
            $block20textalign .
112
            ' text-' .
113
            $block20textalign .
114
            '">';
115
 
116
if (!empty($block20introtitle)) {
117
    echo '<h4 class="rui-cta-subtitle' .
118
        $block20titlecolorclass .
119
        $block20titleweightclass .
120
        '">' .
121
        $block20introsubtitle .
122
        '</h4>';
123
}
124
 
125
if (!empty($block20introtitle)) {
126
    echo '<h3 class="rui-cta-title' .
127
        $block20titlecolorclass .
128
        $block20titleweightclass .
129
        $block20titlesizeclass .
130
        '">' .
131
        $block20introtitle .
132
        '</h3>';
133
}
134
 
135
if (!empty($block20introcontent)) {
136
    echo '<div class="rui-cta-content' .
137
        $block20titlecolorclass .
138
        '">' .
139
        $block20introcontent .
140
        '</div>';
141
}
142
 
143
echo $block20html;
144
 
145
if (!empty($block20footer)) {
146
    echo '<div class="rui-cta-small">' . $block20footer . '</div>';
147
}
148
 
149
echo '</div>';
150
echo '</div>';
151
if (theme_universe_get_setting("displayhrblock20") == '1') {
152
    echo '<hr class="rui-block-hr" />';
153
}
154
echo '<!-- End Block 20 -->';