Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions classes/output/courseformat/content.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ public function export_for_template(renderer_base $output): stdClass {

$format = $this->format;
$displaysection = $format->get_sectionnum();
$data->sectionreturn = $displaysection ?: 'null';
$data->pagesectionid = $format->get_sectionid() ?? 'null';
if (!empty($displaysection)) {
$data->singlesectionpage = $this->print_single_section_page($output);
} else {
Expand Down Expand Up @@ -263,6 +265,7 @@ public function print_course_summary(renderer_base $output): stdClass {
if (!empty($courseformatoptions['reversedisplay'])) {
$templatecontext->reversedisplay = 1;
}
$templatecontext->sectionid = $thissection->id;
return $templatecontext;
}

Expand Down Expand Up @@ -341,6 +344,7 @@ public function print_single_section_page(renderer_base $output): stdClass {
$controlmenu = new $controlmenuclass($format, $thissection);
$templatecontext->controlmenu = $controlmenu->export_for_template($output);
}
$templatecontext->sectionid = $thissection->id;

return $templatecontext;
}
Expand Down
2 changes: 1 addition & 1 deletion templates/course_summary.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@

<h3>{{resourcesheading}}</h3>
<ul class="twocol">
<li id="section-0" class="section main clearfix" aria-label="overview">
<li id="section-0" class="section main clearfix" aria-label="overview" data-for="section" data-id="{{sectionid}}">
<span class="hidden sectionname">overview</span>
<div class = "content">
{{#mods}}
Expand Down
2 changes: 1 addition & 1 deletion templates/course_topic.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
}
}}
<div class="twocol">
<div class="single-section">
<div class="single-section" data-id="{{sectionid}}" data-for="section">
{{#controlmenu}}
<div class="controlmenu-coursetopic">
{{> core_courseformat/local/content/section/controlmenu }}
Expand Down
7 changes: 7 additions & 0 deletions templates/local/content.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@
{{/coursesummary}}
{{#singlesectionpage}}
{{> format_twocol/course_topic }}
{{#js}}
require(['core_courseformat/local/content'], function(component) {
component.init(
'#page', {}, {{sectionreturn}}, {{#pagesectionid}}{{.}}{{/pagesectionid}}{{^pagesectionid}}null{{/pagesectionid}}
);
});
{{/js}}
{{/singlesectionpage}}
{{#multiplesectionpage}}
{{> core_courseformat/local/content }}
Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
Expand Down Expand Up @@ -25,8 +25,8 @@
defined('MOODLE_INTERNAL') || die();

$plugin->component = 'format_twocol';
$plugin->release = '2025072302';
$plugin->version = 2025072302;
$plugin->release = '2025072305';
$plugin->version = 2025072305;
$plugin->requires = 2024042200;
$plugin->maturity = MATURITY_STABLE;
$plugin->supported = [501, 501];
Loading