MDL-70196 mod_assign: Allow the last navbar item to have a link.

- Part of: MDL-69588
This updates a method to allow the last item in the breadcrumb
navbar to have a URL.
This commit is contained in:
Adrian Greeve 2021-03-30 10:39:10 +08:00 committed by Mathew May
parent c3871a9174
commit c8422f4576
2 changed files with 11 additions and 6 deletions

View File

@ -4564,18 +4564,19 @@ class assign {
$gradingoptionsform->set_data($gradingoptionsdata);
$actionformtext = $this->get_renderer()->render($gradingactions);
$currenturl = new moodle_url('/mod/assign/view.php', ['id' => $this->get_course_module()->id, 'action' => 'grading']);
$header = new assign_header($this->get_instance(),
$this->get_context(),
false,
$this->get_course_module()->id,
get_string('grading', 'assign'),
$actionformtext);
$actionformtext,
'',
$currenturl);
$o .= $this->get_renderer()->render($header);
$currenturl = $CFG->wwwroot .
'/mod/assign/view.php?id=' .
$this->get_course_module()->id .
'&action=grading';
$o .= groups_print_activity_menu($this->get_course_module(), $currenturl, true);

View File

@ -671,6 +671,8 @@ class assign_header implements renderable {
public $preface = '';
/** @var string $postfix optional postfix (text to show after the intro) */
public $postfix = '';
/** @var moodle_url $subpageurl link for the subpage */
public $subpageurl = null;
/**
* Constructor
@ -688,7 +690,8 @@ class assign_header implements renderable {
$coursemoduleid,
$subpage='',
$preface='',
$postfix='') {
$postfix='',
moodle_url $subpageurl = null) {
$this->assign = $assign;
$this->context = $context;
$this->showintro = $showintro;
@ -696,6 +699,7 @@ class assign_header implements renderable {
$this->subpage = $subpage;
$this->preface = $preface;
$this->postfix = $postfix;
$this->subpageurl = $subpageurl;
}
}