Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 16... Línea 16...
16
 
16
 
17
/**
17
/**
18
 * A secure layout for the universe theme.
18
 * A secure layout for the universe theme.
19
 *
19
 *
20
 * @package   theme_universe
20
 * @package   theme_universe
21
 * @copyright 2023 Marcin Czaja (https://rosea.io)
21
 * @copyright 2022 - 2023 Marcin Czaja (https://rosea.io)
22
 * @license   Commercial https://themeforest.net/licenses
22
 * @license   Commercial https://themeforest.net/licenses
Línea 23... Línea 23...
23
 */
23
 */
Línea 24... Línea 24...
24
 
24
 
Línea 25... Línea 25...
25
defined('MOODLE_INTERNAL') || die();
25
defined('MOODLE_INTERNAL') || die();
26
 
26
 
27
$extraclasses = [];
-
 
28
 
27
$extraclasses = [];
Línea 29... Línea 28...
29
// Dark mode.
28
 
-
 
29
// Dark mode.
30
if (isloggedin()) {
30
if (isloggedin()) {
31
    $navdraweropen = (get_user_preferences('drawer-open-nav', 'true') == 'true');
31
    $draweropenright = get_user_preferences('sidepre-open', 'true') == 'true';
32
    $draweropenright = (get_user_preferences('sidepre-open', 'true') == 'true');
32
 
33
 
33
    switch (theme_universe_get_setting('darkmodetheme')) {
-
 
34
        case '1':
34
    if (theme_universe_get_setting('darkmodetheme') == '1') {
35
            $darkmodeon = get_user_preferences('darkmode-on');
35
        $darkmodeon = get_user_preferences('darkmode-on');
36
            if ($darkmodeon) {
-
 
37
                $extraclasses[] = 'theme-dark';
36
        if ($darkmodeon) {
38
            }
37
            $extraclasses[] = 'theme-dark';
-
 
38
        }
-
 
39
    } else {
39
            break;
Línea 40... Línea 40...
40
        $darkmodeon = false;
40
        default:
41
    }
41
            $darkmodeon = false;
42
} else {
42
            break;
Línea 56... Línea 56...
56
if (theme_universe_get_setting('backtotop') == '1') {
56
if (theme_universe_get_setting('backtotop') == '1') {
57
    $extraclasses[] = 'back-to-top-on';
57
    $extraclasses[] = 'back-to-top-on';
58
}
58
}
Línea 59... Línea 59...
59
 
59
 
60
$bodyattributes = $OUTPUT->body_attributes($extraclasses);
-
 
61
 
60
$bodyattributes = $OUTPUT->body_attributes($extraclasses);
62
$templatecontext = [
61
$templatecontext = [
63
    'sitename' => format_string($SITE->shortname, true, ['context' => context_course::instance(SITEID), "escape" => false]),
62
    'sitename' => format_string($SITE->shortname, true, ['context' => context_course::instance(SITEID), "escape" => false]),
64
    'output' => $OUTPUT,
63
    'output' => $OUTPUT,
65
    'sidepreblocks' => $blockshtml,
64
    'sidepreblocks' => $blockshtml,
66
    'hasblocks' => $hasblocks,
65
    'hasblocks' => $hasblocks,
67
    'bodyattributes' => $bodyattributes,
66
    'bodyattributes' => $bodyattributes,
68
    'draweropenright' => $draweropenright,
67
    'draweropenright' => $draweropenright,
69
    'darkmodeon' => !empty($darkmodeon),
68
    'darkmodeon' => !empty($darkmodeon),
70
    'darkmodetheme' => !empty($darkmodetheme),
-
 
71
    'navdraweropen' => $navdraweropen,
69
    'darkmodetheme' => !empty($darkmodetheme),
72
    'siteurl' => $siteurl
70
    'siteurl' => $siteurl
Línea 73... Línea 71...
73
];
71
];
74
 
72