diff --git a/lib/classes/output/mustache_template_finder.php b/lib/classes/output/mustache_template_finder.php index baaa6050198..397fa761ed1 100644 --- a/lib/classes/output/mustache_template_finder.php +++ b/lib/classes/output/mustache_template_finder.php @@ -76,10 +76,16 @@ class mustache_template_finder { // First check the theme. $dirs[] = $CFG->dirroot . '/theme/' . $themename . '/templates/' . $component . '/'; + if (isset($CFG->themedir)) { + $dirs[] = $CFG->themedir . '/' . $themename . '/templates/' . $component . '/'; + } // Now check the parent themes. // Search each of the parent themes second. foreach ($parents as $parent) { $dirs[] = $CFG->dirroot . '/theme/' . $parent . '/templates/' . $component . '/'; + if (isset($CFG->themedir)) { + $dirs[] = $CFG->themedir . '/' . $parent . '/templates/' . $component . '/'; + } } $dirs[] = $compdirectory . '/templates/';