-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlib.php
More file actions
executable file
·71 lines (59 loc) · 2.78 KB
/
Copy pathlib.php
File metadata and controls
executable file
·71 lines (59 loc) · 2.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
// This file is part of Moodle - https://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <https://www.gnu.org/licenses/>.
/**
* Plugin administration pages are defined here.
*
* @package local_imprint
* @category admin
* @copyright 2023-24 Andreas Koch
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Add imprint to footer
*/
function local_imprint_show_imprint(): void {
global $PAGE;
$excludepages = ['admin', 'embedded', 'frametop', 'maintenance', 'popup',
'print', 'redirect', 'report'];
if (!in_array($PAGE->pagelayout, $excludepages)) { // Do not show on pages that may use $OUTPUT.
$settings = ['link1', 'link2', 'publisher', 'vidsp', 'dsb'];
$show = false;
foreach ($settings as $setting) {
if (trim(get_config('local_imprint', $setting)) != '') {
$show = true;
break;
}
}
if (get_config('local_imprint', 'enabled') == 'yes' && $show) {
echo '<div class="local_imprint" style="';
echo str_replace('"', '\"', get_config('local_imprint', 'css')) . '">';
echo '<div class="links"><a href="' . get_config('local_imprint', 'link1');
echo '" target="_blank">' . get_string('link1_text', 'local_imprint') . '</a> | ';
echo '<a href="' . get_config('local_imprint', 'link2');
echo '" target="_blank">' . get_string('link2_text', 'local_imprint') . '</a></div>';
echo '<div class="publisher">' . get_string('publisher_text', 'local_imprint');
echo ': ' . get_config('local_imprint', 'publisher') . '</div>';
echo '<div class="vidsp">' . get_string('vidsp_text', 'local_imprint');
echo ': ' . get_config('local_imprint', 'vidsp') . '</div>';
echo '<div class="dsb">' . get_string('dpo_text', 'local_imprint');
echo ': ' . get_config('local_imprint', 'dpo') . '</div>';
echo '</div>';
echo '<style>@media only screen and (max-device-width: 1000px) { .local_imprint { ';
echo str_replace('"', '\"', get_config('local_imprint', 'css_mobile'));
echo '} } } </style>';
}
}
}