From 2b2dcab6a56673279d579100e112519a1906febe Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Thu, 11 Jul 2024 17:22:13 +0200 Subject: [PATCH] MDL-82385 course: Wrap section name in span in core_course_get_contents --- course/externallib.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/course/externallib.php b/course/externallib.php index c7f7911e520..3e0f1c50203 100644 --- a/course/externallib.php +++ b/course/externallib.php @@ -200,6 +200,10 @@ class core_course_external extends external_api { $sectionvalues = array(); $sectionvalues['id'] = $section->id; $sectionvalues['name'] = get_section_name($course, $section); + // Temporary hack to be able to hide the subsections in certain app versions. + if (!empty($section->component) && \core_useragent::is_moodle_app()) { + $sectionvalues['name'] = html_writer::span($sectionvalues['name'], 'course-' . $section->component); + } $sectionvalues['visible'] = $section->visible; $options = (object) array('noclean' => true);