From 3d39e205d0fbfaeb65923ed329f4d8d4c0cb19f0 Mon Sep 17 00:00:00 2001 From: Gareth Barnard <1058419+gjb2048@users.noreply.github.com> Date: Sat, 8 Jun 2024 13:15:26 +0100 Subject: [PATCH] Fix 'course_section_cm_availability'. --- classes/course_renderer.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/classes/course_renderer.php b/classes/course_renderer.php index 97c9e89..eea753a 100644 --- a/classes/course_renderer.php +++ b/classes/course_renderer.php @@ -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. *