diff --git a/renderer.php b/renderer.php index 98b497d3..91886141 100644 --- a/renderer.php +++ b/renderer.php @@ -520,10 +520,12 @@ protected function section_header($section, $course, $onsectionpage, $sectionret if ($hasnamesecpg) { $headingclass = 'section-title'; + $title = $this->section_title($section, $course); } else { $headingclass = 'accesshide'; + $title = $this->section_title_without_link($section, $course); } - $o .= $this->output->heading($this->section_title($section, $course), 3, $headingclass, "sectionid-{$section->id}-title"); + $o .= $this->output->heading($title, 3, $headingclass, "sectionid-{$section->id}-title"); $o .= $this->section_availability($section); $o .= html_writer::start_tag('div', array('class' => 'summary')); $o .= $this->format_summary_text($section); diff --git a/tests/courseformatrenderer_test.php b/tests/courseformatrenderer_test.php index 33e70839..9a1e606a 100644 --- a/tests/courseformatrenderer_test.php +++ b/tests/courseformatrenderer_test.php @@ -209,7 +209,8 @@ public function test_section_header() { $onsectionpage = false; $theclass = self::call_method($this->outputus, 'section_header', array($section, $this->course, $onsectionpage)); - $thevalue = '
  • '; + $thevalue = '
  • id.'-title" data-sectionid="1">'; $thevalue .= '
    1
    '; $thevalue .= '
    '; $thevalue .= '
  • '; + $thevalue = '
  • id.'-title" data-sectionid="1">'; $thevalue .= '
    '; $thevalue .= '
    '; $thevalue .= '

    Section 1

    '; @@ -247,7 +249,8 @@ public function test_section_hidden() { $section = $this->courseformat->get_section(1); $theclass = self::call_method($this->outputus, 'section_hidden', array($section, null)); - $thevalue = '