Fixed bug #16386: Optimize stdWrap usage for TypoScript content elements PHP_SCRIPT_I...
authorSteffen Kamper <info@sk-typo3.de>
Mon, 27 Dec 2010 16:28:24 +0000 (16:28 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Mon, 27 Dec 2010 16:28:24 +0000 (16:28 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9913 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/cms/tslib/class.tslib_content.php
typo3/sysext/cms/tslib/content/class.tslib_content_phpscriptinternal.php

index c2cfefc..2406153 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2010-12-27  Steffen Kamper  <steffen@typo3.org>
 
+       * Fixed bug #16386: Optimize stdWrap usage for TypoScript content elements PHP_SCRIPT_INT and PHP_SCRIPT_EXT (Thanks to Jo Hasenau)
        * Fixed bug #16404: Optimize stdWrap usage for TypoScript content element SWFOBJECT (Thanks to Jo Hasenau)
        * Fixed bug #16406: Optimize stdWrap usage for TypoScript content element SEARCHRESULT (Thanks to Jo Hasenau)
        * Fixed bug #16385: Optimize stdWrap usage for TypoScript content element PHP_SCRIPT (Thanks to Jo Hasenau)
index 653aa08..b3ea2ee 100644 (file)
@@ -1127,7 +1127,8 @@ class tslib_cObj {
         */
        function PHP_SCRIPT($conf, $ext = '') {
                if ($ext === 'INT' || $ext === 'EXT') {
-                       return $this->getContentObject('PHP_SCRIPT_INT')->render($conf, $ext);
+                       $conf['scriptSuffix'] = $ext;
+                       return $this->getContentObject('PHP_SCRIPT_INT')->render($conf);
                } else {
                        return $this->getContentObject('PHP_SCRIPT')->render($conf);
                }
index 26e8771..0fb86c0 100644 (file)
@@ -41,8 +41,15 @@ class tslib_content_PhpScriptInternal extends tslib_content_Abstract {
         * @param       array           Array of TypoScript properties
         * @return      string          Output
         */
-       public function render($conf = array(), $ext) {
-               $incFile = $GLOBALS['TSFE']->tmpl->getFileName($conf['file']);
+       public function render($conf = array()) {
+               $ext = $conf['scriptSuffix'];
+               unset($conf['scriptSuffix']);
+
+               $file = isset($conf['file.'])
+                       ? $this->cObj->stdWrap($conf['file'], $conf['file.'])
+                       : $conf['file'];
+
+               $incFile = $GLOBALS['TSFE']->tmpl->getFileName($file);
                $content = '';
                if ($incFile && $GLOBALS['TSFE']->checkFileInclude($incFile)) {
                        $substKey = $ext . '_SCRIPT.' . $GLOBALS['TSFE']->uniqueHash();
@@ -56,6 +63,11 @@ class tslib_content_PhpScriptInternal extends tslib_content_Abstract {
                                $GLOBALS['TSFE']->config[$ext . 'incScript'][$substKey]['data'] = $this->cObj->data;
                        }
                }
+
+               if (isset($conf['stdWrap.'])) {
+                       $content = $this->cObj->stdWrap($content, $conf['stdWrap.']);
+               }
+
                return $content;
        }