Proyectos de Subversion Moodle

Rev

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

Rev 542 Rev 543
Línea 26... Línea 26...
26
 
26
 
Línea 27... Línea 27...
27
require_once($CFG->libdir . '/behat/lib.php');
27
require_once($CFG->libdir . '/behat/lib.php');
28
 
28
 
29
$draweropenright = false;
-
 
30
$extraclasses = [];
29
$draweropenright = false;
31
 
30
$extraclasses = [];
32
// Moodle 4. - Add block button in editing mode.
31
// Moodle 4. - Add block button in editing mode.
33
$addblockbutton = $OUTPUT->addblockbutton();
32
$addblockbutton = $OUTPUT->addblockbutton();
34
if (isloggedin()) {
33
if (isloggedin()) {
Línea 45... Línea 44...
45
// End.
44
// End.
Línea 46... Línea 45...
46
 
45
 
47
// Dark mode.
46
// Dark mode.
48
if (isloggedin()) {
47
if (isloggedin()) {
49
    $navdraweropen = get_user_preferences('drawer-open-nav', true);
48
    $navdraweropen = get_user_preferences('drawer-open-nav', true);
Línea 50... Línea 49...
50
    $draweropenright = get_user_preferences('sidepre-open', true);
49
    $draweropenright = (get_user_preferences('sidepre-open', 'true') == 'true');
51
 
50
 
52
    if (theme_universe_get_setting('darkmodetheme') == '1') {
51
    if (theme_universe_get_setting('darkmodetheme') == '1') {
53
        $darkmodeon = get_user_preferences('darkmode-on');
52
        $darkmodeon = get_user_preferences('darkmode-on');
54
        if ($darkmodeon) {
53
        if ($darkmodeon) {
55
            $extraclasses[] = 'theme-dark';
-
 
56
        }
54
            $extraclasses[] = 'theme-dark';
57
        $darkmodetheme = true;
55
        }
58
    } else {
56
    } else {
59
        $darkmodeon = false;
57
        $darkmodeon = false;
60
    }
58
    }
Línea 74... Línea 72...
74
$hasblocks = (strpos($blockshtml, 'data-block=') !== false || !empty($addblockbutton));
72
$hasblocks = (strpos($blockshtml, 'data-block=') !== false || !empty($addblockbutton));
75
if (!$hasblocks) {
73
if (!$hasblocks) {
76
    $blockdraweropen = false;
74
    $blockdraweropen = false;
77
}
75
}
Línea 78... Línea -...
78
 
-
 
79
$sidecourseblocks = $OUTPUT->blocks('sidecourseblocks');
-
 
80
$hassidecourseblocks = strpos($sidecourseblocks, 'data-block=') !== false;
-
 
81
 
76
 
82
if ($draweropenright && $hasblocks) {
77
if ($draweropenright && $hasblocks) {
83
    $extraclasses[] = 'drawer-open-right';
78
    $extraclasses[] = 'drawer-open-right';
Línea 84... Línea 79...
84
}
79
}
Línea 105... Línea 100...
105
}
100
}
Línea 106... Línea 101...
106
 
101
 
107
$primary = new core\navigation\output\primary($PAGE);
102
$primary = new core\navigation\output\primary($PAGE);
108
$renderer = $PAGE->get_renderer('core');
103
$renderer = $PAGE->get_renderer('core');
109
$primarymenu = $primary->export_for_template($renderer);
104
$primarymenu = $primary->export_for_template($renderer);
110
$buildregionmainsettings = !$PAGE->include_region_main_settings_in_header_actions()
-
 
111
    && !$PAGE->has_secondary_navigation();
105
$buildregionmainsettings = !$PAGE->include_region_main_settings_in_header_actions() && !$PAGE->has_secondary_navigation();
112
// If the settings menu will be included in the header then don't add it here.
106
// If the settings menu will be included in the header then don't add it here.
Línea 113... Línea 107...
113
$regionmainsettingsmenu = $buildregionmainsettings ? $OUTPUT->region_main_settings_menu() : false;
107
$regionmainsettingsmenu = $buildregionmainsettings ? $OUTPUT->region_main_settings_menu() : false;
114
 
108
 
Línea 115... Línea -...
115
$header = $PAGE->activityheader;
-
 
116
$headercontent = $header->export_for_template($renderer);
-
 
117
 
-
 
118
if ($hassidecourseblocks) {
-
 
119
    $extraclasses[] = 'page-has-blocks';
109
$header = $PAGE->activityheader;
120
}
110
$headercontent = $header->export_for_template($renderer);
121
 
111
 
122
if (!isloggedin() || isguestuser()) {
112
if (!isloggedin() || isguestuser()) {
123
    $isnotloggedin = true;
113
    $isnotloggedin = true;
Línea 132... Línea 122...
132
 
122
 
133
if (theme_universe_get_setting('backtotop') == '1') {
123
if (theme_universe_get_setting('backtotop') == '1') {
134
    $extraclasses[] = 'back-to-top-on';
124
    $extraclasses[] = 'back-to-top-on';
Línea -... Línea 125...
-
 
125
}
-
 
126
 
-
 
127
// Sideblocks
-
 
128
$sidecourseblocks = $OUTPUT->blocks('sidecourseblocks');
-
 
129
$hassidecourseblocks = strpos($sidecourseblocks, 'data-block=') !== false;
-
 
130
 
-
 
131
if ($hassidecourseblocks) {
-
 
132
    $extraclasses[] = 'page-has-blocks';
135
}
133
}
Línea 136... Línea 134...
136
 
134
 
137
$bodyattributes = $OUTPUT->body_attributes($extraclasses);
-
 
138
 
-
 
139
$templatecontext = [
-
 
140
    'sitename' => format_string(
135
$bodyattributes = $OUTPUT->body_attributes($extraclasses);
141
        $SITE->shortname,
-
 
142
        true,
136
 
143
        ['context' => context_course::instance(SITEID), "escape" => false]
137
$templatecontext = [
144
    ),
138
    'sitename' => format_string($SITE->shortname, true, ['context' => context_course::instance(SITEID), "escape" => false]),
145
    'output' => $OUTPUT,
139
    'output' => $OUTPUT,
146
    'bodyattributes' => $bodyattributes,
140
    'bodyattributes' => $bodyattributes,
Línea 181... Línea 175...
181
// Load theme settings.
175
// Load theme settings.
182
$themesettings = new \theme_universe\util\theme_settings();
176
$themesettings = new \theme_universe\util\theme_settings();
Línea 183... Línea 177...
183
 
177
 
Línea 184... Línea 178...
184
$templatecontext = array_merge($templatecontext, $themesettings->global_settings());
178
$templatecontext = array_merge($templatecontext, $themesettings->global_settings());
185
 
179
 
186
$PAGE->requires->js_call_amd('theme_universe-child/rui', 'init');
180
$PAGE->requires->js_call_amd('theme_universe_child/rui', 'init');
187
if (theme_universe_get_setting('backtotop') == '1') {
181
if (theme_universe_get_setting('backtotop') == '1') {
Línea 188... Línea 182...
188
    $PAGE->requires->js_call_amd('theme_universe_child/backtotop', 'init');
182
    $PAGE->requires->js_call_amd('theme_universe_child/backtotop', 'init');