From a65ca4c79697807f5222e30ec4820062f6f1330a Mon Sep 17 00:00:00 2001 From: rtschu Date: Fri, 2 Oct 2020 21:58:32 +0200 Subject: [PATCH] adds support for the progresstopics format --- .../output/format_progresstopics_renderer.php | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 classes/output/format_progresstopics_renderer.php diff --git a/classes/output/format_progresstopics_renderer.php b/classes/output/format_progresstopics_renderer.php new file mode 100644 index 0000000..5121f1c --- /dev/null +++ b/classes/output/format_progresstopics_renderer.php @@ -0,0 +1,82 @@ +. + +/** + * Overriden functions for format_topics_renderer and format_section_renderer_base. + * + * @package theme_wwu2019 + * @copyright 2020 Justus Dieckmann WWU + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +namespace theme_wwu2019\output; + +use html_writer; +use stdClass; + +defined('MOODLE_INTERNAL') || die(); +require_once($CFG->dirroot . '/course/format/topics/renderer.php'); + +/** + * Overriden functions for format_topics_renderer and format_section_renderer_base. + * + * @copyright 2020 Justus Dieckmann WWU + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class format_progresstopics_renderer extends \format_progresstopics_renderer { + use wwu_format_trait; + + /** + * Generate the display of the header part of a section before + * course modules are included + * + * @param stdClass $section The course_section entry from DB + * @param stdClass $course The course entry from DB + * @param bool $onsectionpage true if being printed on a single-section page + * @param int $sectionreturn The section to return to after an action + * @return string HTML to output. + */ + protected function section_header($section, $course, $onsectionpage, $sectionreturn = null) { + return $this->wwu_section_header($section, $course, $onsectionpage); + } + + /** + * Generate a summary of a section for display on the 'course index page' + * + * @param stdClass $section The course_section entry from DB + * @param stdClass $course The course entry from DB + * @param array $mods (argument not used) + * @return string HTML to output. + */ + protected function section_summary($section, $course, $mods) { + return $this->wwu_section_summary($section, $course, $mods); + } + + /** + * Output the html for a single section page . + * + * @param stdClass $course The course entry from DB + * @param array $sections (argument not used) + * @param array $mods (argument not used) + * @param array $modnames (argument not used) + * @param array $modnamesused (argument not used) + * @param int $displaysection The section number in the course which is being displayed + */ + public function print_single_section_page($course, $sections, $mods, $modnames, $modnamesused, $displaysection) { + $this->wwu_print_single_section_page($course, $sections, $mods, $modnames, $modnamesused, $displaysection); + } + +}