121 Commits

Author SHA1 Message Date
Andrew Nicols
2b49ad42f5
MDL-81456 core: Use DI for all hook access
Using DI for all hook access means that it becomes significantly easier
to mock hooks and callbacks for unit testing without fundamentally
altering the structure of the code purely for the purposes of unit
testing.
2024-04-08 09:35:41 +08:00
Sara Arjona
424c9cb1bd
MDL-79912 backup: Create Course reuse index page
The backup/view.php page has been created to display the list of
course reuse actions available for users.
That way, the "Course reuse" option in the secondary navigation
will display this page instead of redirecting to the first action
available.

Apart from that, the headers for all the Course reuse actions have
been homogenised and the tertiary navigation selector has been included,
to replace headers and make it easier navigate between actions.
2023-11-22 18:11:43 +01:00
Marina Glancy
906dfc2f50 MDL-79088 navigation: new hook to add items to site primary navigation 2023-09-04 13:36:40 +01:00
Paul Holden
9e68a02458
MDL-79118 output: account for empty node/current URL path element. 2023-08-22 17:55:43 +01:00
David Woloszyn
317251a978 MDL-78553 core_communication: Move settings to their own page 2023-08-03 12:36:04 +10:00
Huong Nguyen
54d470c313
Merge branch 'MDL-77732-master' of https://github.com/lameze/moodle 2023-07-04 17:10:26 +07:00
Stephan Robotta
a617b9f6d7
MDL-77732 navigation: fix active flag in navigation for custom menus 2023-07-04 17:09:59 +07:00
Huong Nguyen
58ced4add0 MDL-75316 core_moodlenet: Share to MoodleNet modal and activity menu
Originally implemented as MDL-75785
2023-04-18 17:05:07 +08:00
Marina Glancy
8fc1486d36 MDL-77164 various: fix incorrect phpdocs 2023-04-13 11:35:06 +01:00
Simey Lameze
61f4843fed MDL-77721 navigation: Revert the patch for MDL-75908.
This reverts commit 7b8fa9de865aa7a22eeb25d00fd92d28222a3b71.
2023-03-23 15:45:11 +08:00
Stephan Robotta
7b8fa9de86 MDL-75908 navigation: fix active flag in navigation for custom menus 2023-03-15 11:16:44 +01:00
Jun Pataleta
a482fb4488 Merge branch 'MDL-75903' of https://github.com/paulholden/moodle 2022-11-18 11:28:31 +08:00
Paul Holden
94818dd23f MDL-75903 output: increase precision of primary active node matching.
Co-authored-by: Mikel Martín <mikel@moodle.com>
2022-11-14 17:31:26 +00:00
Stevani Andolo
b554773b0a MDL-76099 core_navigation: allow setting selected course overflow node
Allow pages to choose which course reuse overflow node is selected, to
handle cases where the default selection (based on matching PAGE->url
to the node action URL) isn't possible (such as when several pages need
to exist under the same selected node).
2022-11-09 15:15:50 +08:00
Paul Holden
d53b5879ca MDL-75897 output: safer checking of course reuse action nodes.
Also ensure that if course reuse contains only a single node (e.g.
reset), then it is still accessible from secondary navigation.

Co-authored-by: Meirza Arson <meirza.arson@moodle.com>
2022-10-20 11:08:22 +01:00
Stefan Hanauska
8e371f138a MDL-75714 navigation: Check if node is false 2022-09-14 23:35:15 +02:00
Jake Dallimore
c3aae36612 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.
2022-07-25 15:06:14 +08:00
Alexey
25b5125187 MDL-74522 lib/classes/navigation fix Navbar My courses data-key value 2022-06-07 16:29:31 +03:00
Peter Dias
40ad488405 MDL-74407 navigation: Perform a strict array_search for node keys
Perform strict array_search due to conflicting results in versions <php8.0
2022-04-14 12:25:15 +08:00
Mihail Geshoski
93aa5ab03e MDL-74386 navigation: Do not load course navigation in system context 2022-04-08 15:02:01 +08:00
Mihail Geshoski
d5a48c941e MDL-74208 navigation: Avoid showing empty menu in single activity course
The following change prevents showing the 'Course' item (dropdown) in
the secondary navigation if this dropdown does not contain any items
when using the single activity course format.
2022-04-04 15:46:18 +08:00
Mihail Geshoski
eac7fa895e MDL-74266 navigation: Perform strict check whether key exists in array 2022-03-25 16:06:24 +08:00
Andrew Nicols
424143b2e6 Merge branch 'MDL-74229-master' of https://github.com/bmbrands/moodle 2022-03-21 13:07:48 +08:00
Jun Pataleta
1e533995dd Merge branch 'MDL-73233-master' of https://github.com/sarjona/moodle 2022-03-18 00:35:11 +08:00
Jun Pataleta
cb9480841c Merge branch 'MDL-74216-master' of https://github.com/mihailges/moodle 2022-03-17 19:47:46 +08:00
Bas Brands
f0e32f99b4 MDL-74229 navigation: add data-key to navtabs 2022-03-16 13:30:35 +01:00
Sara Arjona
c612f121a0 MDL-73233 navigation: Hide Dashboard from primary nav
When the $CFG->enabledashboard is disabled, the "Dashboard"
menu option won't be displayed in the primary navigation.
2022-03-16 11:35:07 +01:00
Mihail Geshoski
7066c7618c MDL-74216 navigation: Do not show 'My courses' in primary nav to guests 2022-03-16 18:16:58 +08:00
Jun Pataleta
8c07f33d80 Merge branch 'MDL-72481-master' of https://github.com/rezaies/moodle 2022-03-16 11:45:40 +08:00
Jun Pataleta
1f21daf8b3 MDL-72481 core: Fix more menu keyboard navigation
* Allow the more menu to be rendered as a tablist when needed.
* Let menu_navigation handle keyboard navigation only when
menu items are not rendered as dropdowns. Otherwise, leave
the keyboard navigation handling via the default handlers
(e.g. dropdown.js/aria.js/tab.js).
* When the more menu is rendered as a tablist, use aria-selected
for the selected tab. When it's rendered as a menu, use aria-current
for the selected menu item. (The menuitem role supports aria-current and
not aria-selected)
* Make sure that the active tab is tabbable by default.
* Submenu items should always have tabindex=-1
* Update behat to use css_element instead of xpath. Also, improved it
to consider that it is the active element that should be tabbable.

