mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-71610 theme_boost: remove edit button from Boost
This commit is contained in:
parent
09f6ce9fed
commit
a0bb51622c
12 changed files with 22 additions and 9 deletions
|
@ -75,7 +75,7 @@ if ($PAGE->user_allowed_editing() && $adminediting != -1) {
|
||||||
$USER->editing = $adminediting;
|
$USER->editing = $adminediting;
|
||||||
}
|
}
|
||||||
$buttons = null;
|
$buttons = null;
|
||||||
if ($PAGE->user_allowed_editing()) {
|
if ($PAGE->user_allowed_editing() && !$PAGE->theme->haseditswitch) {
|
||||||
$url = clone($PAGE->url);
|
$url = clone($PAGE->url);
|
||||||
if ($PAGE->user_is_editing()) {
|
if ($PAGE->user_is_editing()) {
|
||||||
$caption = get_string('blockseditoff');
|
$caption = get_string('blockseditoff');
|
||||||
|
|
|
@ -101,7 +101,7 @@ if (empty($SITE->fullname)) {
|
||||||
echo $OUTPUT->render_from_template('core_admin/settings', $context);
|
echo $OUTPUT->render_from_template('core_admin/settings', $context);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if ($PAGE->user_allowed_editing()) {
|
if ($PAGE->user_allowed_editing() && !$PAGE->theme->haseditswitch) {
|
||||||
$url = clone($PAGE->url);
|
$url = clone($PAGE->url);
|
||||||
if ($PAGE->user_is_editing()) {
|
if ($PAGE->user_is_editing()) {
|
||||||
$caption = get_string('blockseditoff');
|
$caption = get_string('blockseditoff');
|
||||||
|
|
|
@ -8836,7 +8836,7 @@ function admin_externalpage_setup($section, $extrabutton = '', array $extraurlpa
|
||||||
|
|
||||||
$visiblepathtosection = array_reverse($extpage->visiblepath);
|
$visiblepathtosection = array_reverse($extpage->visiblepath);
|
||||||
|
|
||||||
if ($PAGE->user_allowed_editing()) {
|
if ($PAGE->user_allowed_editing() && !$PAGE->theme->haseditswitch) {
|
||||||
if ($PAGE->user_is_editing()) {
|
if ($PAGE->user_is_editing()) {
|
||||||
$caption = get_string('blockseditoff');
|
$caption = get_string('blockseditoff');
|
||||||
$url = new moodle_url($PAGE->url, array('adminedit'=>'0', 'sesskey'=>sesskey()));
|
$url = new moodle_url($PAGE->url, array('adminedit'=>'0', 'sesskey'=>sesskey()));
|
||||||
|
|
|
@ -5434,7 +5434,7 @@ class settings_navigation extends navigation_node {
|
||||||
}
|
}
|
||||||
$frontpage->id = 'frontpagesettings';
|
$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
|
// Add the turn on/off settings
|
||||||
$url = new moodle_url('/course/view.php', array('id'=>$course->id, 'sesskey'=>sesskey()));
|
$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',
|
'rendererfactory', 'csspostprocess', 'editor_sheets', 'editor_scss', 'rarrow', 'larrow', 'uarrow', 'darrow',
|
||||||
'hidefromselector', 'doctype', 'yuicssmodules', 'blockrtlmanipulations', 'blockrendermethod',
|
'hidefromselector', 'doctype', 'yuicssmodules', 'blockrtlmanipulations', 'blockrendermethod',
|
||||||
'scss', 'extrascsscallback', 'prescsscallback', 'csstreepostprocessor', 'addblockposition',
|
'scss', 'extrascsscallback', 'prescsscallback', 'csstreepostprocessor', 'addblockposition',
|
||||||
'iconsystem', 'precompiledcsscallback');
|
'iconsystem', 'precompiledcsscallback', 'haseditswitch');
|
||||||
|
|
||||||
foreach ($config as $key=>$value) {
|
foreach ($config as $key=>$value) {
|
||||||
if (in_array($key, $configurable)) {
|
if (in_array($key, $configurable)) {
|
||||||
|
|
|
@ -346,8 +346,10 @@ 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()));
|
$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);
|
$editnode = navigation_node::create($string, $url, navigation_node::TYPE_SETTING);
|
||||||
$booknode->add_node($editnode, $firstkey);
|
$booknode->add_node($editnode, $firstkey);
|
||||||
|
if (!$PAGE->theme->haseditswitch) {
|
||||||
$PAGE->set_button($OUTPUT->single_button($url, $string));
|
$PAGE->set_button($OUTPUT->single_button($url, $string));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$plugins = core_component::get_plugin_list('booktool');
|
$plugins = core_component::get_plugin_list('booktool');
|
||||||
foreach ($plugins as $plugin => $dir) {
|
foreach ($plugins as $plugin => $dir) {
|
||||||
|
|
|
@ -231,7 +231,7 @@
|
||||||
// The code will be much nicer than this eventually.
|
// The code will be much nicer than this eventually.
|
||||||
$title = $courseshortname.': ' . format_string($data->name);
|
$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
|
// Change URL parameter and block display string value depending on whether editing is enabled or not
|
||||||
if ($PAGE->user_is_editing()) {
|
if ($PAGE->user_is_editing()) {
|
||||||
$urlediting = 'off';
|
$urlediting = 'off';
|
||||||
|
|
|
@ -155,7 +155,10 @@ if (empty($CFG->forcedefaultmymoodle) && $PAGE->user_allowed_editing()) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$url = new moodle_url("$CFG->wwwroot/my/index.php", $params);
|
$url = new moodle_url("$CFG->wwwroot/my/index.php", $params);
|
||||||
|
$button = '';
|
||||||
|
if (!$PAGE->theme->haseditswitch) {
|
||||||
$button = $OUTPUT->single_button($url, $editstring);
|
$button = $OUTPUT->single_button($url, $editstring);
|
||||||
|
}
|
||||||
$PAGE->set_button($resetbutton . $button);
|
$PAGE->set_button($resetbutton . $button);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -32,6 +32,9 @@ defined('MOODLE_INTERNAL') || die;
|
||||||
class core_renderer extends \core_renderer {
|
class core_renderer extends \core_renderer {
|
||||||
|
|
||||||
public function edit_button(moodle_url $url) {
|
public function edit_button(moodle_url $url) {
|
||||||
|
if ($this->page->theme->haseditswitch) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
$url->param('sesskey', sesskey());
|
$url->param('sesskey', sesskey());
|
||||||
if ($this->page->user_is_editing()) {
|
if ($this->page->user_is_editing()) {
|
||||||
$url->param('edit', 'off');
|
$url->param('edit', 'off');
|
||||||
|
|
|
@ -157,3 +157,4 @@ $THEME->rendererfactory = 'theme_overridden_renderer_factory';
|
||||||
$THEME->requiredblocks = '';
|
$THEME->requiredblocks = '';
|
||||||
$THEME->addblockposition = BLOCK_ADDBLOCK_POSITION_FLATNAV;
|
$THEME->addblockposition = BLOCK_ADDBLOCK_POSITION_FLATNAV;
|
||||||
$THEME->iconsystem = \core\output\icon_system::FONTAWESOME;
|
$THEME->iconsystem = \core\output\icon_system::FONTAWESOME;
|
||||||
|
$THEME->haseditswitch = true;
|
||||||
|
|
|
@ -157,3 +157,4 @@ $THEME->scss = function($theme) {
|
||||||
};
|
};
|
||||||
$THEME->usefallback = true;
|
$THEME->usefallback = true;
|
||||||
$THEME->iconsystem = '\\theme_classic\\output\\icon_system_fontawesome';
|
$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);
|
$url = new moodle_url("$CFG->wwwroot/user/profile.php", $params);
|
||||||
|
$button = '';
|
||||||
|
if (!$PAGE->theme->haseditswitch) {
|
||||||
$button = $OUTPUT->single_button($url, $editstring);
|
$button = $OUTPUT->single_button($url, $editstring);
|
||||||
|
}
|
||||||
$PAGE->set_button($resetbutton . $button);
|
$PAGE->set_button($resetbutton . $button);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue