Fixed bug #16197: Optimize stdWrap usage for TypoScript content element FILE (Thanks...
authorSteffen Kamper <info@sk-typo3.de>
Thu, 4 Nov 2010 00:20:33 +0000 (00:20 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Thu, 4 Nov 2010 00:20:33 +0000 (00:20 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9265 709f56b5-9817-0410-a4d7-c38de5d9e867

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

index 8d1a1fb..95f61d5 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2010-11-03  Steffen Kamper  <steffen@typo3.org>
 
+       * Fixed bug #16197: Optimize stdWrap usage for TypoScript content element FILE (Thanks to Jo Hasenau)
        * Fixed bug #16199: Optimize stdWrap usage for TypoScript content element HMENU (Thanks to Jo Hasenau)
        * Fixed bug #16189: Optimize stdWrap usage for TypoScript content element CLEARGIF (Thanks to Jo Hasenau)
        * Fixed bug #16217: Regression : Typoscript "required" did not work anymore (Thanks to Jo Hasenau)
index b3a5157..428bc95 100644 (file)
@@ -42,11 +42,33 @@ class tslib_content_File extends tslib_content_Abstract {
         * @return      string          Output
         */
        public function render($conf = array()) {
-               $theValue = $this->cObj->fileResource($this->cObj->stdWrap($conf['file'], $conf['file.']), trim($this->cObj->getAltParam($conf, false)));
-               if ($conf['linkWrap']) {
-                       $theValue = $this->cObj->linkWrap($theValue, $conf['linkWrap']);
+
+               $file = isset($conf['file.'])
+                       ? $this->cObj->stdWrap($conf['file'], $conf['file.'])
+                       : $conf['file'];
+
+               $theValue = $this->cObj->fileResource($file, trim($this->cObj->getAltParam($conf, false)));
+
+               $linkWrap =  isset($conf['linkWrap.'])
+                       ? $this->cObj->stdWrap($conf['linkWrap'], $conf['linkWrap.'])
+                       : $conf['linkWrap'];
+               if ($linkWrap) {
+                       $theValue = $this->cObj->linkWrap($theValue, $linkWrap);
+               }
+
+               $wrap =  isset($conf['wrap.'])
+                       ? $this->cObj->stdWrap($conf['wrap'], $conf['wrap.'])
+                       : $conf['wrap'];
+               if ($wrap) {
+                       $theValue = $this->cObj->wrap($theValue, $wrap);
                }
-               return $this->cObj->wrap($theValue, $conf['wrap']);
+
+               if (isset($conf['stdWrap.'])) {
+                       $theValue = $this->cObj->stdWrap($theValue, $conf['stdWrap.']);
+               }
+
+               return $theValue;
+
        }
 
 }
@@ -56,4 +78,4 @@ if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['tslib/conte
        include_once ($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['tslib/content/class.tslib_content_file.php']);
 }
 
-?>
\ No newline at end of file
+?>