From 6500c32362a3342fca59c2b54cba13961987c5ff Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Sat, 3 Feb 2018 11:11:00 +0100 Subject: [PATCH] added missing constant --- src/Render/FriendicaSmartyEngine.php | 120 ++++++++++++++------------- 1 file changed, 61 insertions(+), 59 deletions(-) diff --git a/src/Render/FriendicaSmartyEngine.php b/src/Render/FriendicaSmartyEngine.php index 2cfce760a..6fd51cf5d 100644 --- a/src/Render/FriendicaSmartyEngine.php +++ b/src/Render/FriendicaSmartyEngine.php @@ -1,59 +1,61 @@ -ERROR: folder view/smarty3/ must be writable by webserver."; - killme(); - } - } - - // ITemplateEngine interface - public function replaceMacros($s, $r) - { - $template = ''; - if (gettype($s) === 'string') { - $template = $s; - $s = new FriendicaSmarty(); - } - - $r['$APP'] = get_app(); - - // "middleware": inject variables into templates - $arr = [ - "template" => basename($s->filename), - "vars" => $r - ]; - Addon::callHooks("template_vars", $arr); - $r = $arr['vars']; - - foreach ($r as $key => $value) { - if ($key[0] === '$') { - $key = substr($key, 1); - } - - $s->assign($key, $value); - } - return $s->parsed($template); - } - - public function getTemplateFile($file, $root = '') - { - $a = get_app(); - $template_file = get_template_file($a, SMARTY3_TEMPLATE_FOLDER . '/' . $file, $root); - $template = new FriendicaSmarty(); - $template->filename = $template_file; - - return $template; - } -} +ERROR: folder view/smarty3/ must be writable by webserver."; + killme(); + } + } + + // ITemplateEngine interface + public function replaceMacros($s, $r) + { + $template = ''; + if (gettype($s) === 'string') { + $template = $s; + $s = new FriendicaSmarty(); + } + + $r['$APP'] = get_app(); + + // "middleware": inject variables into templates + $arr = [ + "template" => basename($s->filename), + "vars" => $r + ]; + Addon::callHooks("template_vars", $arr); + $r = $arr['vars']; + + foreach ($r as $key => $value) { + if ($key[0] === '$') { + $key = substr($key, 1); + } + + $s->assign($key, $value); + } + return $s->parsed($template); + } + + public function getTemplateFile($file, $root = '') + { + $a = get_app(); + $template_file = get_template_file($a, SMARTY3_TEMPLATE_FOLDER . '/' . $file, $root); + $template = new FriendicaSmarty(); + $template->filename = $template_file; + + return $template; + } +}