Index: typo3/sysext/cms/tslib/content/class.tslib_content_media.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP <+>\n * (c) 2010-2011 Steffen Kamper \n * All rights reserved\n *\n * This script is part of the TYPO3 project. The TYPO3 project is\n * free software; you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation; either version 2 of the License, or\n * (at your option) any later version.\n *\n * The GNU General Public License can be found at\n * http://www.gnu.org/copyleft/gpl.html.\n * A copy is found in the textfile GPL.txt and important notices to the license\n * from the author is found in LICENSE.txt distributed with these scripts.\n *\n *\n * This script is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * This copyright notice MUST APPEAR in all copies of the script!\n ***************************************************************/\n\n/**\n * Contains MEDIA class object.\n *\n * $Id: class.tslib_content.php 7905 2010-06-13 14:42:33Z ohader $\n * @author Xavier Perseguers \n * @author Steffen Kamper \n */\nclass tslib_content_Media extends tslib_content_Abstract {\n\n\t/**\n\t * Rendering the cObject, MEDIA\n\t *\n\t * @param $conf array Array of TypoScript properties\n\t * @return string Output\n\t */\n\tpublic function render($conf = array()) {\n\t\t$content = $mmFile = '';\n\t\t$flexParams = isset($conf['flexParams.'])\n\t\t\t? $this->cObj->stdWrap($conf['flexParams'], $conf['flexParams.'])\n\t\t\t: $conf['flexParams'];\n\t\tif (substr($flexParams, 0, 1) === '<') {\n\t\t\t\t// it is a content element\n\t\t\t$this->cObj->readFlexformIntoConf($flexParams, $conf['parameter.']);\n\t\t\t$url = isset($conf['file.'])\n\t\t\t\t? $this->cObj->stdWrap($conf['parameter.']['mmFile'], $conf['file.'])\n\t\t\t\t: $conf['parameter.']['mmFile'];\n\t\t\t$mmFile = $url;\n\t\t} else {\n\t\t\t\t// it is a TS object\n\t\t\t$url = isset($conf['file.'])\n\t\t\t\t? $this->cObj->stdWrap($conf['file'], $conf['file.'])\n\t\t\t\t: $conf['file'];\n\t\t}\n\n\t\t$mode = is_file(PATH_site . $url) ? 'file' : 'url';\n\t\t$fileinfo = NULL;\n\t\tif ($mode === 'file') {\n\t\t\t\t// render FILE\n\t\t\t$filename = $GLOBALS['TSFE']->tmpl->getFileName($url);\n\t\t\t$fileinfo = t3lib_div::split_fileref($filename);\n\t\t\t$conf['file'] = $filename;\n\t\t} else {\n\t\t\t\t// render URL\n\t\t\t\t// use media wizard to extract video from URL\n\t\t\t$mediaWizard = tslib_mediaWizardManager::getValidMediaWizardProvider($url);\n\t\t\tif ($mediaWizard !== NULL) {\n\t\t\t\t$url = $mediaWizard->rewriteUrl($url);\n\t\t\t}\n\t\t\t$conf['file'] = $this->cObj->typoLink_URL(array(\n\t\t\t\t'parameter' => $url\n\t\t\t));\n\t\t}\n\n\t\t$renderType = isset($conf['renderType.'])\n\t\t\t? $this->cObj->stdWrap($conf['renderType'], $conf['renderType.'])\n\t\t\t: $conf['renderType'];\n\t\t$mmRenderType = isset($conf['parameter.']['mmRenderType.'])\n\t\t\t? $this->cObj->stdWrap($conf['parameter.']['mmRenderType'], $conf['parameter.']['mmRenderType.'])\n\t\t\t: $conf['parameter.']['mmRenderType'];\n\t\tif ($mmRenderType) {\n\t\t\t$renderType = $mmRenderType;\n\t\t}\n\t\tif ($renderType === 'auto') {\n\t\t\t\t// default renderType is swf\n\t\t\t$renderType = 'swf';\n\t\t\t$handler = array_keys($conf['fileExtHandler.']);\n\t\t\tif (is_array($fileinfo) && in_array($fileinfo['fileext'], $handler)) {\n\t\t\t\t$renderType = strtolower($conf['fileExtHandler.'][$fileinfo['fileext']]);\n\t\t\t}\n\t\t}\n\n\t\t$mmForcePlayer = isset($conf['parameter.']['mmforcePlayer.'])\n\t\t\t? $this->cObj->stdWrap($conf['parameter.']['mmforcePlayer'], $conf['parameter.']['mmforcePlayer.'])\n\t\t\t: $conf['parameter.']['mmforcePlayer'];\n\n\t\t$forcePlayer = $mmFile ? intval($mmForcePlayer) : $conf['forcePlayer'];\n\t\t$conf['forcePlayer'] = isset($conf['forcePlayer.'])\n\t\t\t? $this->cObj->stdWrap($forcePlayer, $conf['forcePlayer.'])\n\t\t\t: $forcePlayer;\n\n\t\t$mmType = isset($conf['parameter.']['mmType.'])\n\t\t\t? $this->cObj->stdWrap($conf['parameter.']['mmType'], $conf['parameter.']['mmType.'])\n\t\t\t: $conf['parameter.']['mmType'];\n\n\t\t$type = isset($conf['type.'])\n\t\t\t? $this->cObj->stdWrap($conf['type'], $conf['type.'])\n\t\t\t: $conf['type'];\n\n\t\t$conf['type'] = $mmType ? $mmType : $type;\n\t\t$mime = $renderType . 'object';\n\t\t$typeConf = $conf['mimeConf.'][$mime . '.'][$conf['type'] . '.'] ? $conf['mimeConf.'][$mime . '.'][$conf['type'] . '.'] : array();\n\t\t$conf['predefined'] = array();\n\n\t\t$width = isset($conf['parameter.']['mmWidth.'])\n\t\t\t? intval($this->cObj->stdWrap($conf['parameter.']['mmWidth'], $conf['parameter.']['mmWidth.']))\n\t\t\t: intval($conf['parameter.']['mmWidth']);\n\t\t$height = isset($conf['parameter.']['mmHeight.'])\n\t\t\t? intval($this->cObj->stdWrap($conf['parameter.']['mmHeight'], $conf['parameter.']['mmHeight.']))\n\t\t\t: intval($conf['parameter.']['mmHeight']);\n\t\tif ($width) {\n\t\t\t$conf['width'] = $width;\n\t\t} else {\n\t\t\t$width = isset($conf['width.'])\n\t\t\t\t? intval($this->cObj->stdWrap($conf['width'], $conf['width.']))\n\t\t\t\t: intval($conf['width']);\n\t\t\t$conf['width'] = $width ? $width : $typeConf['defaultWidth'];\n\t\t}\n\t\tif ($height) {\n\t\t\t$conf['height'] = $height;\n\t\t} else {\n\t\t\t$height = isset($conf['height.'])\n\t\t\t\t? intval($this->cObj->stdWrap($conf['height'], $conf['height.']))\n\t\t\t\t: intval($conf['height']);\n\t\t\t$conf['height'] = $height ? $height : $typeConf['defaultHeight'];\n\t\t}\n\n\t\tif (is_array($conf['parameter.']['mmMediaOptions'])) {\n\t\t\t$params = $parts = array();\n\t\t\tforeach ($conf['parameter.']['mmMediaOptions'] as $key => $value) {\n\t\t\t\tif ($key == 'mmMediaCustomParameterContainer') {\n\t\t\t\t\tforeach ($value as $val) {\n\t\t\t\t\t\t\t//custom parameter entry\n\t\t\t\t\t\t$rawTS = $val['mmParamCustomEntry'];\n\t\t\t\t\t\t\t//read and merge\n\t\t\t\t\t\t$tmp = t3lib_div::trimExplode(LF, $rawTS);\n\t\t\t\t\t\tif (count($tmp)) {\n\t\t\t\t\t\t\tforeach ($tmp as $tsLine) {\n\t\t\t\t\t\t\t\tif (substr($tsLine, 0, 1) != '#' && $pos = strpos($tsLine, '.')) {\n\t\t\t\t\t\t\t\t\t$parts[0] = substr($tsLine, 0, $pos);\n\t\t\t\t\t\t\t\t\t$parts[1] = substr($tsLine, $pos + 1);\n\t\t\t\t\t\t\t\t\t$valueParts = t3lib_div::trimExplode('=', $parts[1], TRUE);\n\n\t\t\t\t\t\t\t\t\tswitch (strtolower($parts[0])) {\n\t\t\t\t\t\t\t\t\t\tcase 'flashvars' :\n\t\t\t\t\t\t\t\t\t\t\t$conf['flashvars.'][$valueParts[0]] = $valueParts[1];\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tcase 'params' :\n\t\t\t\t\t\t\t\t\t\t\t$conf['params.'][$valueParts[0]] = $valueParts[1];\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tcase 'attributes' :\n\t\t\t\t\t\t\t\t\t\t\t$conf['attributes.'][$valueParts[0]] = $valueParts[1];\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} elseif ($key == 'mmMediaOptionsContainer') {\n\t\t\t\t\tforeach ($value as $val) {\n\t\t\t\t\t\tif (isset($val['mmParamSet'])) {\n\t\t\t\t\t\t\t$pName = $val['mmParamName'];\n\t\t\t\t\t\t\t$pSet = $val['mmParamSet'];\n\t\t\t\t\t\t\t$pValue = $pSet == 2 ? $val['mmParamValue'] : ($pSet == 0 ? 'false' : 'true');\n\t\t\t\t\t\t\t$conf['predefined'][$pName] = $pValue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t\t// render MEDIA\n\t\tif ($mode == 'url' && !$forcePlayer) {\n\t\t\t// url is called direct, not with player\n\t\t\tif ($url == '' && !$conf['allowEmptyUrl']) {\n\t\t\t\treturn '

