[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[5198] branches/1.3/LedgerSMB/Template/HTML.pm



Revision: 5198
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5198&view=rev
Author:   einhverfr
Date:     2012-11-16 12:17:36 +0000 (Fri, 16 Nov 2012)
Log Message:
-----------
Correcting previous fix for template caching

Modified Paths:
--------------
    branches/1.3/LedgerSMB/Template/HTML.pm

Modified: branches/1.3/LedgerSMB/Template/HTML.pm
===================================================================
--- branches/1.3/LedgerSMB/Template/HTML.pm	2012-11-16 10:51:22 UTC (rev 5197)
+++ branches/1.3/LedgerSMB/Template/HTML.pm	2012-11-16 12:17:36 UTC (rev 5198)
@@ -120,23 +120,24 @@
 		$source = get_template($parent->{template});
 	}
         my $tempdir;
-        if ($LedgerSMB::Sysconfig::cache_templates){
-            $tempdir = $LedgerSMB::Sysconfig::cache_template_dir;
-        } else {
-            $tempdir = undef;
-        }
-	$template = Template->new({
+        my $arghash = {
 		INCLUDE_PATH => [$parent->{include_path_lang}, $parent->{include_path},'templates/demo','UI/lib'],
                 ENCODING => 'utf8',
 		START_TAG => quotemeta('<?lsmb'),
 		END_TAG => quotemeta('?>'),
 		DELIMITER => ';',
 		TRIM => 1,
-                COMPILE_DIR=> $tempdir,
-                COMPILE_EXT=> 'lttc',
 		DEBUG => ($parent->{debug})? 'dirs': undef,
 		DEBUG_FORMAT => '',
-		}) || throw Error::Simple Template->error(); 
+        }; 
+        if ($LedgerSMB::Sysconfig::cache_templates){
+            $arghash->{COMPILE_EXT} = 'lttc';
+            $arghash->{COMPILE_DIR} = $LedgerSMB::Sysconfig::cache_template_dir;
+        } 
+       
+	$template = Template->new(
+                    $arghash
+		) || throw Error::Simple Template->error(); 
 	if (not $template->process(
 		$source, 
 		{%$cleanvars, %$LedgerSMB::Template::TTI18N::ttfuncs,

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.