Commit a5aea165 authored by gavgeris's avatar gavgeris
Browse files

- More fixes for showing sidebar and Book Chapters on Editing Mode

parent fc043143
......@@ -180,6 +180,6 @@ $THEME->prescsscallback = 'theme_howto_get_pre_scss';
$THEME->precompiledcsscallback = 'theme_howto_get_precompiled_css';
$THEME->yuicssmodules = array();
$THEME->rendererfactory = 'theme_overridden_renderer_factory';
$THEME->requiredblocks = ['navigation'];
$THEME->requiredblocks = [];
$THEME->addblockposition = BLOCK_ADDBLOCK_POSITION_FLATNAV;
//$THEME->iconsystem = \core\output\icon_system::FONTAWESOME;
......@@ -27,27 +27,32 @@ defined('MOODLE_INTERNAL') || die();
user_preference_allow_ajax_update('drawer-open-nav', PARAM_ALPHA);
require_once($CFG->libdir . '/behat/lib.php');
if (isloggedin()) {
//$navdraweropen = (get_user_preferences('drawer-open-nav', 'true') == 'true');
$navdraweropen = false;
} else {
$navdraweropen = false;
}
//if (isloggedin()) {
// //$navdraweropen = (get_user_preferences('drawer-open-nav', 'true') == 'true');
// $navdraweropen = false;
//} else {
// $navdraweropen = false;
//}
// Add block button in editing mode.
//$addblockbutton = $OUTPUT->addblockbutton();
$addblockbutton = $OUTPUT->addblockbutton();
$extraclasses = [];
if ($navdraweropen) {
$extraclasses[] = 'drawer-open-left';
}
//if ($navdraweropen) {
// $extraclasses[] = 'drawer-open-left';
//}
$bodyattributes = $OUTPUT->body_attributes($extraclasses);
$blockshtml = $OUTPUT->blocks('side-pre');
//$hasblocks = (strpos($blockshtml, 'data-block=') !== false || !empty($addblockbutton));
if (($PAGE->context->contextlevel == CONTEXT_COURSE) || $PAGE->user_is_editing())
$hasblocks = (strpos($blockshtml, 'data-block=') !== false || !empty($addblockbutton));
else
$hasblocks = false;
$secondarynavigation = false;
$addblockbutton = false;
$overflow = '';
// Try to include all settings on action button above breadcrumb and hide tha tab bar.
// Try to include all settings on action button above breadcrumb and hide the Moodle 4.0 tab bar.
$PAGE->set_secondary_navigation(false);
$PAGE->force_settings_menu(true);
$PAGE->set_include_region_main_settings_in_header_actions(true);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment