. /** * Renderers to align Moodle's HTML with that expected by Bootstrap * * @package theme * @subpackage bootstrap * @copyright © 2014-onwards G J Barnard. * @author G J Barnard - gjbarnard at gmail dot com and {@link http://moodle.org/user/profile.php?id=442195} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); include_once($CFG->dirroot . "/course/format/topics/renderer.php"); class theme_bootstrap_format_topics_renderer extends format_topics_renderer { /** * Generate the content to displayed on the left 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 section page * @return string HTML to output. */ protected function section_left_content($section, $course, $onsectionpage) { $o = $this->output->spacer(); if ($section->section != 0) { // Only in the non-general sections. if (course_get_format($course)->is_section_current($section)) { $o .= get_accesshide(get_string('currentsection', 'format_'.$course->format)); } } return $o; } } include_once($CFG->dirroot . "/course/format/weeks/renderer.php"); class theme_bootstrap_format_weeks_renderer extends format_weeks_renderer { /** * Generate the content to displayed on the left 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 section page * @return string HTML to output. */ protected function section_left_content($section, $course, $onsectionpage) { $o = $this->output->spacer(); if ($section->section != 0) { // Only in the non-general sections. if (course_get_format($course)->is_section_current($section)) { $o .= get_accesshide(get_string('currentsection', 'format_'.$course->format)); } } return $o; } }