From b6894ff0777299e18a64534954a4b0a3cd14106a Mon Sep 17 00:00:00 2001 From: notsolucky <013715@gmail.com> Date: Fri, 23 Jul 2021 12:05:21 +0200 Subject: [PATCH] use own instead of current theme settings for slides Creating a child theme from the Klass theme broke the header slideshow as it tried to load the slide images from the current theme settings. --- lib.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib.php b/lib.php index c819ad1..fa2aa7c 100644 --- a/lib.php +++ b/lib.php @@ -343,12 +343,16 @@ function get_logo_url($type = 'header') { */ function theme_klass_render_slideimg($p, $sliname) { global $PAGE, $OUTPUT; + static $theme; + if (empty($theme)) { + $theme = theme_config::load('klass'); + } $nos = theme_klass_get_setting('numberofslides'); $i = $p % 3; $slideimage = $OUTPUT->image_url('home/slide'.$i, 'theme'); // Get slide image or fallback to default. if (theme_klass_get_setting($sliname)) { - $slideimage = $PAGE->theme->setting_file_url($sliname , $sliname); + $slideimage = $theme->setting_file_url($sliname , $sliname); } return $slideimage; } @@ -435,4 +439,4 @@ function theme_klass_lang($key = '') { } else { return $key; } -} \ No newline at end of file +}