Skip to content

Commit

Permalink
Fix 'course_section_cm_availability'.
Browse files Browse the repository at this point in the history
  • Loading branch information
gjb2048 committed Jun 8, 2024
1 parent acc3984 commit 3d39e20
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions classes/course_renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,28 @@ public function vsf_availability_info($text, $additionalclasses = '') {
return $this->render_from_template('format_vsf/availability_info', $data);
}

/**
* Renders HTML to show course module availability information (for someone who isn't allowed
* to see the activity itself, or for staff)
*
* @deprecated since Moodle 4.0 MDL-72656 - please do not use this function any more.
* @param cm_info $mod
* @param array $displayoptions
* @return string
*/
public function course_section_cm_availability(cm_info $mod, $displayoptions = []) {
$format = course_get_format($mod->course);

$availabilityclass = $format->get_output_classname('content\\cm\\availability');
$availability = new $availabilityclass(
$format,
$mod->get_section_info(),
$mod,
);
$renderer = $format->get_renderer($this->page);
return $renderer->render($availability);
}

/**
* Renders HTML to display one course module for display within a section.
*
Expand Down

0 comments on commit 3d39e20

Please sign in to comment.