]> git.mxchange.org Git - friendica.git/blobdiff - include/friendica_smarty.php
The url detection in BBCode is too greedy
[friendica.git] / include / friendica_smarty.php
index f95bb69aaae2ef292f6cd79f209d55b09b82589a..a7d153e30963b98de08e123a17508d7a6a2d9223 100644 (file)
@@ -1,9 +1,8 @@
 <?php
 
+use Friendica\Core\Addon;
 use Friendica\Render\ITemplateEngine;
 
-require_once "include/plugin.php";
-
 define('SMARTY3_TEMPLATE_FOLDER', 'templates');
 
 class FriendicaSmarty extends Smarty
@@ -19,10 +18,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 = array('theme' => "view/theme/$theme/" . SMARTY3_TEMPLATE_FOLDER . "/");
+               $template_dirs = ['theme' => "view/theme/$theme/" . SMARTY3_TEMPLATE_FOLDER . "/"];
                if (x($a->theme_info, "extends"))
-                       $template_dirs = $template_dirs + array('extends' => "view/theme/" . $a->theme_info["extends"] . "/" . SMARTY3_TEMPLATE_FOLDER . "/");
-               $template_dirs = $template_dirs + array('base' => "view/" . SMARTY3_TEMPLATE_FOLDER . "/");
+                       $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);
 
                $this->setCompileDir('view/smarty3/compiled/');
@@ -70,11 +69,11 @@ class FriendicaSmartyEngine implements ITemplateEngine
                $r['$APP'] = get_app();
 
                // "middleware": inject variables into templates
-               $arr = array(
+               $arr = [
                        "template" => basename($s->filename),
                        "vars" => $r
-               );
-               call_hooks("template_vars", $arr);
+               ];
+               Addon::callHooks("template_vars", $arr);
                $r = $arr['vars'];
 
                foreach ($r as $key => $value) {