diff options
Diffstat (limited to 'Zotlabs/Render/SmartyTemplate.php')
-rwxr-xr-x | Zotlabs/Render/SmartyTemplate.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Zotlabs/Render/SmartyTemplate.php b/Zotlabs/Render/SmartyTemplate.php index 532d6e42f..7abe0731c 100755 --- a/Zotlabs/Render/SmartyTemplate.php +++ b/Zotlabs/Render/SmartyTemplate.php @@ -15,7 +15,10 @@ class SmartyTemplate implements TemplateEngine { ? \App::$config['system']['smarty3_folder'] : ''); if (!$basecompiledir) $basecompiledir = str_replace('Zotlabs','',dirname(__dir__)) . "/" . TEMPLATE_BUILD_PATH; if (!is_dir($basecompiledir)) { - echo "<b>ERROR:</b> folder <tt>$basecompiledir</tt> does not exist."; killme(); + @os_mkdir(TEMPLATE_BUILD_PATH, STORAGE_DEFAULT_PERMISSIONS, true); + if (!is_dir($basecompiledir)) { + echo "<b>ERROR:</b> folder <tt>$basecompiledir</tt> does not exist."; killme(); + } } if(!is_writable($basecompiledir)){ echo "<b>ERROR:</b> folder <tt>$basecompiledir</tt> must be writable by webserver."; killme(); @@ -27,6 +30,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(); |