Co-authored-by: Shamim Rezaie <shamim@moodle.com>
2022-03-15 12:48:21 +11:00
Shamim Rezaie
c6a74d4752 MDL-74033 theme_boost: Ability to remove primary nav items in boost 2022-03-08 11:39:38 +11:00
Jun Pataleta
7ac5deaced Merge branch 'MDL-73462-master' of https://github.com/peterRd/moodle 2022-03-02 13:46:10 +08:00
Peter Dias
4d5a25ffde MDL-73462 navigation: Leverage participants bar for category 2022-03-02 12:27:02 +08:00
Jun Pataleta
d8cadf7ecf Merge branch 'MDL-73462-master' of https://github.com/peterRd/moodle 2022-03-01 18:32:05 +08:00
Peter Dias
b9f9aae134 MDL-73462 course: Update visible nodes in a cat context. 2022-03-01 17:57:24 +08:00
Peter Dias
f1959af7f6 MDL-73462 course: Introduce course category tertiary navigation
Update the category management page.
2022-03-01 17:57:24 +08:00
Ilya Tregubov
127655326e Merge branch 'MDL-73978-master' of https://github.com/peterRd/moodle 2022-02-28 09:18:27 +02:00
Peter Dias
109c5f70a1 MDL-73978 navigation: Update the scoping when adding nodes
Make sure to use the rootnode variable that is being passed specifically for single activity course formats
2022-02-23 13:35:52 +08:00
Peter Dias
3139741a43 MDL-73743 navigation: Update primary set_active_node
Account for the situation where we are in the site course and viewing course type options.
2022-02-23 08:03:22 +08:00
Mathew May
25699339d9 MDL-73743 navigation: Add more nav nodes to site home 2022-02-23 08:03:22 +08:00
Ilya Tregubov
4f4bb7303a Merge branch 'MDL-73273-master' of https://github.com/peterRd/moodle 2022-02-21 11:15:33 +02:00
Mihail Geshoski
cc2769ad94 MDL-73532 navigation: Fix the secondary navigation highlighting
Fixes the highlighting of the items the secondary navigation menu
in the single activity course format.
2022-02-18 18:11:14 +08:00
Jun Pataleta
6b65550240 Merge branch 'MDL-73373-master' of https://github.com/peterRd/moodle 2022-02-16 21:14:26 +08:00
Peter Dias
bdf4f8a651 MDL-73273 navigation: Add checks to enforce action param types
* Added checks in navigationlib to enforce the data type of the passed in action
* Add nodes with non moodleurls to the end of the secondary nav
2022-02-15 11:30:07 +08:00
Mihail Geshoski
98c89410f9 MDL-73532 navigation: Secondary navigation for single activity course
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.
2022-02-14 09:35:03 +08:00
Jun Pataleta
7d743b255d Merge branch 'MDL-73633-master' of git://github.com/mihailges/moodle 2022-02-09 17:45:54 +08:00
Peter Dias
81492f900f MDL-73373 roles: Enable tertiary navigation in module context 2022-02-08 09:04:04 +08:00
Jun Pataleta
4e1a6e6830 Merge branch 'MDL-73646-master-v2' of https://github.com/sharidas/moodle 2022-02-03 19:09:37 +08:00
Sujith Haridasan
3eda637c44 MDL-73646 navigation: Fix breadcrumbs for site admin
Fix the breadcrumbs for site administration page.
Created a new public method get_active_method for the same.
2022-02-02 10:56:16 +05:30
Mihail Geshoski
1c8cf75c47 MDL-73633 navigation: Force 'Overrides' into the more menu by default
Forces the 'Overrides' item to be always displayed within the 'more'
menu in the secondary navigation in the module context.
2022-02-01 23:42:04 +08:00