diff --git a/badges/badge.php b/badges/badge.php index b79fdce51cb..a6e6f28a8ac 100644 --- a/badges/badge.php +++ b/badges/badge.php @@ -37,7 +37,6 @@ $output = $PAGE->get_renderer('core', 'badges'); $PAGE->set_url('/badges/badge.php', array('hash' => $id)); $PAGE->set_pagelayout('base'); $PAGE->set_title(get_string('issuedbadge', 'badges')); -$PAGE->set_secondary_navigation(false); $badge = new \core_badges\output\issued_badge($id); if (!empty($badge->recipient->id)) { diff --git a/calendar/delete.php b/calendar/delete.php index cbcc9cabca5..b27fea73b52 100644 --- a/calendar/delete.php +++ b/calendar/delete.php @@ -94,7 +94,9 @@ $PAGE->navbar->add($strcalendar, $viewcalendarurl); $PAGE->navbar->add($title); $PAGE->set_title($site->shortname.': '.$strcalendar.': '.$title); $PAGE->set_heading($COURSE->fullname); -$PAGE->set_secondary_navigation(false); +if ($course) { + $PAGE->set_secondary_navigation(false); +} echo $OUTPUT->header(); echo $OUTPUT->box_start('eventlist'); diff --git a/calendar/view.php b/calendar/view.php index e95df9cc322..057f2254f2a 100644 --- a/calendar/view.php +++ b/calendar/view.php @@ -100,6 +100,7 @@ if ($iscoursecalendar && !empty($courseid)) { get_string('calendar', 'calendar'), new moodle_url('/calendar/view.php', ['view' => 'month', 'course' => $course->id]) ); + $PAGE->set_secondary_navigation(false); } else if (!empty($categoryid)) { core_course_category::get($categoryid); // Check that category exists and can be accessed. $PAGE->set_category_by_id($categoryid); @@ -108,10 +109,10 @@ if ($iscoursecalendar && !empty($courseid)) { get_string('calendar', 'calendar'), new moodle_url('/calendar/view.php', ['view' => 'month', 'category' => $categoryid]) ); + $PAGE->set_secondary_navigation(false); } else { $PAGE->set_context(context_system::instance()); } -$PAGE->set_secondary_navigation(false); require_login($course, false); diff --git a/error/index.php b/error/index.php index faeb7a16a04..90363f3404d 100644 --- a/error/index.php +++ b/error/index.php @@ -36,7 +36,6 @@ $PAGE->set_context($context); $PAGE->set_title($title); $PAGE->set_heading($title); $PAGE->navbar->add($title); -$PAGE->set_secondary_navigation(false); // This allows the webserver to dictate wether the http status should remain // what it would have been, or force it to be a 404. Under other conditions diff --git a/my/courses.php b/my/courses.php index 59b7cd235ca..c8e3eb51cc2 100644 --- a/my/courses.php +++ b/my/courses.php @@ -51,7 +51,6 @@ $PAGE->set_context($context); $PAGE->set_url('/my/courses.php'); $PAGE->add_body_classes(['limitedwidth', 'page-mycourses']); $PAGE->set_pagelayout('mycourses'); -$PAGE->set_secondary_navigation(false); $PAGE->set_pagetype('my-index'); $PAGE->blocks->add_region('content'); diff --git a/my/index.php b/my/index.php index 76e6f0163ac..7979644cf98 100644 --- a/my/index.php +++ b/my/index.php @@ -100,7 +100,6 @@ $PAGE->blocks->add_region('content'); $PAGE->set_subpage($currentpage->id); $PAGE->set_title($pagetitle); $PAGE->set_heading($pagetitle); -$PAGE->set_secondary_navigation(false); if (!isguestuser()) { // Skip default home page for guests if (get_home_page() != HOMEPAGE_MY) { diff --git a/tag/edit.php b/tag/edit.php index a3edca2cc77..cbd53134fc9 100644 --- a/tag/edit.php +++ b/tag/edit.php @@ -69,7 +69,6 @@ $PAGE->set_subpage($tag->id); $PAGE->set_context($systemcontext); $PAGE->set_blocks_editing_capability('moodle/tag:editblocks'); $PAGE->set_pagelayout('standard'); -$PAGE->set_secondary_navigation(false); $tagname = $tag->get_display_name(); $tagcollid = $tag->tagcollid; diff --git a/tag/index.php b/tag/index.php index b69a23cfb53..03d6b4d7a2a 100644 --- a/tag/index.php +++ b/tag/index.php @@ -72,6 +72,7 @@ if (empty($tag)) { if ($ctx && ($context = context::instance_by_id($ctx, IGNORE_MISSING)) && $context->contextlevel >= CONTEXT_COURSE) { list($context, $course, $cm) = get_context_info_array($context->id); require_login($course, false, $cm, false, true); + $PAGE->set_secondary_navigation(false); } else { $PAGE->set_context($systemcontext); } @@ -85,7 +86,6 @@ $tagnode = $PAGE->navigation->find('tags', null); $tagnode->make_active(); $PAGE->set_pagelayout('standard'); $PAGE->set_blocks_editing_capability('moodle/tag:editblocks'); -$PAGE->set_secondary_navigation(false); $buttons = ''; if (has_capability('moodle/tag:manage', context_system::instance())) { diff --git a/tag/search.php b/tag/search.php index 4b76fd0bc8c..3526fa973f1 100644 --- a/tag/search.php +++ b/tag/search.php @@ -47,7 +47,6 @@ $PAGE->set_pagelayout('standard'); $PAGE->set_title(get_string('tags', 'tag')); $PAGE->set_heading($SITE->fullname); -$PAGE->set_secondary_navigation(false); $buttons = ''; if (has_capability('moodle/tag:manage', context_system::instance())) { diff --git a/user/contactsitesupport.php b/user/contactsitesupport.php index bb99de0f897..c375841450a 100644 --- a/user/contactsitesupport.php +++ b/user/contactsitesupport.php @@ -33,7 +33,6 @@ $PAGE->set_url('/user/contactsitesupport.php'); $PAGE->set_title(get_string('contactsitesupport', 'admin')); $PAGE->set_heading(get_string('contactsitesupport', 'admin')); $PAGE->set_pagelayout('standard'); -$PAGE->set_secondary_navigation(false); $user = isloggedin() && !isguestuser() ? $USER : null; $renderer = $PAGE->get_renderer('user'); diff --git a/user/profile.php b/user/profile.php index 36acf19b685..bb233d86f98 100644 --- a/user/profile.php +++ b/user/profile.php @@ -48,7 +48,6 @@ if (!empty($CFG->forceloginforprofiles)) { require_login(); if (isguestuser()) { $PAGE->set_context(context_system::instance()); - $PAGE->set_secondary_navigation(false); echo $OUTPUT->header(); echo $OUTPUT->confirm(get_string('guestcantaccessprofiles', 'error'), get_login_url(),