Added support for 'application' include-argument
authorAlexander Ebert <ebert@woltlab.com>
Tue, 6 Nov 2012 00:20:50 +0000 (01:20 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 6 Nov 2012 00:20:50 +0000 (01:20 +0100)
wcfsetup/install/files/lib/system/template/TemplateScriptingCompiler.class.php

index 246dc4c9cea4756e842bbb977b38597924d2d27a..2065f7acdf2d5b7991c30cba81e8aa0b5b4221ac 100644 (file)
@@ -753,6 +753,12 @@ class TemplateScriptingCompiler {
                        unset($args['once']);
                }
                
+               $application = '$this->v[\'__APPLICATION\']';
+               if (isset($args['application'])) {
+                       $application = $args['application'];
+                       unset($args['application']);
+               }
+               
                $templateName = substr($file, 1, -1);
                // check for static includes
                if ($sandbox === 'false' && $assignVar === false && $once === false) {
@@ -809,7 +815,7 @@ class TemplateScriptingCompiler {
                        $phpCode .= "ob_start();\n";
                }
                
-               $phpCode .= '$this->includeTemplate('.$file.', $this->v[\'__APPLICATION\'], array('.$argString.'), ('.$sandbox.' ? 1 : 0));'."\n";
+               $phpCode .= '$this->includeTemplate('.$file.', '.$application.', array('.$argString.'), ('.$sandbox.' ? 1 : 0));'."\n";
                
                if ($assignVar !== false) {
                        $phpCode .= '$this->'.($append ? 'append' : 'assign').'('.$assignVar.', ob_get_clean());'."\n";