diff --git a/blocks/section_links/block_section_links.php b/blocks/section_links/block_section_links.php
index f7e555e5360..347a127a768 100644
--- a/blocks/section_links/block_section_links.php
+++ b/blocks/section_links/block_section_links.php
@@ -44,10 +44,12 @@ class block_section_links extends block_base {
* @return array
*/
public function applicable_formats() {
- return array(
+ return [
'course-view-weeks' => true,
- 'course-view-topics' => true
- );
+ 'course-view-topics' => true,
+ 'section-view-weeks' => true,
+ 'section-view-topics' => true,
+ ];
}
/**
@@ -179,5 +181,3 @@ class block_section_links extends block_base {
];
}
}
-
-
diff --git a/course/format/classes/base.php b/course/format/classes/base.php
index 3a64d6dd912..2d897626f22 100644
--- a/course/format/classes/base.php
+++ b/course/format/classes/base.php
@@ -2028,4 +2028,14 @@ abstract class base {
public function get_required_jsfiles(): array {
return [];
}
+
+ /**
+ * Determines whether section items can be removed from the navigation, just like the breadcrumb feature seen on activity pages.
+ * By default, it returns false but can be overridden by the course format to change the behaviour.
+ *
+ * @return bool True if sections can be removed, false otherwise.
+ */
+ public function can_sections_be_removed_from_navigation(): bool {
+ return false;
+ }
}
diff --git a/course/format/classes/output/local/content/section/controlmenu.php b/course/format/classes/output/local/content/section/controlmenu.php
index a446a779a8c..63f2fa40d5f 100644
--- a/course/format/classes/output/local/content/section/controlmenu.php
+++ b/course/format/classes/output/local/content/section/controlmenu.php
@@ -119,7 +119,7 @@ class controlmenu implements named_templatable, renderable {
* @return array of edit control items
*/
public function section_control_items() {
- global $USER;
+ global $USER, $PAGE;
$format = $this->format;
$section = $this->section;
@@ -135,13 +135,18 @@ class controlmenu implements named_templatable, renderable {
$baseurl = course_get_url($course, $sectionreturn);
$baseurl->param('sesskey', sesskey());
- $controls['view'] = [
- 'url' => new moodle_url('/course/section.php', ['id' => $section->id]),
- 'icon' => 'i/viewsection',
- 'name' => get_string('view'),
- 'pixattr' => ['class' => ''],
- 'attr' => ['class' => 'icon view'],
- ];
+ $controls = [];
+
+ // Only show the view link if we are not already in the section view page.
+ if ($PAGE->pagetype !== 'section-view-' . $course->format) {
+ $controls['view'] = [
+ 'url' => new moodle_url('/course/section.php', ['id' => $section->id]),
+ 'icon' => 'i/viewsection',
+ 'name' => get_string('view'),
+ 'pixattr' => ['class' => ''],
+ 'attr' => ['class' => 'icon view'],
+ ];
+ }
if (!$isstealth && has_capability('moodle/course:update', $coursecontext, $user)) {
$params = ['id' => $section->id];
@@ -177,6 +182,9 @@ class controlmenu implements named_templatable, renderable {
if ($section->section) {
$url = clone($baseurl);
+ if (!is_null($sectionreturn)) {
+ $url->param('sectionid', $format->get_sectionid());
+ }
if (!$isstealth) {
if (has_capability('moodle/course:sectionvisibility', $coursecontext, $user)) {
$strhidefromothers = get_string('hidefromothers', 'format_' . $course->format);
diff --git a/course/format/templates/local/content/section.mustache b/course/format/templates/local/content/section.mustache
index 706d40e8408..0e33a56e7ec 100644
--- a/course/format/templates/local/content/section.mustache
+++ b/course/format/templates/local/content/section.mustache
@@ -88,7 +88,7 @@
}}
core_courseformat/local/content/section/controlmenu }}
- {{/ core_courseformat/local/content/section/controlmenu }}
+ {{^displayonesection}}
+ {{$ core_courseformat/local/content/section/controlmenu }}
+ {{> core_courseformat/local/content/section/controlmenu }}
+ {{/ core_courseformat/local/content/section/controlmenu }}
+ {{/displayonesection}}
{{/controlmenu}}
{{#header}}
{{#headerdisplaymultipage}}
- {{^controlmenu}}
-
- {{/controlmenu}}
+ {{^displayonesection}}
+ {{^controlmenu}}
+
+ {{/controlmenu}}
+ {{/displayonesection}}
{{/headerdisplaymultipage}}
{{/header}}
diff --git a/course/format/templates/local/content/section/header.mustache b/course/format/templates/local/content/section/header.mustache
index 495e0205469..8cac7191cf4 100644
--- a/course/format/templates/local/content/section/header.mustache
+++ b/course/format/templates/local/content/section/header.mustache
@@ -36,9 +36,11 @@
{{/ core_courseformat/local/content/section/bulkselect }}
{{/sectionbulk}}
{{#headerdisplaymultipage}}
-
- {{{title}}}
-
+ {{^displayonesection}}
+
+ {{{title}}}
+
+ {{/displayonesection}}
{{/headerdisplaymultipage}}
{{^headerdisplaymultipage}}
{{#sitehome}}
@@ -47,11 +49,6 @@
{{/sitehome}}
{{^sitehome}}
- {{#displayonesection}}
-
- {{{title}}}
-
- {{/displayonesection}}
{{^displayonesection}}
resetAfterTest();
+
+ $generator = $this->getDataGenerator();
+
+ $course = $generator->create_course();
+ $format = course_get_format($course);
+ $this->assertFalse($format->can_sections_be_removed_from_navigation());
+
+ $course = $generator->create_course(['format' => 'testformatsections']);
+ $format = course_get_format($course);
+ $this->assertTrue($format->can_sections_be_removed_from_navigation());
+ }
}
/**
@@ -923,6 +941,10 @@ class format_testformatsections extends core_courseformat\base {
public function uses_sections() {
return true;
}
+
+ public function can_sections_be_removed_from_navigation(): bool {
+ return true;
+ }
}
/**
diff --git a/course/format/tests/behat/section_page.feature b/course/format/tests/behat/section_page.feature
index 369e177d69a..c965766e7c2 100644
--- a/course/format/tests/behat/section_page.feature
+++ b/course/format/tests/behat/section_page.feature
@@ -73,7 +73,7 @@ Feature: Single section course page
But I am on "Course 1" course homepage
And I open section "0" edit menu
And I click on "View" "link" in the "General" "section"
- And I should see "General" in the "region-main" "region"
+ And I should see "General" in the "page" "region"
And I should see "Activity sample 0.1" in the "region-main" "region"
And I should not see "Activity sample 1.1" in the "region-main" "region"
And I should not see "Activity sample 1.2" in the "region-main" "region"
@@ -81,5 +81,6 @@ Feature: Single section course page
And I should not see "Activity sample 2.1" in the "region-main" "region"
And I should not see "Activity sample 2.1" in the "region-main" "region"
# The section viewed has been trigered.
+ And I am on "Course 1" course homepage
And I navigate to "Reports > Live logs" in current page administration
And I should see "Section viewed"
diff --git a/course/format/topics/classes/output/courseformat/content/section/controlmenu.php b/course/format/topics/classes/output/courseformat/content/section/controlmenu.php
index 263247ffc0a..73c045aa1cb 100644
--- a/course/format/topics/classes/output/courseformat/content/section/controlmenu.php
+++ b/course/format/topics/classes/output/courseformat/content/section/controlmenu.php
@@ -110,7 +110,11 @@ class controlmenu extends controlmenu_base {
$format = $this->format;
$section = $this->section;
$course = $format->get_course();
+ $sectionreturn = $format->get_sectionnum();
$url = $this->get_course_url();
+ if (!is_null($sectionreturn)) {
+ $url->param('sectionid', $format->get_sectionid());
+ }
$highlightoff = get_string('highlightoff');
$highlighton = get_string('highlight');
@@ -125,6 +129,7 @@ class controlmenu extends controlmenu_base {
'attr' => [
'class' => 'editing_highlight',
'data-action' => 'sectionUnhighlight',
+ 'data-sectionreturn' => $sectionreturn,
'data-id' => $section->id,
'data-swapname' => $highlighton,
'data-swapicon' => 'i/marker',
@@ -140,6 +145,7 @@ class controlmenu extends controlmenu_base {
'attr' => [
'class' => 'editing_highlight',
'data-action' => 'sectionHighlight',
+ 'data-sectionreturn' => $sectionreturn,
'data-id' => $section->id,
'data-swapname' => $highlightoff,
'data-swapicon' => 'i/marked',
diff --git a/course/format/topics/tests/behat/edit_delete_sections.feature b/course/format/topics/tests/behat/edit_delete_sections.feature
index 9091154de31..d2cc179689d 100644
--- a/course/format/topics/tests/behat/edit_delete_sections.feature
+++ b/course/format/topics/tests/behat/edit_delete_sections.feature
@@ -33,7 +33,7 @@ Feature: Sections can be edited and deleted in custom sections format
When I edit the section "0" and I fill the form with:
| Custom | 1 |
| New value for Section name | This is the general section |
- Then I should see "This is the general section" in the "This is the general section" "section"
+ Then I should see "This is the general section" in the "page" "region"
Scenario: View the default name of the second section in custom sections format
When I edit the section "2"
@@ -43,13 +43,13 @@ Feature: Sections can be edited and deleted in custom sections format
Scenario: Edit section summary in custom sections format
When I edit the section "2" and I fill the form with:
| Description | Welcome to section 2 |
- Then I should see "Welcome to section 2" in the "Topic 2" "section"
+ Then I should see "Welcome to section 2" in the "page" "region"
Scenario: Edit section default name in custom sections format
When I edit the section "2" and I fill the form with:
| Custom | 1 |
| New value for Section name | This is the second topic |
- Then I should see "This is the second topic" in the "This is the second topic" "section"
+ Then I should see "This is the second topic" in the "page" "region"
And I should not see "Topic 2" in the "region-main" "region"
@javascript
diff --git a/course/format/weeks/tests/behat/edit_delete_sections.feature b/course/format/weeks/tests/behat/edit_delete_sections.feature
index fe42db9d08f..d4c89d63171 100644
--- a/course/format/weeks/tests/behat/edit_delete_sections.feature
+++ b/course/format/weeks/tests/behat/edit_delete_sections.feature
@@ -32,7 +32,7 @@ Feature: Sections can be edited and deleted in weekly sections format
When I edit the section "0" and I fill the form with:
| Custom | 1 |
| New value for Section name | This is the general section |
- Then I should see "This is the general section" in the "This is the general section" "section"
+ Then I should see "This is the general section" in the "page" "region"
Scenario: View the default name of the second section in weeks format
When I edit the section "2"
@@ -42,14 +42,14 @@ Feature: Sections can be edited and deleted in weekly sections format
Scenario: Edit section summary in weeks format
When I edit the section "2" and I fill the form with:
| Description | Welcome to section 2 |
- Then I should see "Welcome to section 2" in the "8 May - 14 May" "section"
+ Then I should see "Welcome to section 2" in the "page" "region"
Scenario: Edit section default name in weeks format
Given I should see "8 May - 14 May" in the "8 May - 14 May" "section"
When I edit the section "2" and I fill the form with:
| Custom | 1 |
| New value for Section name | This is the second week |
- Then I should see "This is the second week" in the "This is the second week" "section"
+ Then I should see "This is the second week" in the "page" "region"
And I should not see "8 May - 14 May"
@javascript
diff --git a/course/section.php b/course/section.php
index 0bb7d9714eb..7e6b5ffa72b 100644
--- a/course/section.php
+++ b/course/section.php
@@ -46,6 +46,7 @@ $course = get_course($section->course);
// Fix course format if it is no longer installed.
$format = course_get_format($course);
$course->format = $format->get_format();
+$format->set_sectionid($section->id);
// When the course format doesn't support sections, redirect to course page.
if (!course_format_uses_sections($course->format)) {
@@ -62,18 +63,18 @@ require_login($course);
// Must set layout before getting section info. See MDL-47555.
$PAGE->set_pagelayout('course');
-$PAGE->add_body_class('limitedwidth');
+$PAGE->add_body_classes(['limitedwidth', 'single-section-page']);
// Get section details and check it exists.
$modinfo = get_fast_modinfo($course);
-$coursesections = $modinfo->get_section_info($section->section, MUST_EXIST);
+$sectioninfo = $modinfo->get_section_info($section->section, MUST_EXIST);
// Check user is allowed to see it.
-if (!$coursesections->uservisible) {
+if (!$sectioninfo->uservisible) {
// Check if coursesection has conditions affecting availability and if
// so, output availability info.
- if ($coursesections->visible && $coursesections->availableinfo) {
- $sectionname = get_section_name($course, $coursesections);
+ if ($sectioninfo->visible && $sectioninfo->availableinfo) {
+ $sectionname = get_section_name($course, $sectioninfo);
$message = get_string('notavailablecourse', '', $sectionname);
redirect(course_get_url($course), $message, null, \core\output\notification::NOTIFY_ERROR);
} else {
@@ -84,7 +85,7 @@ if (!$coursesections->uservisible) {
}
}
-$PAGE->set_pagetype('course-view-' . $course->format);
+$PAGE->set_pagetype('section-view-' . $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');
@@ -141,7 +142,20 @@ if (!empty($bulkbutton)) {
$PAGE->add_header_action($bulkbutton);
}
-$PAGE->set_heading($course->fullname);
+// Add to the header the control menu for the section.
+if ($format->show_editor()) {
+ $sectionclass = new \core_courseformat\output\local\content\section($format, $sectioninfo);
+ $renderable = $sectionclass->export_for_template($renderer);
+ $controlmenuhtml = $renderable->controlmenu->menu;
+ $PAGE->add_header_action($controlmenuhtml);
+ $sectionheading = $OUTPUT->render($format->inplace_editable_render_section_name($sectioninfo, false));
+ $PAGE->set_heading($sectionheading, false, false);
+} else {
+ $PAGE->set_heading($sectiontitle);
+}
+
+$PAGE->set_secondary_navigation(false);
+
echo $OUTPUT->header();
// Show communication room status notification.
@@ -168,7 +182,6 @@ echo $renderer->container_start('course-content');
// Include course AJAX.
include_course_ajax($course, $modinfo->get_used_module_names());
-$format->set_sectionid($section->id);
$outputclass = $format->get_output_classname('content');
$widget = new $outputclass($format);
echo $renderer->render($widget);
diff --git a/course/tests/behat/course_controls.feature b/course/tests/behat/course_controls.feature
index 3285bbba179..c3893cb63aa 100644
--- a/course/tests/behat/course_controls.feature
+++ b/course/tests/behat/course_controls.feature
@@ -61,15 +61,14 @@ Feature: Course activity controls works as expected
And I should see "Edited test forum name 2"
# General section can't be hidden. Check this part using always the first section.
And I am on the "Course 1" course page
- And I open section "1" edit menu
- And I click on "View" "link" in the "section"
And I hide section "1"
- And "section" should not exist
And section "1" should be hidden
And all activities in section "1" should be hidden
And I show section "1"
- And "section" should not exist
And section "1" should be visible
+ And I open section "1" edit menu
+ And I click on "View" "link" in the "section"
+ And "section" should not exist
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I add the "Section links" block
@@ -129,9 +128,6 @@ Feature: Course activity controls works as expected
And I should see "Edited test forum name 2"
# General section can't be hidden. Check this part using always the first section.
And I am on the "Course 1" course page
- And I turn editing mode off
- And I click on "link" in the "region-main" "region"
- And I turn editing mode on
And I hide section "1"
And section "1" should be hidden
And all activities in section "1" should be hidden
diff --git a/course/tests/behat/paged_course_navigation.feature b/course/tests/behat/paged_course_navigation.feature
index cd48237c493..65ff888f101 100644
--- a/course/tests/behat/paged_course_navigation.feature
+++ b/course/tests/behat/paged_course_navigation.feature
@@ -16,15 +16,15 @@ Feature: Course paged mode
And I click on "link" in the "section"
And I am on "Course 1" course homepage
When I click on "link" in the "section"
- Then I should see in the "div.single-section" "css_element"
+ Then I should see in the "div.page-context-header" "css_element"
And I should see in the ".single-section div.nextsection" "css_element"
And I should not see in the ".single-section" "css_element"
And I click on "link" in the ".single-section" "css_element"
- And I should see in the "div.single-section" "css_element"
+ And I should see in the "div.page-context-header" "css_element"
And I should see in the ".single-section div.prevsection" "css_element"
And I should see in the ".single-section div.nextsection" "css_element"
And I click on "link" in the ".single-section" "css_element"
- And I should see in the "div.single-section" "css_element"
+ And I should see in the "div.page-context-header" "css_element"
And I should not see in the ".single-section .section-navigation" "css_element"
And I should not see in the ".single-section" "css_element"
And I should not see in the ".single-section" "css_element"
@@ -46,10 +46,7 @@ Feature: Course paged mode
And I am on "Course 1" course homepage with editing mode on
And I open section edit menu
And I click on "View" "link" in the "section"
- And I should see in the "div.single-section" "css_element"
- And I should see in the ".single-section div.nextsection" "css_element"
- And I should not see in the ".single-section" "css_element"
- Then I should see in the "div.single-section" "css_element"
+ Then I should see in the "div.page-context-header" "css_element"
And I should see in the ".single-section div.nextsection" "css_element"
And I should not see in the ".single-section" "css_element"
@@ -69,15 +66,15 @@ Feature: Course paged mode
And I click on "link" in the "section"
And I am on "Course 1" course homepage
And I click on "link" in the "section"
- And I should see in the "div.single-section" "css_element"
+ And I should see in the "div.page-context-header" "css_element"
And I should see in the ".single-section div.nextsection" "css_element"
And I should not see in the ".single-section" "css_element"
And I click on "link" in the ".single-section" "css_element"
- And I should see in the "div.single-section" "css_element"
+ And I should see in the "div.page-context-header" "css_element"
And I should see in the ".single-section div.prevsection" "css_element"
And I should see in the ".single-section div.nextsection" "css_element"
And I click on "link" in the ".single-section" "css_element"
- And I should see in the "div.single-section" "css_element"
+ And I should see in the "div.page-context-header" "css_element"
And I should not see in the ".single-section .section-navigation" "css_element"
And I should not see in the ".single-section" "css_element"
And I should not see in the ".single-section" "css_element"
diff --git a/course/tests/behat/sectionzero_title.feature b/course/tests/behat/sectionzero_title.feature
index 41e322b77a0..11935e83846 100644
--- a/course/tests/behat/sectionzero_title.feature
+++ b/course/tests/behat/sectionzero_title.feature
@@ -28,17 +28,15 @@ Feature: Section 0 default/custom title
Scenario: Editing section 0 title
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
- And I edit the section "0" and I fill the form with:
- | Custom | 1 |
- | New value for Section name | Edited section 0 |
- And I should see "Edited section 0" in the "li#section-0" "css_element"
+ And I set the field "Edit section name" in the "li#section-0" "css_element" to "Edited section 0"
+ And I should see "Edited section 0" in the "page" "region"
When I set the field "Edit section name" in the "li#section-0" "css_element" to ""
Then I should not see "Edited section 0" in the "li#section-0" "css_element"
And I should see "General" in the "li#section-0" "css_element"
And "New name for section" "field" should not exist
And I set the field "Edit section name" in the "li#section-0" "css_element" to "Edited section 0"
- And I should see "Edited section 0" in the "li#section-0" "css_element"
+ And I should see "Edited section 0" in the "page" "region"
And I edit the section "0" and I fill the form with:
| Custom | 0 |
- And I should not see "Edited section 0" in the "li#section-0" "css_element"
- And I should see "General" in the "li#section-0" "css_element"
+ And I should not see "Edited section 0" in the "page" "region"
+ And I should see "General" in the "page" "region"
diff --git a/course/view.php b/course/view.php
index cd3aa8ee9bb..e25c664945d 100644
--- a/course/view.php
+++ b/course/view.php
@@ -202,11 +202,28 @@ if ($PAGE->user_allowed_editing()) {
if (has_capability('moodle/course:sectionvisibility', $context)) {
if ($hide && confirm_sesskey()) {
set_section_visible($course->id, $hide, '0');
- redirect($PAGE->url);
+ if ($sectionid) {
+ redirect(course_get_url($course, $section, ['navigation' => true]));
+ } else {
+ redirect($PAGE->url);
+ }
}
if ($show && confirm_sesskey()) {
set_section_visible($course->id, $show, '1');
+ if ($sectionid) {
+ redirect(course_get_url($course, $section, ['navigation' => true]));
+ } else {
+ redirect($PAGE->url);
+ }
+ }
+ }
+
+ if ($marker >= 0 && confirm_sesskey()) {
+ course_set_marker($course->id, $marker);
+ if ($sectionid) {
+ redirect(course_get_url($course, $section, ['navigation' => true]));
+ } else {
redirect($PAGE->url);
}
}
diff --git a/lib/pagelib.php b/lib/pagelib.php
index 40d39c739b0..3fba00ac248 100644
--- a/lib/pagelib.php
+++ b/lib/pagelib.php
@@ -1422,9 +1422,10 @@ class moodle_page {
*
* @param string $heading the main heading that should be displayed at the top of the .
* @param bool $applyformatting apply format_string() - by default true.
+ * @param bool $clean whether the heading should be cleaned or not when no formatting is applied - by default true.
*/
- public function set_heading($heading, bool $applyformatting = true) {
- $this->_heading = $applyformatting ? format_string($heading) : clean_text($heading);
+ public function set_heading($heading, bool $applyformatting = true, bool $clean = true) {
+ $this->_heading = $applyformatting ? format_string($heading) : ($clean ? clean_text($heading) : $heading);
}
/**
diff --git a/lib/tests/moodle_page_test.php b/lib/tests/moodle_page_test.php
index 94b4a88ae06..793a3ff6f69 100644
--- a/lib/tests/moodle_page_test.php
+++ b/lib/tests/moodle_page_test.php
@@ -321,8 +321,12 @@ class moodle_page_test extends \advanced_testcase {
$this->assertSame('a heading edit', $this->testpage->heading);
// Without formatting the tags are preserved but cleaned.
- $this->testpage->set_heading('a heading edit', false);
- $this->assertSame('a heading edit
', $this->testpage->heading);
+ $this->testpage->set_heading('', false);
+ $this->assertSame('', $this->testpage->heading);
+
+ // Without formatting nor clean.
+ $this->testpage->set_heading('', false, false);
+ $this->assertSame('', $this->testpage->heading);
}
/**
diff --git a/lib/upgrade.txt b/lib/upgrade.txt
index 306e092afde..a5f2a492698 100644
--- a/lib/upgrade.txt
+++ b/lib/upgrade.txt
@@ -53,6 +53,8 @@ information provided here is intended especially for developers.
It was originally deprecated in Moodle 2.0.
* The smiley option for format_text has been removed. It was deprecated in Moodle 2.0.
* The nocache option for format_text has been removed. It was deprecated in Moodle 2.3.
+* The set_heading() method has a new parameter, $clean, to define whether the heading should be cleaned or not when no formatting
+ is applied.
=== 4.3 ===
diff --git a/theme/boost/classes/boostnavbar.php b/theme/boost/classes/boostnavbar.php
index c4381483759..ad767af3dd4 100644
--- a/theme/boost/classes/boostnavbar.php
+++ b/theme/boost/classes/boostnavbar.php
@@ -79,7 +79,9 @@ class boostnavbar implements \renderable {
$this->remove($item->key, \breadcrumb_navigation_node::TYPE_CATEGORY);
}
// Remove the course breadcrumb node.
- $this->remove($this->page->course->id, \breadcrumb_navigation_node::TYPE_COURSE);
+ if (!str_starts_with($this->page->pagetype, 'section-view-')) {
+ $this->remove($this->page->course->id, \breadcrumb_navigation_node::TYPE_COURSE);
+ }
// Remove the navbar nodes that already exist in the secondary navigation menu.
$this->remove_items_that_exist_in_navigation($PAGE->secondarynav);
@@ -111,11 +113,8 @@ class boostnavbar implements \renderable {
// Remove if it is a course category breadcrumb node.
$this->remove($item->key, \breadcrumb_navigation_node::TYPE_CATEGORY);
}
- $courseformat = course_get_format($this->page->course)->get_course();
- // Section items can be only removed if a course layout (coursedisplay) is not explicitly set in the
- // given course format or the set course layout is not 'One section per page'.
- $removesections = !isset($courseformat->coursedisplay) ||
- $courseformat->coursedisplay != COURSE_DISPLAY_MULTIPAGE;
+ $courseformat = course_get_format($this->page->course);
+ $removesections = $courseformat->can_sections_be_removed_from_navigation();
if ($removesections) {
// If the course sections are removed, we need to add the anchor of current section to the Course.
$coursenode = $this->get_item($this->page->course->id);
diff --git a/theme/boost/scss/moodle/course.scss b/theme/boost/scss/moodle/course.scss
index aa5d41f5675..92f3a4865ea 100644
--- a/theme/boost/scss/moodle/course.scss
+++ b/theme/boost/scss/moodle/course.scss
@@ -343,10 +343,6 @@
margin-top: 5px;
}
-.course-content .single-section {
- margin-top: 1em;
-}
-
.course-content .single-section .section-navigation {
display: block;
padding: 0.5em;
@@ -430,6 +426,11 @@
}
}
+.course-content .single-section ul.topics li.section,
+.course-content .single-section ul.weeks li.section {
+ padding-top: 0;
+}
+
@include media-breakpoint-down(sm) {
body:not(.editing) {
.course-content ul.topics,
@@ -570,6 +571,10 @@ li.section.hidden span.commands a.editing_show {
cursor: default;
}
+.single-section-page .header-action {
+ display: inline-block;
+}
+
input.titleeditor {
width: 330px;
vertical-align: text-bottom;
diff --git a/theme/boost/style/moodle.css b/theme/boost/style/moodle.css
index 835027b550b..6d0c3d0f82a 100644
--- a/theme/boost/style/moodle.css
+++ b/theme/boost/style/moodle.css
@@ -28183,10 +28183,6 @@ table.calendartable caption {
margin-top: 5px;
}
-.course-content .single-section {
- margin-top: 1em;
-}
-
.course-content .single-section .section-navigation {
display: block;
padding: 0.5em;
@@ -28270,6 +28266,11 @@ table.calendartable caption {
width: auto;
}
+.course-content .single-section ul.topics li.section,
+.course-content .single-section ul.weeks li.section {
+ padding-top: 0;
+}
+
@media (max-width: 767.98px) {
body:not(.editing) .course-content ul.topics li.section .left,
body:not(.editing) .course-content ul.topics li.section .right,
@@ -28384,6 +28385,10 @@ li.section.hidden span.commands a.editing_show {
cursor: default;
}
+.single-section-page .header-action {
+ display: inline-block;
+}
+
input.titleeditor {
width: 330px;
vertical-align: text-bottom;
diff --git a/theme/classic/style/moodle.css b/theme/classic/style/moodle.css
index 1ea8911afbc..b14164ed5de 100644
--- a/theme/classic/style/moodle.css
+++ b/theme/classic/style/moodle.css
@@ -28183,10 +28183,6 @@ table.calendartable caption {
margin-top: 5px;
}
-.course-content .single-section {
- margin-top: 1em;
-}
-
.course-content .single-section .section-navigation {
display: block;
padding: 0.5em;
@@ -28270,6 +28266,11 @@ table.calendartable caption {
width: auto;
}
+.course-content .single-section ul.topics li.section,
+.course-content .single-section ul.weeks li.section {
+ padding-top: 0;
+}
+
@media (max-width: 767.98px) {
body:not(.editing) .course-content ul.topics li.section .left,
body:not(.editing) .course-content ul.topics li.section .right,
@@ -28384,6 +28385,10 @@ li.section.hidden span.commands a.editing_show {
cursor: default;
}
+.single-section-page .header-action {
+ display: inline-block;
+}
+
input.titleeditor {
width: 330px;
vertical-align: text-bottom;