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