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 |
$block18introtitle = format_text(theme_monocolor_get_setting('block18introtitle'),
|
|
|
30 |
FORMAT_HTML,
|
|
|
31 |
array('noclean' => true));
|
|
|
32 |
$block18introcontent = format_text(theme_monocolor_get_setting('block18introcontent'),
|
|
|
33 |
FORMAT_HTML,
|
|
|
34 |
array('noclean' => true));
|
|
|
35 |
$block18html = format_text(theme_monocolor_get_setting('block18htmlcontent'),
|
|
|
36 |
FORMAT_HTML,
|
|
|
37 |
array('noclean' => true));
|
|
|
38 |
$block18footer = format_text(theme_monocolor_get_setting('block18footercontent'),
|
|
|
39 |
FORMAT_HTML,
|
|
|
40 |
array('noclean' => true));
|
|
|
41 |
$block18class = theme_monocolor_get_setting('block18class');
|
|
|
42 |
$block18css = theme_monocolor_get_setting('block18customcss');
|
|
|
43 |
|
|
|
44 |
$block18customcss = '';
|
|
|
45 |
if (!empty($block18css)) {
|
|
|
46 |
$block18customcss = ' style="' . $block18css . '"';
|
|
|
47 |
} else {
|
|
|
48 |
$block18customcss = null;
|
|
|
49 |
}
|
|
|
50 |
|
|
|
51 |
echo '<!-- Start Block 18-->';
|
|
|
52 |
echo '<div id="fpblock18" class="wrapper-xl rui-fp-block--18 ' . $block18class . '"' . $block18customcss . '>';
|
|
|
53 |
if (!empty($block18introtitle) || !empty($block18introcontent)) {
|
|
|
54 |
echo '<div class="wrapper-sm rui-fp-block-mb">';
|
|
|
55 |
}
|
|
|
56 |
if (!empty($block18introtitle)) {
|
|
|
57 |
echo '<h3 class="rui-block-title">' . $block18introtitle . '</h3>';
|
|
|
58 |
}
|
|
|
59 |
if (!empty($block18introcontent)) {
|
|
|
60 |
echo '<div class="rui-block-desc">' . $block18introcontent . '</div>';
|
|
|
61 |
}
|
|
|
62 |
if (!empty($block18introtitle) || !empty($block18introcontent)) {
|
|
|
63 |
echo '</div>';
|
|
|
64 |
}
|
|
|
65 |
|
|
|
66 |
echo '<div class="wrapper-fw">' . $block18html . '</div>';
|
|
|
67 |
|
|
|
68 |
$block18count = theme_monocolor_get_setting('block18count');
|
|
|
69 |
echo '<div class="wrapper-md mt-6">';
|
|
|
70 |
echo '<div class="accordion" id="block18Accordion">';
|
|
|
71 |
for ($i = 1; $i <= $block18count; $i++) {
|
|
|
72 |
|
|
|
73 |
$q = format_text(theme_monocolor_get_setting("block18question" . $i),
|
|
|
74 |
FORMAT_HTML, array('noclean' => true));
|
|
|
75 |
$a = format_text(theme_monocolor_get_setting("block18answer" . $i),
|
|
|
76 |
FORMAT_HTML, array('noclean' => true));
|
|
|
77 |
echo '<div class="accordion-item">';
|
|
|
78 |
echo '<h3 class="accordion-header" id="heading' .
|
|
|
79 |
$i .
|
|
|
80 |
'">';
|
|
|
81 |
echo '<button class="accordion-button collapsed"
|
|
|
82 |
type="button" data-toggle="collapse"
|
|
|
83 |
data-target="#collapse' .
|
|
|
84 |
$i .
|
|
|
85 |
'" aria-expanded="false" aria-controls="collapse' .
|
|
|
86 |
$i .
|
|
|
87 |
'">';
|
|
|
88 |
echo $q;
|
|
|
89 |
echo '</button>';
|
|
|
90 |
echo '</h3>';
|
|
|
91 |
echo '<div id="collapse' .
|
|
|
92 |
$i .
|
|
|
93 |
'" class="accordion-collapse collapse" aria-labelledby="heading' .
|
|
|
94 |
$i .
|
|
|
95 |
'" data-parent="#block18Accordion">';
|
|
|
96 |
echo '<div class="accordion-body">';
|
|
|
97 |
echo $a;
|
|
|
98 |
echo '</div>';
|
|
|
99 |
echo '</div>';
|
|
|
100 |
echo '</div>';
|
|
|
101 |
}
|
|
|
102 |
echo '</div><!-- accortion-->';
|
|
|
103 |
echo '</div><!-- wrapper-md -->';
|
|
|
104 |
|
|
|
105 |
if (!empty($block18footer)) {
|
|
|
106 |
echo '<div class="rui-block-footer wrapper-md">' . $block18footer . '</div>';
|
|
|
107 |
}
|
|
|
108 |
|
|
|
109 |
echo '</div>';
|
|
|
110 |
if (theme_monocolor_get_setting("displayhrblock18") == '1') {
|
|
|
111 |
echo '<hr class="rui-block-hr" />';
|
|
|
112 |
}
|
|
|
113 |
echo '<!-- End Block 18 -->';
|