Fixed bug #16401: Optimize stdWrap usage for TypoScript content element TEMPLATE...
authorSteffen Kamper <info@sk-typo3.de>
Mon, 27 Dec 2010 16:37:10 +0000 (16:37 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Mon, 27 Dec 2010 16:37:10 +0000 (16:37 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9915 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/cms/tslib/content/class.tslib_content_template.php

index f8be6e5..bb61d56 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2010-12-27  Steffen Kamper  <steffen@typo3.org>
 
+       * Fixed bug #16401: Optimize stdWrap usage for TypoScript content element TEMPLATE (Thanks to Jo Hasenau)
        * Fixed bug #16402: Optimize stdWrap usage for TypoScript content element SVG (Thanks to Jo Hasenau)
        * 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)
index e1c6000..a7df05f 100644 (file)
@@ -47,14 +47,24 @@ class tslib_content_Template extends tslib_content_Abstract {
                $marks = array();
                $wraps = array();
 
-               list ($PRE, $POST) = explode('|', $conf['markerWrap'] ? $conf['markerWrap'] : '### | ###');
+               $markerWrap = isset($conf['markerWrap.'])
+                       ? $this->cObj->stdWrap($conf['markerWrap'], $conf['markerWrap.'])
+                       : $conf['markerWrap'];
+               if(!$markerWrap) {
+                       $markerWrap = '### | ###';
+               }
+
+               list ($PRE, $POST) = explode('|', $markerWrap);
                $POST = trim($POST);
                $PRE = trim($PRE);
 
                        // Getting the content
                $content = $this->cObj->cObjGetSingle($conf['template'], $conf['template.'], 'template');
-               if ($conf['workOnSubpart']) {
-                       $content = $this->cObj->getSubpart($content, $PRE . $conf['workOnSubpart'] . $POST);
+               $workOnSubpart = isset($conf['workOnSubpart.'])
+                       ? $this->cObj->stdWrap($conf['workOnSubpart'], $conf['workOnSubpart.'])
+                       : $conf['workOnSubpart'];
+               if ($workOnSubpart) {
+                       $content = $this->cObj->getSubpart($content, $PRE . $workOnSubpart . $POST);
                }
 
                        // Fixing all relative paths found:
@@ -64,7 +74,10 @@ class tslib_content_Template extends tslib_content_Abstract {
                }
 
                if ($content) {
-                       if ($conf['nonCachedSubst']) { // NON-CACHED:
+                       $nonCachedSubst = isset($conf['nonCachedSubst.'])
+                               ? $this->cObj->stdWrap($conf['nonCachedSubst'], $conf['nonCachedSubst.'])
+                               : $conf['nonCachedSubst'];
+                       if ($nonCachedSubst) { // NON-CACHED:
                                        // Getting marks
                                if (is_array($conf['marks.'])) {
                                        foreach ($conf['marks.'] as $theKey => $theValue) {
@@ -190,7 +203,10 @@ class tslib_content_Template extends tslib_content_Abstract {
                                }
 
                                        // Substitution
-                               if ($conf['substMarksSeparately']) {
+                               $substMarksSeparately = isset($conf['substMarksSeparately.'])
+                                       ? $this->cObj->stdWrap($conf['substMarksSeparately'], $conf['substMarksSeparately.'])
+                                       : $conf['substMarksSeparately'];
+                               if ($substMarksSeparately) {
                                        $content = $this->cObj->substituteMarkerArrayCached($content, array(), $subpartArray, $subpartWraps);
                                        $content = $this->cObj->substituteMarkerArray($content, $markerArray);
                                } else {
@@ -198,6 +214,11 @@ class tslib_content_Template extends tslib_content_Abstract {
                                }
                        }
                }
+
+               if (isset($conf['stdWrap.'])) {
+                       $content = $this->cObj->stdWrap($content, $conf['stdWrap.']);
+               }
+
                return $content;
        }