MDL-52366 themes: check for templates in themedir

This commit is contained in:
Rafal Domagalski
2016-12-19 18:13:14 +01:00
committed by David Mudrák
parent 84ad325c69
commit ec3260126f
@@ -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/';