aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorM.Dent <dentm42@dm42.net>2018-08-12 19:02:11 -0400
committerM.Dent <dentm42@dm42.net>2018-08-12 19:02:11 -0400
commit9402f537b62e80939d09ad602f96460e8ab66b1c (patch)
treeef3c782af648cea09a434ec040801eea7b725565 /Zotlabs
parent759a18685b75e631d5884d610cc3a6fe483b821d (diff)
downloadvolse-hubzilla-9402f537b62e80939d09ad602f96460e8ab66b1c.tar.gz
volse-hubzilla-9402f537b62e80939d09ad602f96460e8ab66b1c.tar.bz2
volse-hubzilla-9402f537b62e80939d09ad602f96460e8ab66b1c.zip
Fix root not added to internationalized template search
Diffstat (limited to 'Zotlabs')
-rwxr-xr-xZotlabs/Render/SmartyTemplate.php19
1 files changed, 11 insertions, 8 deletions
diff --git a/Zotlabs/Render/SmartyTemplate.php b/Zotlabs/Render/SmartyTemplate.php
index ffe58e286..f14d63064 100755
--- a/Zotlabs/Render/SmartyTemplate.php
+++ b/Zotlabs/Render/SmartyTemplate.php
@@ -64,17 +64,20 @@ class SmartyTemplate implements TemplateEngine {
public function get_intltext_template($file, $root='') {
$lang = \App::$language;
-
- if(file_exists("view/$lang/$file"))
- $template_file = "view/$lang/$file";
- elseif(file_exists("view/en/$file"))
- $template_file = "view/en/$file";
- else
- $template_file = theme_include($file,$root);
+ if ($root != '' && substr($root,-1) != '/' ) {
+ $root .= '/';
+ }
+ foreach (Array(
+ $root."view/$lang/$file",
+ $root."view/en/$file",
+ ''
+ ) as $template_file) {
+ if (is_file($template_file)) { break; }
+ }
+ if ($template_file=='') {$template_file = theme_include($file,$root);}
if($template_file) {
$template = new SmartyInterface();
$template->filename = $template_file;
-
return $template;
}
return "";