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