MDL-69588 navigation: Address final point from review

This commit is contained in:
Mathew May 2021-08-24 23:41:09 +08:00
parent c1130de5ff
commit 89460a50d2
3 changed files with 10 additions and 6 deletions

View File

@ -206,10 +206,13 @@ class secondary extends view {
$nodesordered += $this->get_leaf_nodes($navigation, $nodes['navigation'] ?? []);
$this->add_ordered_nodes($nodesordered);
// All additional nodes will be available under the 'Course admin' page.
$text = get_string('courseadministration');
$url = new \moodle_url('/course/admin.php', array('courseid' => $this->page->course->id));
$this->add($text, $url, null, null, 'courseadmin', new \pix_icon('t/edit', $text));
$coursecontext = \context_course::instance($course->id);
if (has_capability('moodle/course:update', $coursecontext)) {
// All additional nodes will be available under the 'Course admin' page.
$text = get_string('courseadministration');
$url = new \moodle_url('/course/admin.php', array('courseid' => $this->page->course->id));
$this->add($text, $url, null, null, 'courseadmin', new \pix_icon('t/edit', $text));
}
}
/**

View File

@ -90,7 +90,7 @@ class behat_mod_workshop extends behat_base {
* @param TableNode $table data to fill the submission form with, must contain 'Title'
*/
public function i_edit_assessment_form_in_workshop_as($workshopname, $table) {
$this->execute("behat_navigation::go_to_breadcrumb_location", $workshopname);
$this->execute("behat_navigation::i_am_on_page_instance", [$this->escape($workshopname), 'workshop activity']);
$this->execute('behat_navigation::i_navigate_to_in_current_page_administration',
get_string('editassessmentform', 'workshop'));

View File

@ -56,7 +56,8 @@ class boostnavbar implements \renderable {
// Set the designated one path for courses.
$mycoursesnode = $this->get_item('mycourses');
if (!is_null($mycoursesnode)) {
$url = new \moodle_url('/mycourses/');
// TODO: Once MDL-70801 lands point this to the new page.
$url = new \moodle_url('/course/');
$mycoursesnode->action = $url;
$mycoursesnode->text = get_string('courses');
}