Skip to content

Commit

Permalink
MDL-70196 navigation: Update to pages to add a URL.
Browse files Browse the repository at this point in the history
- Part of: MDL-69588
Some pages have added an item to the end of the  navbar without a
link for it. This adds the current page as a url to this navigation
node. Doing this brings it in line with all of the other pages
around Moodle and also helps with the new navigation changes in
theme boost.
  • Loading branch information
abgreeve authored and Chocolate-lightning committed Aug 23, 2021
1 parent 7d435fb commit c3871a9
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
4 changes: 2 additions & 2 deletions badges/criteria.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
$PAGE->set_url($currenturl);
$PAGE->set_heading($badge->name);
$PAGE->set_title($badge->name);
$PAGE->navbar->add($badge->name);
$PAGE->navbar->add($badge->name, $currenturl);

$output = $PAGE->get_renderer('core', 'badges');
$msg = optional_param('msg', '', PARAM_TEXT);
Expand Down Expand Up @@ -105,4 +105,4 @@
echo $OUTPUT->box(get_string('addcriteriatext', 'badges'));
}

echo $OUTPUT->footer();
echo $OUTPUT->footer();
2 changes: 1 addition & 1 deletion mod/assign/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public function render_assign_header(assign_header $header) {
$o = '';

if ($header->subpage) {
$this->page->navbar->add($header->subpage);
$this->page->navbar->add($header->subpage, $header->subpageurl);
$args = ['contextname' => $header->context->get_context_name(false, true), 'subpage' => $header->subpage];
$title = get_string('subpagetitle', 'assign', $args);
} else {
Expand Down
6 changes: 4 additions & 2 deletions mod/forum/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,10 @@

if (!$search || $showform) {

$PAGE->navbar->add($strforums, new moodle_url('/mod/forum/index.php', array('id'=>$course->id)));
$PAGE->navbar->add(get_string('advancedsearch', 'forum'));
$url = new moodle_url('/mod/forum/index.php', array('id' => $course->id));
$PAGE->navbar->add($strforums, $url);
$url = new moodle_url('/mod/forum/search.php', array('id' => $course->id));
$PAGE->navbar->add(get_string('advancedsearch', 'forum'), $url);

$PAGE->set_title($strsearch);
$PAGE->set_heading($course->fullname);
Expand Down
2 changes: 1 addition & 1 deletion mod/forum/subscribers.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
}

$strsubscribers = get_string("subscribers", "forum");
$PAGE->navbar->add($strsubscribers);
$PAGE->navbar->add($strsubscribers, $url);
$PAGE->set_title($strsubscribers);
$PAGE->set_heading($COURSE->fullname);
if (has_capability('mod/forum:managesubscriptions', $context) && \mod_forum\subscriptions::is_forcesubscribed($forum) === false) {
Expand Down
2 changes: 1 addition & 1 deletion mod/workshop/allocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

$PAGE->set_title($workshop->name);
$PAGE->set_heading($course->fullname);
$PAGE->navbar->add(get_string('allocation', 'workshop'));
$PAGE->navbar->add(get_string('allocation', 'workshop'), $workshop->allocation_url($method));

$allocator = $workshop->allocator_instance($method);
$initresult = $allocator->init();
Expand Down
5 changes: 3 additions & 2 deletions tag/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@

$tagcollid = $tag->tagcollid;

$PAGE->set_url($tag->get_view_url($exclusivemode, $fromctx, $ctx, $rec));
$pageurl = $tag->get_view_url($exclusivemode, $fromctx, $ctx, $rec);
$PAGE->set_url($pageurl);
$PAGE->set_subpage($tag->id);
$tagnode = $PAGE->navigation->find('tags', null);
$tagnode->make_active();
Expand All @@ -97,7 +98,7 @@
$buttons .= $OUTPUT->edit_button(clone($PAGE->url));
}

$PAGE->navbar->add($tagname);
$PAGE->navbar->add($tagname, $pageurl);
$PAGE->set_title(get_string('tag', 'tag') .' - '. $tag->get_display_name());
$PAGE->set_heading($COURSE->fullname);
$PAGE->set_button($buttons);
Expand Down

0 comments on commit c3871a9

Please sign in to comment.