From 464606c9ac64e14bd3cd76009f9e7e02a3c2178c Mon Sep 17 00:00:00 2001 From: guillaumebarat Date: Thu, 14 Nov 2024 12:57:41 +1000 Subject: [PATCH] fix #47 add availability restriction --- classes/output/courseformat/content.php | 3 +++ templates/course_topic.mustache | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/classes/output/courseformat/content.php b/classes/output/courseformat/content.php index ea6cccb..48209bd 100644 --- a/classes/output/courseformat/content.php +++ b/classes/output/courseformat/content.php @@ -324,6 +324,9 @@ public function print_single_section_page(renderer_base $output): stdClass { $templatecontext->progress = $sectioncompletion->percent; $templatecontext->progresstitle = get_string('progresstitle:section', 'format_twocol'); $templatecontext->headerbackcolor = $headerbackcolor; + $availableclass = $format->get_output_classname('content\\section\\availability'); + $availability = new $availableclass($format, $thissection); + $templatecontext->hasavailability = $availability->export_for_template($output); if ($imagenum !== 0) { $imagenum--; diff --git a/templates/course_topic.mustache b/templates/course_topic.mustache index c9975fc..2beb501 100644 --- a/templates/course_topic.mustache +++ b/templates/course_topic.mustache @@ -49,6 +49,10 @@ {{{navlinkprevious}}} {{{navlinknext}}} +
+ {{$ core_courseformat/local/content/section/availability }} + {{> core_courseformat/local/content/section/availability }} + {{/ core_courseformat/local/content/section/availability }}