aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Render
diff options
context:
space:
mode:
authorredmatrix <mike@macgirvin.com>2016-08-24 13:11:01 -0700
committerredmatrix <mike@macgirvin.com>2016-08-24 13:11:01 -0700
commitdd654b976691d5091070631c5e64979cd2772a6f (patch)
tree90875262cf8fe1aecbf6f41cf1270f47481e10ae /Zotlabs/Render
parent4c840d70a494dae62a856ed91f9039eb16bc51ee (diff)
downloadvolse-hubzilla-dd654b976691d5091070631c5e64979cd2772a6f.tar.gz
volse-hubzilla-dd654b976691d5091070631c5e64979cd2772a6f.tar.bz2
volse-hubzilla-dd654b976691d5091070631c5e64979cd2772a6f.zip
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.
Diffstat (limited to 'Zotlabs/Render')
-rwxr-xr-xZotlabs/Render/SmartyTemplate.php6
1 files changed, 6 insertions, 0 deletions
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();