In MDL-74087 breadcrumbs were removed from the User preferences page.
This patch re-introduces a piece of code that was removed originally
in MDL-73233 while reviewing all the places where the Dashboard was
displayed by default (to avoid inconsistencies). New item in primary
navigation has been changed to "Home" but we still need the code
re-added to hide breadcrumbs when its content matches the primary
navigation.
- Only add Dashboard to 'home' the root node if the $CFG->enabledashboard
setting is enabled.
- The "More..." link displayed in the "My courses" section from the
navigation block was pointing to the dashboard. However, now that we have
the "My courses" page, it makes more sense to change it and link to it.
- For the User preferences, I've changed breadcrumbs from "Dashboard" to
"Home" because they are more generic (and don't strictly belong to the
dashboard).
On some larger sites, processing the navigation with format_string will
habitually load all the contexts for navigation which can take 400+ DB
queries. Explicitly tying all those format_string calls to the system
context reduces this overhead to a single DB query that probably has
already been run on the page previously.
Co-authored-by: Peter Burnett <peterburnett@catalyst-au.net>
When handling with the output of find_active_node,
proceed ahead only if the result is an instance of navigation_node.
Else there are chances of exceptions.
Adds new methods is_action_link() and action_link_actions() in the
navigation_node class. The is_action_link() method can be used to
check whether the node's action is of type action_link. The
action_link_actions() method returns the formatted data required
for the core/actions template if the navigation node has an action
link.
Creates secondary navigation dedicated for the single activity course
format. To accomodate these chanages a new property
'showchildreninsubmenu' is introduced in navigation_node which can be
used to define whether the node's children should be displayed in a
submenu when applicable. Also, new method get_page() is added in
settings_navigation which can be used to get the $page class property.
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.
Adds new property 'showinsecondarynavigation' and a new setter method
in the navigation_node class to enable setting the visibility of the
node in the secondary navigation.
- Part of: MDL-69588
Adds new property 'forceintomoremenu' and new setter method in the
navigation_node class to enable forcing a navigation note into a
"more" menu whenever possible.