mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 01:46:45 +02:00
MDL-72530 navigation: No display limit for secondary nodes in site admin
Avoids applying maximum limit of displayed secondary navigation nodes only in site administration pages.
This commit is contained in:
parent
2c9ab4980d
commit
f652127d28
1 changed files with 9 additions and 2 deletions
|
@ -152,6 +152,7 @@ class secondary extends view {
|
|||
$context = $this->context;
|
||||
$this->headertitle = get_string('menu');
|
||||
$defaultmoremenunodes = [];
|
||||
$maxdisplayednodes = self::MAX_DISPLAYED_NAV_NODES;
|
||||
|
||||
switch ($context->contextlevel) {
|
||||
case CONTEXT_COURSE:
|
||||
|
@ -173,6 +174,12 @@ class secondary extends view {
|
|||
case CONTEXT_SYSTEM:
|
||||
$this->headertitle = get_string('homeheader');
|
||||
$this->load_admin_navigation();
|
||||
// If the site administration navigation was generated after load_admin_navigation().
|
||||
if ($this->has_children()) {
|
||||
// Do not explicitly limit the number of navigation nodes displayed in the site administration
|
||||
// navigation menu.
|
||||
$maxdisplayednodes = null;
|
||||
}
|
||||
$defaultmoremenunodes = $this->get_default_admin_more_menu_nodes();
|
||||
break;
|
||||
}
|
||||
|
@ -183,8 +190,8 @@ class secondary extends view {
|
|||
if ($this->children->count() == 1) {
|
||||
$this->children->remove('modulepage');
|
||||
}
|
||||
|
||||
$this->force_nodes_into_more_menu($defaultmoremenunodes);
|
||||
// Force certain navigation nodes to be displayed in the "more" menu.
|
||||
$this->force_nodes_into_more_menu($defaultmoremenunodes, $maxdisplayednodes);
|
||||
// Search and set the active node.
|
||||
$this->scan_for_active_node($this);
|
||||
$this->initialised = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue