Skip to content

Commit

Permalink
M4.4 fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
gjb2048 committed May 8, 2024
1 parent 4c6a6cf commit 2b478f4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
11 changes: 8 additions & 3 deletions classes/course_renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function course_section_cm_text_vsf(cm_info $mod, $vsfavailability = fals
$availabilityinfo = $this->process_availability($availabilityinfo);
$avcontent .= html_writer::start_tag('span', ['class' => 'vsfai', 'title' => $availabilityinfo['text']]);
$avcontent .= html_writer::empty_tag('img', ['src' => $this->image_url('access_transparent', 'format_vsf'),
'alt' => '', 'role' => 'presentation']);
'alt' => '']);
$avcontent .= html_writer::end_tag('span');
}
}
Expand Down Expand Up @@ -489,7 +489,12 @@ public function course_section_label_cm_vsf($course, &$completioninfo,
if ($sectionreturn) {
$format->set_section_number($sectionreturn);
}
$section = $modinfo->get_section_info($format->get_section_number());
$sectionnum = $format->get_sectionnum();
if (is_null($sectionnum)) {
// Section 0.
$sectionnum = 0;
}
$section = $modinfo->get_section_info($sectionnum);

$cmclass = $format->get_output_classname('content\\cm');
$cm = new $cmclass($format, $section, $mod, $displayoptions);
Expand Down Expand Up @@ -608,7 +613,7 @@ protected function course_section_cm_image(cm_info $mod) {
$class .= ' custom';
}
$image = html_writer::img($srcurl, $mod->get_formatted_name(),
['class' => $class, 'alt' => ' ']);
['class' => $class, 'alt' => '']);
return html_writer::tag('span',
$image, ['class' => 'mdl-align vsf-icon']);
}
Expand Down
2 changes: 1 addition & 1 deletion classes/output/courseformat/content/cm/controlmenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ protected function cm_control_items() {

$format = $this->format;
$mod = $this->mod;
$sectionreturn = $format->get_section_number();
$sectionreturn = $format->get_sectionnum();
if (!empty($this->displayoptions['disableindentation']) || !$format->uses_indentation()) {
$indent = -1;
} else {
Expand Down
2 changes: 1 addition & 1 deletion classes/output/courseformat/content/section/cmlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function export_for_template(\renderer_base $output): \stdClass {

// Section information for the 'activitychooserbuttonactivity'.
$data->num = $this->section->section ?? '0';
$data->sectionreturn = $this->format->get_section_number();
$data->sectionreturn = $this->format->get_sectionnum();

return $data;
}
Expand Down
7 changes: 6 additions & 1 deletion classes/output/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,12 @@ public function single_section_page($course, $displaysection) {
}

$sectionnavigationclass = $this->courseformat->get_output_classname('content\\sectionnavigation');
$sectionnavigation = new $sectionnavigationclass($this->courseformat, $this->courseformat->get_section_number(), $this);
$sectionnum = $this->courseformat->get_sectionnum();
if (is_null($sectionnum)) {
// Section 0.
$sectionnum = 0;
}
$sectionnavigation = new $sectionnavigationclass($this->courseformat, $sectionnum, $this);
$sectionselectorclass = $this->courseformat->get_output_classname('content\\sectionselector');
$sectionselector = new $sectionselectorclass($this->courseformat, $sectionnavigation);
// Do now so that the selection selector export, exports the navigation data.
Expand Down

0 comments on commit 2b478f4

Please sign in to comment.