From f5aabcd47f20a0b87acf9221bfba545f60bc9e40 Mon Sep 17 00:00:00 2001 From: "Uwe.Tews" Date: Thu, 18 Jun 2009 18:51:21 +0000 Subject: [PATCH] - added $smarty.current_dir which returns the current working directory --- change_log.txt | 1 + libs/sysplugins/internal.compile_internal_smarty_var.php | 3 +++ 2 files changed, 4 insertions(+) diff --git a/change_log.txt b/change_log.txt index 3a6915ec..c34949a4 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,5 +1,6 @@ 06/18/2009 - fixed compilation of block plugins when caching enabled +- added $smarty.current_dir which returns the current working directory 06/14/2009 - fixed array access on super globals diff --git a/libs/sysplugins/internal.compile_internal_smarty_var.php b/libs/sysplugins/internal.compile_internal_smarty_var.php index d8c510d6..72c5e59b 100644 --- a/libs/sysplugins/internal.compile_internal_smarty_var.php +++ b/libs/sysplugins/internal.compile_internal_smarty_var.php @@ -66,6 +66,9 @@ class Smarty_Internal_Compile_Internal_Smarty_Var extends Smarty_Internal_Compil case 'template': $_template_name = $compiler->template->getTemplateFilepath(); return "'$_template_name'"; + case 'current_dir': + $_template_dir_name = dirname($compiler->template->getTemplateFilepath()); + return "'$_template_dir_name'"; case 'version': $_version = Smarty::$_version;