MDL-74901 core_navigation: support callbacks in frontpage secondary nav
commitc3aae3661240f6585224456e0d4102c64a8a919d
authorJake Dallimore <jake@moodle.com>
Thu, 21 Jul 2022 06:22:26 +0000 (21 14:22 +0800)
committerJake Dallimore <jake@moodle.com>
Mon, 25 Jul 2022 07:06:14 +0000 (25 15:06 +0800)
tree40215fcded77ad8d91e79e3594a748d9022f3952
parent4ce642e8ba568ca50dd71f77c0e231a5676ec8c1
MDL-74901 core_navigation: support callbacks in frontpage secondary nav

Fixes the site home secondary nav, so that nodes added by plugins
implementing the PLUGIN_extend_navigation_frontpage callback can be
displayed for users who don't have the 'course:update' capability.
This change comprises:
- Removed course:update capability checks from site home (index.php)
and from the secondary nav view. This isn't needed since the nav is
capability aware.
- Fixed the initialisation of the secondary nav for the frontpage
course, removing erroneous duplicate 'home' nodes. The nav is now only
shown if there are nodes to display.
index.php
lib/classes/navigation/views/secondary.php