Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | 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
 * A one column layout for the universe theme.
19
 *
20
 * @package   theme_universe
21
 * @copyright 2023 Marcin Czaja (https://rosea.io)
22
 * @license   Commercial https://themeforest.net/licenses
23
 */
24
 
25
defined('MOODLE_INTERNAL') || die();
26
 
27
$extraclasses = [];
28
 
29
// Dark mode.
1441 ariadna 30
switch (theme_universe_get_setting('darkmodetheme')) {
31
    case '1':
32
        $darkmodeon = get_user_preferences('darkmode-on', 'false') == 'true';
33
        if ($darkmodeon) {
34
            $extraclasses[] = 'theme-dark';
35
        }
36
        $darkmodetheme = true;
37
        break;
38
    default:
39
        $darkmodeon = false;
40
        break;
1 efrain 41
}
42
 
43
if (theme_universe_get_setting('darkmodefirst') == '1') {
44
    $extraclasses[] = 'theme-dark';
45
    $darkmodetheme = false;
46
}
47
$bodyattributes = $OUTPUT->body_attributes($extraclasses);
48
$siteurl = $CFG->wwwroot;
49
$templatecontext = [
50
    'sitename' => format_string($SITE->shortname, true, ['context' => context_course::instance(SITEID), "escape" => false]),
51
    'output' => $OUTPUT,
52
    'bodyattributes' => $bodyattributes,
53
    'darkmodeon' => !empty($darkmodeon),
54
    'darkmodetheme' => !empty($darkmodetheme),
55
    'siteurl' => $siteurl
56
];
57
 
58
// Load theme settings.
59
$themesettings = new \theme_universe\util\theme_settings();
60
$templatecontext = array_merge($templatecontext, $themesettings->global_settings());
61
 
62
echo $OUTPUT->render_from_template('theme_universe/tmpl-popup', $templatecontext);