$s = new FriendicaSmarty();
}
- $r['$APP'] = get_app();
+ $r['$APP'] = \get_app();
// "middleware": inject variables into templates
$arr = [
public function getTemplateFile($file, $root = '')
{
- $a = get_app();
+ $a = \get_app();
$template = new FriendicaSmarty();
// Make sure $root ends with a slash /
if (file_exists("{$root}view/theme/$theme/$filename")) {
$template_file = "{$root}view/theme/$theme/$filename";
- } elseif (x($a->theme_info, 'extends') && file_exists(sprintf('%sview/theme/%s}/%s', $root, $a->theme_info['extends'], $filename))) {
+ } elseif (!empty($a->theme_info['extends']) && file_exists(sprintf('%sview/theme/%s}/%s', $root, $a->theme_info['extends'], $filename))) {
$template_file = sprintf('%sview/theme/%s}/%s', $root, $a->theme_info['extends'], $filename);
} elseif (file_exists("{$root}/$filename")) {
$template_file = "{$root}/$filename";