Skip to content

Commit 57b88a5

Browse files
authored
Use SYS_TEMPLATE_PATH to find template file
1 parent 079561b commit 57b88a5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

main/inc/lib/template.lib.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,12 +489,12 @@ public function set_header($status)
489489
*/
490490
public static function findTemplateFilePath($name)
491491
{
492-
$sysCodePath = api_get_path(SYS_CODE_PATH);
492+
$sysTemplatePath = api_get_path(SYS_TEMPLATE_PATH);
493493

494494
// Check if the tpl file is present in the main/template/overrides/ dir
495495
// Overrides is a special directory meant for temporary template
496496
// customization. It must be taken into account before anything else
497-
if (is_readable($sysCodePath."template/overrides/$name")) {
497+
if (is_readable($sysTemplatePath."overrides/$name")) {
498498
return "overrides/$name";
499499
}
500500

@@ -504,7 +504,7 @@ public static function findTemplateFilePath($name)
504504
// file, and if not found, go for the same file in the default template
505505
if ($defaultFolder && $defaultFolder != 'default') {
506506
// Avoid missing template error, use the default file.
507-
if (file_exists($sysCodePath."template/$defaultFolder/$name")) {
507+
if (file_exists($sysTemplatePath."$defaultFolder/$name")) {
508508
return "$defaultFolder/$name";
509509
}
510510
}

0 commit comments

Comments
 (0)