Skip to content

Commit

Permalink
Merge branch 'MDL-73329' of https://github.com/paulholden/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Dec 15, 2021
2 parents 508fe39 + becf3bd commit 873000b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/classes/navigation/views/secondary.php
Expand Up @@ -626,13 +626,15 @@ protected function load_category_navigation(): void {
* Load the site admin navigation
*/
protected function load_admin_navigation(): void {
global $PAGE;

$settingsnav = $this->page->settingsnav;
$node = $settingsnav->find('root', self::TYPE_SITE_ADMIN);
// We need to know if we are on the main site admin search page. Here the navigation between tabs are done via
// anchors and page reload doesn't happen. On every nested admin settings page, the secondary nav needs to
// exist as links with anchors appended in order to redirect back to the admin search page and the corresponding
// tab.
$isadminsearchpage = $this->page->pagetype === 'admin-search';
// tab. Note this value refers to being present on the page itself, before a search has been performed.
$isadminsearchpage = $PAGE->url->compare(new \moodle_url('/admin/search.php', ['query' => '']), URL_MATCH_PARAMS);
if ($node) {
$siteadminnode = $this->add($node->text, "#link$node->key", null, null, 'siteadminnode');
if ($isadminsearchpage) {
Expand Down

0 comments on commit 873000b

Please sign in to comment.