Merge branch 'MDL-82009-main' of https://github.com/sarjona/moodle

This commit is contained in:
Huong Nguyen
2024-06-03 11:36:17 +07:00
5 changed files with 15 additions and 5 deletions
+2 -2
View File
@@ -47,8 +47,8 @@ class block_section_links extends block_base {
return [
'course-view-weeks' => true,
'course-view-topics' => true,
'section-view-weeks' => true,
'section-view-topics' => true,
'course-view-section-weeks' => true,
'course-view-section-topics' => true,
];
}
@@ -166,7 +166,7 @@ class controlmenu implements named_templatable, renderable {
$controls = [];
// Only show the view link if we are not already in the section view page.
if ($PAGE->pagetype !== 'section-view-' . $course->format) {
if ($PAGE->pagetype !== 'course-view-section-' . $course->format) {
$controls['view'] = [
'url' => new moodle_url('/course/section.php', ['id' => $section->id]),
'icon' => 'i/viewsection',
@@ -100,3 +100,13 @@ Feature: Single section course page
And I click on "View" "link" in the "Section 1" "section"
When I set the field "Edit section name" in the "page-header" "region" to "Custom section name"
Then "Custom section name" "text" should exist in the ".breadcrumb" "css_element"
Scenario: Blocks are displayed in section page too
Given I log out
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| online_users | Course | C1 | course-view-* | site-pre |
When I am on the "C1" "Course" page logged in as "teacher1"
Then I should see "Online users"
And I am on the "Course 1 > Section 1" "course > section" page
And I should see "Online users"
+1 -1
View File
@@ -107,7 +107,7 @@ if (!$sectioninfo->uservisible) {
}
}
$PAGE->set_pagetype('section-view-' . $course->format);
$PAGE->set_pagetype('course-view-section-' . $course->format);
$PAGE->set_other_editing_capability('moodle/course:update');
$PAGE->set_other_editing_capability('moodle/course:manageactivities');
$PAGE->set_other_editing_capability('moodle/course:activityvisibility');
+1 -1
View File
@@ -79,7 +79,7 @@ class boostnavbar implements \renderable {
$this->remove($item->key, \breadcrumb_navigation_node::TYPE_CATEGORY);
}
// Remove the course breadcrumb node.
if (!str_starts_with($this->page->pagetype, 'section-view-')) {
if (!str_starts_with($this->page->pagetype, 'course-view-section-')) {
$this->remove($this->page->course->id, \breadcrumb_navigation_node::TYPE_COURSE);
}
// Remove the navbar nodes that already exist in the secondary navigation menu.