MDL-71610 theme_boost: remove edit button from Boost

This commit is contained in:
Bas Brands 2021-07-06 10:19:09 +02:00
parent 09f6ce9fed
commit a0bb51622c
12 changed files with 22 additions and 9 deletions

View file

@ -346,7 +346,9 @@ function book_extend_settings_navigation(settings_navigation $settingsnav, navig
$url = new moodle_url('/mod/book/view.php', array('id'=>$params['id'], 'chapterid'=>$params['chapterid'], 'edit'=>$edit, 'sesskey'=>sesskey()));
$editnode = navigation_node::create($string, $url, navigation_node::TYPE_SETTING);
$booknode->add_node($editnode, $firstkey);
$PAGE->set_button($OUTPUT->single_button($url, $string));
if (!$PAGE->theme->haseditswitch) {
$PAGE->set_button($OUTPUT->single_button($url, $string));
}
}
$plugins = core_component::get_plugin_list('booktool');

View file

@ -231,7 +231,7 @@
// The code will be much nicer than this eventually.
$title = $courseshortname.': ' . format_string($data->name);
if ($PAGE->user_allowed_editing()) {
if ($PAGE->user_allowed_editing() && !$PAGE->theme->haseditswitch) {
// Change URL parameter and block display string value depending on whether editing is enabled or not
if ($PAGE->user_is_editing()) {
$urlediting = 'off';