' . $GLOBALS['TSFE']->sL('LLL:EXT:cms/locallang_ttc.xml:media.noFile', TRUE) . '

';\n\t\t\t}\n\t\t\t$conf = array_merge((array) $conf['mimeConf.']['swfobject.'], $conf);\n\t\t\t$conf[$conf['type'] . '.']['player'] = strpos($url, '://') === FALSE ? 'http://' . $url : $url;\n\t\t\t$conf['installUrl'] = 'null';\n\t\t\t$conf['flashvars'] = array_merge((array) $conf['flashvars'], $conf['predefined']);\n\t\t}\n\n\t\tswitch ($renderType) {\n\t\t\tcase 'swf' :\n\t\t\t\t$conf[$conf['type'] . '.'] = array_merge((array) $conf['mimeConf.']['swfobject.'][$conf['type'] . '.'], $typeConf);\n\t\t\t\t$conf = array_merge((array) $conf['mimeConf.']['swfobject.'], $conf);\n\t\t\t\tunset($conf['mimeConf.']);\n\t\t\t\t$conf['flashvars.'] = array_merge((array) $conf['flashvars.'], $conf['predefined']);\n\t\t\t\t$content = $this->cObj->SWFOBJECT($conf);\n\t\t\tbreak;\n\t\t\tcase 'qt' :\n\t\t\t\t$conf[$conf['type'] . '.'] = array_merge($conf['mimeConf.']['swfobject.'][$conf['type'] . '.'], $typeConf);\n\t\t\t\t$conf = array_merge($conf['mimeConf.']['qtobject.'], $conf);\n\t\t\t\tunset($conf['mimeConf.']);\n\t\t\t\t$conf['params.'] = array_merge((array) $conf['params.'], $conf['predefined']);\n\t\t\t\t$content = $this->cObj->QTOBJECT($conf);\n\t\t\tbreak;\n\t\t\tcase 'embed' :\n\t\t\t\t$paramsArray = array_merge((array) $typeConf['default.']['params.'], (array) $conf['params.'], $conf['predefined']);\n\t\t\t\t$conf['params'] = '';\n\t\t\t\tforeach ($paramsArray as $key => $value) {\n\t\t\t\t\t$conf['params'] .= $key . '=' . $value . LF;\n\t\t\t\t}\n\t\t\t\t$content = $this->cObj->MULTIMEDIA($conf);\n\t\t\tbreak;\n\t\t\tdefault :\n\t\t\t\tif (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['customMediaRender'])) {\n\t\t\t\t\tforeach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['customMediaRender'] as $classRef) {\n\t\t\t\t\t\t$hookObj = t3lib_div::getUserObj($classRef);\n\t\t\t\t\t\t$conf['file'] = $url;\n\t\t\t\t\t\t$conf['mode'] = $mode;\n\t\t\t\t\t\t$content = $hookObj->customMediaRender($renderType, $conf, $this);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (isset($conf['stdWrap.'])) {\n\t\t\t\t\t$content = $this->cObj->stdWrap($content, $conf['stdWrap.']);\n\t\t\t\t}\n\t\t}\n\n\t\treturn $content;\n\t}\n\n}\n\n\nif (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['tslib/content/class.tslib_content_media.php'])) {\n\tinclude_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['tslib/content/class.tslib_content_media.php']);\n}\n\n?>\n =================================================================== --- typo3/sysext/cms/tslib/content/class.tslib_content_media.php (revision c9ef82dd9452dda54937ea6bc3ca5eb60867ad3e) +++ typo3/sysext/cms/tslib/content/class.tslib_content_media.php (revision ) @@ -77,6 +77,7 @@ $conf['file'] = $this->cObj->typoLink_URL(array( 'parameter' => $url )); + unset($conf['file.']); } $renderType = isset($conf['renderType.'])