Added feature #16382: Optimize stdWrap usage for TypoScript content element MULTIMEDI...
authorSteffen Kamper <info@sk-typo3.de>
Wed, 17 Nov 2010 14:35:23 +0000 (14:35 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Wed, 17 Nov 2010 14:35:23 +0000 (14:35 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9458 709f56b5-9817-0410-a4d7-c38de5d9e867

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

index 337923c..153dfee 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@
 
 2010-11-17  Steffen Kamper  <steffen@typo3.org>
 
+       * Added feature #16382: Optimize stdWrap usage for TypoScript content element MULTIMEDIA (Thanks to Jo Hasenau)
        * Added feature #16381: Optimize stdWrap usage for TypoScript content element MEDIA (Thanks to Jo Hasenau)
        * Fixed bug #16435: Headers in GridView are rendered wrong
        * Follow-up to #16315: fixed an issue in ext_conf_template with mod menu
index 035b94c..d44bec0 100644 (file)
@@ -43,7 +43,9 @@ class tslib_content_Multimedia extends tslib_content_Abstract {
         */
        public function render($conf = array()) {
                $content = '';
-               $filename = $this->cObj->stdWrap($conf['file'], $conf['file.']);
+               $filename = isset($conf['file.'])
+                       ? $this->cObj->stdWrap($conf['file'], $conf['file.'])
+                       : $conf['file'];
                $incFile = $GLOBALS['TSFE']->tmpl->getFileName($filename);
                if ($incFile) {
                        $fileinfo = t3lib_div::split_fileref($incFile);
@@ -53,23 +55,41 @@ class tslib_content_Multimedia extends tslib_content_Abstract {
                                        // default params...
                                $parArray = array();
                                        // src is added
+
+                               $width = isset($conf['width.'])
+                                       ? $this->cObj->stdWrap($conf['width'], $conf['width.'])
+                                       : $conf['width'];
+                               if(!$width) {
+                                       $width = 200;
+                               }
+
+                               $height = isset($conf['height.'])
+                                       ? $this->cObj->stdWrap($conf['height'], $conf['height.'])
+                                       : $conf['height'];
+                               if(!$height) {
+                                       $height = 200;
+                               }
+
                                $parArray['src'] = 'src="' . $GLOBALS['TSFE']->absRefPrefix . $incFile . '"';
                                if (t3lib_div::inList('au,wav,mp3', $fileinfo['fileext'])) {
                                }
                                if (t3lib_div::inList('avi,mov,mpg,asf,wmv', $fileinfo['fileext'])) {
-                                       $parArray['width'] = 'width="' . ($conf['width'] ? $conf['width'] : 200) . '"';
-                                       $parArray['height'] = 'height="' . ($conf['height'] ? $conf['height'] : 200) . '"';
+                                       $parArray['width'] = 'width="' . $width  . '"';
+                                       $parArray['height'] = 'height="' . $height . '"';
                                }
                                if (t3lib_div::inList('swf,swa,dcr', $fileinfo['fileext'])) {
                                        $parArray['quality'] = 'quality="high"';
                                }
                                if (t3lib_div::inList('class', $fileinfo['fileext'])) {
-                                       $parArray['width'] = 'width="' . ($conf['width'] ? $conf['width'] : 200) . '"';
-                                       $parArray['height'] = 'height="' . ($conf['height'] ? $conf['height'] : 200) . '"';
+                                       $parArray['width'] = 'width="' . $width . '"';
+                                       $parArray['height'] = 'height="' . $height . '"';
                                }
 
                                        // fetching params
-                               $lines = explode(LF, $this->cObj->stdWrap($conf['params'], $conf['params.']));
+                               $params = isset($conf['params.'])
+                                       ? $this->cObj->stdWrap($conf['params'], $conf['params.'])
+                                       : $conf['params'];
+                               $lines = explode(LF, $params);
                                foreach ($lines as $l) {
                                        $parts = explode('=', $l);
                                        $parameter = strtolower(trim($parts[0]));
@@ -91,7 +111,7 @@ class tslib_content_Multimedia extends tslib_content_Abstract {
                        }
                }
 
-               if ($conf['stdWrap.']) {
+               if (isset($conf['stdWrap.'])) {
                        $content = $this->cObj->stdWrap($content, $conf['stdWrap.']);
                }
 
@@ -105,4 +125,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_multimedia.php']);
 }
 
-?>
\ No newline at end of file
+?>