Skip to content

Commit a94264a

Browse files
Merge pull request #105 from DigiDago/MOODLE_402_dev
Moodle 402 dev
2 parents 6d718db + 9355d7a commit a94264a

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

layout/columns2.php

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,13 @@
2929
user_preference_allow_ajax_update('drawer-open-block', PARAM_BOOL);
3030

3131
if (isloggedin()) {
32-
$courseindexopen = (get_user_preferences('drawer-open-index') == true);
33-
$blockdraweropen = (get_user_preferences('drawer-open-block') == true);
32+
$courseindexopen = (get_user_preferences('drawer-open-index'));
33+
$blockdraweropen = (get_user_preferences('drawer-open-block'));
3434
} else {
3535
$courseindexopen = false;
3636
$blockdraweropen = false;
3737
}
3838

39-
require_once($CFG->libdir . '/behat/lib.php');
4039
require_once($CFG->dirroot . '/course/lib.php');
4140

4241
$extraclasses = [];
@@ -67,7 +66,8 @@
6766
}
6867
$forceblockdraweropen = $OUTPUT->firstview_fakeblocks();
6968

70-
$buildregionmainsettings = !$PAGE->include_region_main_settings_in_header_actions() && !$PAGE->has_secondary_navigation();
69+
$buildregionmainsettings = !$PAGE->include_region_main_settings_in_header_actions()
70+
&& !$PAGE->has_secondary_navigation();
7171

7272
// If the settings menu will be included in the header then don't add it here.
7373
$regionmainsettingsmenu = $buildregionmainsettings ? $OUTPUT->region_main_settings_menu() : false;
@@ -83,7 +83,9 @@
8383
$overflow = '';
8484

8585
// Secondary navigation.
86-
if ($PAGE->has_secondary_navigation() && strpos($PAGE->bodyclasses, 'path-enrol') == false) {
86+
if ($PAGE->has_secondary_navigation() &&
87+
(!strpos($PAGE->bodyclasses, 'path-enrol')
88+
|| strpos($PAGE->bodyclasses, 'pagelayout-admin') > 0)) {
8789
$tablistnav = $PAGE->has_tablist_secondary_navigation();
8890
$customnav = new \theme_pimenko\output\core\navigation\views\secondary($PAGE);
8991
$customnav->initialise();
@@ -102,8 +104,11 @@
102104
$headercontent = $header->export_for_template($renderer);
103105

104106
$templatecontext = [
105-
'sitename' => format_string($SITE->shortname,
106-
true, ['context' => context_course::instance(SITEID), "escape" => false]),
107+
'sitename' => format_string(
108+
$SITE->shortname,
109+
true,
110+
['context' => context_course::instance(SITEID), "escape" => false]
111+
),
107112
'output' => $OUTPUT,
108113
'sidepreblocks' => $blockshtml,
109114
'hasblocks' => $hasblocks,

0 commit comments

Comments
 (0)