From b7f902b5b387c8db6c67b3b440929c1201826366 Mon Sep 17 00:00:00 2001 From: Rafal Domagalski Date: Fri, 16 Dec 2016 13:32:08 +0100 Subject: [PATCH] MDL-52366 themes: check for templates in themedir --- lib/classes/output/mustache_template_finder.php | 6 ++++++ 1 file changed, 6 insertions(+) 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/';