MDL-72287 theme_boost: Remove 'My courses' navbar item in module context

This commit is contained in:
Mihail Geshoski 2021-12-02 12:39:41 +08:00
parent e00da7e884
commit 8b8b037ec1

View File

@ -58,6 +58,11 @@ class boostnavbar implements \renderable {
$this->remove('myhome'); // Dashboard.
$this->remove('home');
// Remove 'My courses' if we are in the module context.
if ($this->page->context->contextlevel == CONTEXT_MODULE) {
$this->remove('mycourses');
}
if (!is_null($this->get_item('root'))) { // We are in site administration.
// Remove the 'Site administration' navbar node as it already exists in the primary navigation menu.
$this->remove('root');