mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 12:40:01 +01:00
MDL-73373 navigation: Fix breadcrumbs when within a course.
Disable the mycourses node from showing up in the breadcrumbs if it is set as the default homepage
This commit is contained in:
parent
9170025088
commit
2bbc664302
@ -1339,7 +1339,8 @@ class global_navigation extends navigation_node {
|
||||
// courses: Additional courses are added here.
|
||||
// users: Other users information loaded here.
|
||||
$this->rootnodes = array();
|
||||
if (get_home_page() == HOMEPAGE_SITE) {
|
||||
$defaulthomepage = get_home_page();
|
||||
if ($defaulthomepage == HOMEPAGE_SITE) {
|
||||
// The home element should be my moodle because the root element is the site
|
||||
if (isloggedin() && !isguestuser()) { // Makes no sense if you aren't logged in
|
||||
$this->rootnodes['home'] = $this->add(get_string('myhome'), new moodle_url('/my/'),
|
||||
@ -1368,6 +1369,12 @@ class global_navigation extends navigation_node {
|
||||
'mycourses',
|
||||
new pix_icon('i/course', '')
|
||||
);
|
||||
// We do not need to show this node in the breadcrumbs if the default homepage is mycourses.
|
||||
// It will be automatically handled by the breadcrumb generator.
|
||||
if ($defaulthomepage == HOMEPAGE_MYCOURSES) {
|
||||
$this->rootnodes['mycourses']->mainnavonly = true;
|
||||
}
|
||||
|
||||
$this->rootnodes['courses'] = $this->add(get_string('courses'), new moodle_url('/course/index.php'), self::TYPE_ROOTNODE, null, 'courses');
|
||||
if (!core_course_category::user_top()) {
|
||||
$this->rootnodes['courses']->hide();
|
||||
|
Loading…
x
Reference in New Issue
Block a user