Fix error in temlate engine
authorSebastian Teumert <sebastian.teumert@gmx.de>
Tue, 10 Mar 2015 10:30:38 +0000 (11:30 +0100)
committerSebastian Teumert <sebastian.teumert@gmx.de>
Tue, 10 Mar 2015 10:30:38 +0000 (11:30 +0100)
This patch fixes an error in the TemplateScriptingCompiler. Instead of
using `WCF::getTPL()` now the engine which is passed during
initialization is used. This allows one to compile e.g. frontend
templates in the ACP and generally removes an unecessary coupling from
the engine.

wcfsetup/install/files/lib/system/template/TemplateScriptingCompiler.class.php

index 8a431d5558d41ace5e53031ba3d2b84744ffa512..7a4dfa3390c0b4c1318482fef934d858151f89a4 100644 (file)
@@ -798,8 +798,8 @@ class TemplateScriptingCompiler {
                        }
                        if (!empty($phpCode)) $phpCode = "<?php\n".$phpCode."\n?>";
                        
-                       $sourceFilename = WCF::getTPL()->getSourceFilename($templateName, $application);
-                       $metaDataFilename = WCF::getTPL()->getMetaDataFilename($templateName);
+                       $sourceFilename = $this->template->getSourceFilename($templateName, $application);
+                       $metaDataFilename = $this->template->getMetaDataFilename($templateName);
                        
                        $data = $this->compileString($templateName, file_get_contents($sourceFilename), array(
                                'application' => $application,