Commit a0bb5162 authored by bas's avatar bas
Browse files

MDL-71610 theme_boost: remove edit button from Boost

parent 09f6ce9f
......@@ -75,7 +75,7 @@ if ($PAGE->user_allowed_editing() && $adminediting != -1) {
$USER->editing = $adminediting;
}
$buttons = null;
if ($PAGE->user_allowed_editing()) {
if ($PAGE->user_allowed_editing() && !$PAGE->theme->haseditswitch) {
$url = clone($PAGE->url);
if ($PAGE->user_is_editing()) {
$caption = get_string('blockseditoff');
......
......@@ -101,7 +101,7 @@ if (empty($SITE->fullname)) {
echo $OUTPUT->render_from_template('core_admin/settings', $context);
} else {
if ($PAGE->user_allowed_editing()) {
if ($PAGE->user_allowed_editing() && !$PAGE->theme->haseditswitch) {
$url = clone($PAGE->url);
if ($PAGE->user_is_editing()) {
$caption = get_string('blockseditoff');
......
......@@ -8836,7 +8836,7 @@ function admin_externalpage_setup($section, $extrabutton = '', array $extraurlpa
$visiblepathtosection = array_reverse($extpage->visiblepath);
if ($PAGE->user_allowed_editing()) {
if ($PAGE->user_allowed_editing() && !$PAGE->theme->haseditswitch) {
if ($PAGE->user_is_editing()) {
$caption = get_string('blockseditoff');
$url = new moodle_url($PAGE->url, array('adminedit'=>'0', 'sesskey'=>sesskey()));
......
......@@ -5434,7 +5434,7 @@ class settings_navigation extends navigation_node {
}
$frontpage->id = 'frontpagesettings';
if ($this->page->user_allowed_editing()) {
if ($this->page->user_allowed_editing() && !$this->page->theme->haseditswitch) {
// Add the turn on/off settings
$url = new moodle_url('/course/view.php', array('id'=>$course->id, 'sesskey'=>sesskey()));
......
......@@ -754,7 +754,7 @@ class theme_config {
'rendererfactory', 'csspostprocess', 'editor_sheets', 'editor_scss', 'rarrow', 'larrow', 'uarrow', 'darrow',
'hidefromselector', 'doctype', 'yuicssmodules', 'blockrtlmanipulations', 'blockrendermethod',
'scss', 'extrascsscallback', 'prescsscallback', 'csstreepostprocessor', 'addblockposition',
'iconsystem', 'precompiledcsscallback');
'iconsystem', 'precompiledcsscallback', 'haseditswitch');
foreach ($config as $key=>$value) {
if (in_array($key, $configurable)) {
......
......@@ -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');
......
......@@ -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';
......
......@@ -155,7 +155,10 @@ if (empty($CFG->forcedefaultmymoodle) && $PAGE->user_allowed_editing()) {
}
$url = new moodle_url("$CFG->wwwroot/my/index.php", $params);
$button = $OUTPUT->single_button($url, $editstring);
$button = '';
if (!$PAGE->theme->haseditswitch) {
$button = $OUTPUT->single_button($url, $editstring);
}
$PAGE->set_button($resetbutton . $button);
} else {
......
......@@ -32,6 +32,9 @@ defined('MOODLE_INTERNAL') || die;
class core_renderer extends \core_renderer {
public function edit_button(moodle_url $url) {
if ($this->page->theme->haseditswitch) {
return;
}
$url->param('sesskey', sesskey());
if ($this->page->user_is_editing()) {
$url->param('edit', 'off');
......
......@@ -157,3 +157,4 @@ $THEME->rendererfactory = 'theme_overridden_renderer_factory';
$THEME->requiredblocks = '';
$THEME->addblockposition = BLOCK_ADDBLOCK_POSITION_FLATNAV;
$THEME->iconsystem = \core\output\icon_system::FONTAWESOME;
$THEME->haseditswitch = true;
......@@ -157,3 +157,4 @@ $THEME->scss = function($theme) {
};
$THEME->usefallback = true;
$THEME->iconsystem = '\\theme_classic\\output\\icon_system_fontawesome';
$THEME->haseditswitch = false;
......@@ -184,7 +184,10 @@ if ($PAGE->user_allowed_editing()) {
}
$url = new moodle_url("$CFG->wwwroot/user/profile.php", $params);
$button = $OUTPUT->single_button($url, $editstring);
$button = '';
if (!$PAGE->theme->haseditswitch) {
$button = $OUTPUT->single_button($url, $editstring);
}
$PAGE->set_button($resetbutton . $button);
} else {
......
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