diff --git a/mod/assign/locallib.php b/mod/assign/locallib.php index d35131f5091..05c71bcbe5a 100644 --- a/mod/assign/locallib.php +++ b/mod/assign/locallib.php @@ -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); diff --git a/mod/assign/renderable.php b/mod/assign/renderable.php index 936be1649af..295fc3c93f0 100644 --- a/mod/assign/renderable.php +++ b/mod/assign/renderable.php @@ -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; } }