From 9fcd74f470f596fb85727af561d86404b59dfc93 Mon Sep 17 00:00:00 2001 From: Fabrixxm Date: Wed, 3 Feb 2016 14:01:37 +0100 Subject: [PATCH] Pass App class instace to all templates via "$APP" variable --- include/friendica_smarty.php | 2 ++ include/text.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/friendica_smarty.php b/include/friendica_smarty.php index 99dc12bf8d..9ba2d2a744 100644 --- a/include/friendica_smarty.php +++ b/include/friendica_smarty.php @@ -60,6 +60,8 @@ class FriendicaSmartyEngine implements ITemplateEngine { $template = $s; $s = new FriendicaSmarty(); } + + $r['$APP'] = get_app(); // "middleware": inject variables into templates $arr = array( diff --git a/include/text.php b/include/text.php index 4f3af5aee8..c7681a4d58 100644 --- a/include/text.php +++ b/include/text.php @@ -22,7 +22,7 @@ function replace_macros($s,$r) { $a = get_app(); // pass $baseurl to all templates - $r['$baseurl'] = z_root(); + $r['$baseurl'] = $a->get_baseurl(); $t = $a->template_engine(); -- 2.39.5