Fixed bug #11216: getModuleTemplate is prepended with backPath always. Now syntax...
authorSteffen Kamper <info@sk-typo3.de>
Sun, 31 May 2009 20:20:41 +0000 (20:20 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Sun, 31 May 2009 20:20:41 +0000 (20:20 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@5521 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/template.php

index 29d0fc7..34ebc38 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-05-28  Steffen Kamper  <info@sk-typo3.de>
+
+       * Fixed bug #11216: getModuleTemplate is prepended with backPath always. Now syntax EXT:extkey/templatefile is supported.
+
 2009-05-31  Oliver Hader  <oliver@typo3.org>
 
        * Fixed bug #11176: LogicException is thrown if spl_autoload() fails with PHP 5.2.0
index af86a31..8d5f5cb 100644 (file)
@@ -1826,7 +1826,8 @@ $str.=$this->docBodyTagBegin().
 
        /**
         * Function to load a HTML template file with markers.
-        *
+        * When calling from own extension, use  syntax getHtmlTemplate('EXT:extkey/template.html')
+        * 
         * @param       string          tmpl name, usually in the typo3/template/ directory
         * @return      string          HTML of template
         */
@@ -1834,7 +1835,12 @@ $str.=$this->docBodyTagBegin().
                if ($GLOBALS['TBE_STYLES']['htmlTemplates'][$filename]) {
                        $filename = $GLOBALS['TBE_STYLES']['htmlTemplates'][$filename];
                }
-               return ($filename ? t3lib_div::getURL(t3lib_div::resolveBackPath($this->backPath . $filename)) : '');
+               if (substr($filename,0,4) != 'EXT:') {
+                       $filename = t3lib_div::resolveBackPath($this->backPath . $filename);
+               } else {
+                       $filename = t3lib_div::getFileAbsFileName($filename, true, true);
+               }
+               return t3lib_div::getURL($filename);
        }
 
        /**