From: Hypolite Petovan Date: Fri, 2 Feb 2018 12:47:42 +0000 (-0500) Subject: Fix formatting in Render/FriendicaSmarty* X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=03c1f2cbf8d2bc2f6deb53675aea16f56ab8c2e5;p=friendica.git Fix formatting in Render/FriendicaSmarty* --- diff --git a/src/Render/FriendicaSmarty.php b/src/Render/FriendicaSmarty.php index b863576127..b147d7e81b 100644 --- a/src/Render/FriendicaSmarty.php +++ b/src/Render/FriendicaSmarty.php @@ -27,8 +27,10 @@ class FriendicaSmarty extends Smarty // setTemplateDir can be set to an array, which Smarty will parse in order. // The order is thus very important here $template_dirs = ['theme' => "view/theme/$theme/" . SMARTY3_TEMPLATE_FOLDER . "/"]; - if (x($a->theme_info, "extends")) + if (x($a->theme_info, "extends")) { $template_dirs = $template_dirs + ['extends' => "view/theme/" . $a->theme_info["extends"] . "/" . SMARTY3_TEMPLATE_FOLDER . "/"]; + } + $template_dirs = $template_dirs + ['base' => "view/" . SMARTY3_TEMPLATE_FOLDER . "/"]; $this->setTemplateDir($template_dirs); diff --git a/src/Render/FriendicaSmartyEngine.php b/src/Render/FriendicaSmartyEngine.php index a565f3ad36..2cfce760ad 100644 --- a/src/Render/FriendicaSmartyEngine.php +++ b/src/Render/FriendicaSmartyEngine.php @@ -41,6 +41,7 @@ class FriendicaSmartyEngine implements ITemplateEngine if ($key[0] === '$') { $key = substr($key, 1); } + $s->assign($key, $value); } return $s->parsed($template); @@ -52,6 +53,7 @@ class FriendicaSmartyEngine implements ITemplateEngine $template_file = get_template_file($a, SMARTY3_TEMPLATE_FOLDER . '/' . $file, $root); $template = new FriendicaSmarty(); $template->filename = $template_file; + return $template; } }