diff options
author | Mario <mario@mariovavti.com> | 2018-08-13 14:06:36 +0200 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2018-08-13 14:06:36 +0200 |
commit | b78c9a2251b3a594a961295accc1f540b6a26958 (patch) | |
tree | 3ea44b597c1ba60eaef01ef155962b351153f4e2 /Zotlabs/Render/SmartyTemplate.php | |
parent | db1a546abaa82472bd9c8b402db6752e2a3869d0 (diff) | |
parent | b436c4a94c86a7b346872b4c92f3c803b1582ed0 (diff) | |
download | volse-hubzilla-b78c9a2251b3a594a961295accc1f540b6a26958.tar.gz volse-hubzilla-b78c9a2251b3a594a961295accc1f540b6a26958.tar.bz2 volse-hubzilla-b78c9a2251b3a594a961295accc1f540b6a26958.zip |
Merge branch 'add-template-overrides' into 'dev'
Add template overrides
See merge request hubzilla/core!1256
Diffstat (limited to 'Zotlabs/Render/SmartyTemplate.php')
-rwxr-xr-x | Zotlabs/Render/SmartyTemplate.php | 19 |
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 ""; |