From dd654b976691d5091070631c5e64979cd2772a6f Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 24 Aug 2016 13:11:01 -0700 Subject: provide a mechanism for global template values (macro replacements that are available to all templates). There's a strong likelihood this list will increase but we may wish to actively prevent it from mushrooming out of control. --- Zotlabs/Render/SmartyTemplate.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Zotlabs') diff --git a/Zotlabs/Render/SmartyTemplate.php b/Zotlabs/Render/SmartyTemplate.php index 532d6e42f..b7e68c1bc 100755 --- a/Zotlabs/Render/SmartyTemplate.php +++ b/Zotlabs/Render/SmartyTemplate.php @@ -27,6 +27,12 @@ class SmartyTemplate implements TemplateEngine { public function replace_macros($s, $r) { $template = ''; + + // these are available for use in all templates + + $r['$z_baseurl'] = z_root(); + $r['$z_server_role'] = \Zotlabs\Lib\System::get_server_role(); + if(gettype($s) === 'string') { $template = $s; $s = new SmartyInterface(); -- cgit v1.2.3