Skip to content

Commit

Permalink
fix #47 add availability restriction
Browse files Browse the repository at this point in the history
  • Loading branch information
gbarat87 committed Nov 14, 2024
1 parent 35a265f commit 464606c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions classes/output/courseformat/content.php
Original file line number Diff line number Diff line change
Expand Up @@ -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--;
Expand Down
4 changes: 4 additions & 0 deletions templates/course_topic.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
<span class="mdl-left">{{{navlinkprevious}}}</span>
<span class="mdl-right">{{{navlinknext}}}</span>
</div>
<div class="{{#hasavailability}}description{{/hasavailability}} my-3" data-for="sectioninfo">
{{$ core_courseformat/local/content/section/availability }}
{{> core_courseformat/local/content/section/availability }}
{{/ core_courseformat/local/content/section/availability }}
<ul class="twocol">
{{{sectionheader}}}
{{#sectioncmlist}}
Expand Down

0 comments on commit 464606c

Please sign in to comment.