]> git.mxchange.org Git - friendica.git/commitdiff
Pass App class instace to all templates via "$APP" variable
authorFabrixxm <fabrix.xm@gmail.com>
Wed, 3 Feb 2016 13:01:37 +0000 (14:01 +0100)
committerFabrixxm <fabrix.xm@gmail.com>
Wed, 3 Feb 2016 13:01:37 +0000 (14:01 +0100)
include/friendica_smarty.php
include/text.php

index 99dc12bf8d9a27c96d6a2b79bed01e9939ad2aa0..9ba2d2a744dcc88fea320253dec337d54345fefd 100644 (file)
@@ -60,6 +60,8 @@ class FriendicaSmartyEngine implements ITemplateEngine {
                        $template = $s;
                        $s = new FriendicaSmarty();
                }
+               
+               $r['$APP'] = get_app();
 
                // "middleware": inject variables into templates
                $arr = array(
index 4f3af5aee813e90aac1b8e10de3cf588c1248fb6..c7681a4d58cb2485a8e34ac623d89440a4a36404 100644 (file)
@@ -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();