MDL-72838 nav: Skip redirect to Dashboard from logo link

Added homeurl ($PAGE->navigation->action) to config helpers added to mustache templates.
Changed boost and classic themes to use config.homeurl on the brand logo link.

Updated global_navigation class to set properties to correct values when
get_home_page() returns HOMEPAGE_MYCOURSES.
This commit is contained in:
Jason den Dulk
2022-01-18 17:07:33 +11:00
parent 0e188470b1
commit 91b30b4fd1
4 changed files with 20 additions and 7 deletions
+13 -3
View File
@@ -1254,8 +1254,9 @@ class global_navigation extends navigation_node {
return;
}
if (get_home_page() == HOMEPAGE_SITE) {
// We are using the site home for the root element
$homepage = get_home_page();
if ($homepage == HOMEPAGE_SITE) {
// We are using the site home for the root element.
$properties = array(
'key' => 'home',
'type' => navigation_node::TYPE_SYSTEM,
@@ -1263,8 +1264,17 @@ class global_navigation extends navigation_node {
'action' => new moodle_url('/'),
'icon' => new pix_icon('i/home', '')
);
} else if ($homepage == HOMEPAGE_MYCOURSES) {
// We are using the user's course summary page for the root element.
$properties = array(
'key' => 'mycourses',
'type' => navigation_node::TYPE_SYSTEM,
'text' => get_string('mycourses'),
'action' => new moodle_url('/my/courses.php'),
'icon' => new pix_icon('i/course', '')
);
} else {
// We are using the users my moodle for the root element
// We are using the users my moodle for the root element.
$properties = array(
'key' => 'myhome',
'type' => navigation_node::TYPE_SYSTEM,