+2009-09-16 Steffen Kamper <info@sk-typo3.de>
+
+ * Fixed bug #11902: [MediaCE] works only with absRefPrefix and doesn't support flowplayer
+
2009-09-15 Francois Suter <francois@typo3.org>
* Feature #11555: Integrated extension "gabriel" into TYPO3 Core as sysext "scheduler"
2009-09-15 Francois Suter <francois@typo3.org>
* Feature #11555: Integrated extension "gabriel" into TYPO3 Core as sysext "scheduler"
if ($mode == 'url' && $url != '') {
// url is called direct, not with player
$conf = array_merge($conf['mimeConf.']['swfobject.'], $conf);
if ($mode == 'url' && $url != '') {
// url is called direct, not with player
$conf = array_merge($conf['mimeConf.']['swfobject.'], $conf);
if (in_array($fileinfo['fileext'], $handler)) {
$renderType = strtolower($conf['fileExtHandler.'][$fileinfo['fileext']]);
}
if (in_array($fileinfo['fileext'], $handler)) {
$renderType = strtolower($conf['fileExtHandler.'][$fileinfo['fileext']]);
}
switch ($renderType) {
case 'swf':
$conf[$conf['type'] . '.'] = array_merge($conf['mimeConf.']['swfobject.'][$conf['type'] . '.'], $typeConf);
switch ($renderType) {
case 'swf':
$conf[$conf['type'] . '.'] = array_merge($conf['mimeConf.']['swfobject.'][$conf['type'] . '.'], $typeConf);
$hookObj = &t3lib_div::getUserObj($classRef);
$conf['file'] = $url;
$conf['mode'] = $mode;
$hookObj = &t3lib_div::getUserObj($classRef);
$conf['file'] = $url;
$conf['mode'] = $mode;
- $content = $hookObj->customMediaRender($renderType, $conf);
+ $content = $hookObj->customMediaRender($renderType, $conf, $this);
public function SWFOBJECT($conf) {
$content = '';
$flashvars = $params = $attributes = '';
public function SWFOBJECT($conf) {
$content = '';
$flashvars = $params = $attributes = '';
-
- $filename = $this->stdWrap($conf['file'], $conf['file.']);
+ $prefix = '';
+ if ($GLOBALS['TSFE']->baseUrl) {
+ $prefix = $GLOBALS['TSFE']->baseUrl;
+ }
+ if ($GLOBALS['TSFE']->absRefPrefix) {
+ $prefix = $GLOBALS['TSFE']->absRefPrefix;
+ };
$typeConf = $conf[$conf['type'] . '.'];
$typeConf = $conf[$conf['type'] . '.'];
- //add SWFobject js-file
- $GLOBALS['TSFE']->additionalHeaderData['SWFobject'] = '<script src="' . $GLOBALS['TSFE']->absRefPrefix . 'typo3/contrib/flashmedia/swfobject/swfobject.js"></script>';
-
+ //add SWFobject js-file
+ $GLOBALS['TSFE']->addJsFile('typo3/contrib/flashmedia/swfobject/swfobject.js');
+
+ $player = $this->stdWrap($conf[$conf['type'] . '.']['player'], $conf[$conf['type'] . '.']['player.']);
+ $installUrl = $conf['installUrl'] ? $conf['installUrl'] : $prefix . 'typo3/contrib/flashmedia/swfobject/expressInstall.swf';
+ $filename = $this->stdWrap($conf['file'], $conf['file.']);
- $conf['flashvars.']['file'] = strpos($filename, '://') !== FALSE ? $filename : $GLOBALS['TSFE']->absRefPrefix . $filename;
+ if (strpos($filename, '://') !== FALSE) {
+ $conf['flashvars.']['file'] = $filename;
+ } else {
+ if ($prefix) {
+ $conf['flashvars.']['file'] = $prefix . $filename;
+ } else {
+ $conf['flashvars.']['file'] = str_repeat('../', substr_count($player, '/')) . $filename;
+ }
+
+ }
+ // Write calculated values in conf for the hook
+ $conf['player'] = $player;
+ $conf['installUrl'] = $installUrl;
+ $conf['filename'] = $filename;
+ $conf['prefix'] = $prefix;
- // merge with default parameters
+ // merge with default parameters
$conf['flashvars.'] = array_merge((array) $typeConf['default.']['flashvars.'], (array) $conf['flashvars.']);
$conf['params.'] = array_merge((array) $typeConf['default.']['params.'], (array) $conf['params.']);
$conf['attributes.'] = array_merge((array) $typeConf['default.']['attributes.'], (array) $conf['attributes.']);
$conf['flashvars.'] = array_merge((array) $typeConf['default.']['flashvars.'], (array) $conf['flashvars.']);
$conf['params.'] = array_merge((array) $typeConf['default.']['params.'], (array) $conf['params.']);
$conf['attributes.'] = array_merge((array) $typeConf['default.']['attributes.'], (array) $conf['attributes.']);
+ $conf['embedParams'] = 'flashvars, params, attributes';
+ // Hook for manipulating the conf array, it's needed for some players like flowplayer
+ if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['swfParamTransform'])) {
+ foreach($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['swfParamTransform'] as $classRef) {
+ t3lib_div::callUserFunction($classRef, $conf, $this);
+ }
+ }
if (is_array($conf['flashvars.'])) {
t3lib_div::remapArrayKeys($conf['flashvars.'], $typeConf['mapping.']['flashvars.']);
if (is_array($conf['flashvars.'])) {
t3lib_div::remapArrayKeys($conf['flashvars.'], $typeConf['mapping.']['flashvars.']);
- foreach ($conf['flashvars.'] as $key => $value) {
- $flashvars .= $key . ': "' . $value . '",';
- }
- $flashvars = 'var flashvars = {' . ($flashvars ? (substr($flashvars, -1) == ',' ? substr(trim($flashvars), 0, -1) : $flashvars) : '') . '};';
+ $flashvars = 'var flashvars = ' . (count($conf['flashvars.']) ? json_encode($conf['flashvars.']) : '{}') . ';';
if (is_array($conf['params.'])) {
t3lib_div::remapArrayKeys($conf['params.'], $typeConf['mapping.']['params.']);
if (is_array($conf['params.'])) {
t3lib_div::remapArrayKeys($conf['params.'], $typeConf['mapping.']['params.']);
- foreach ($conf['params.'] as $key => $value) {
- $params .= $key . ': "' . $value . '",';
- }
- $params = substr(trim($params), 0, -1);
- $params = 'var params = {' . ($params ? $params : '') . '};';
+ $params = 'var params = ' . (count($conf['params.']) ? json_encode($conf['params.']) : '{}') . ';';
if (is_array($conf['attributes.'])) {
t3lib_div::remapArrayKeys($conf['attributes.'], $typeConf['attributes.']['params.']);
if (is_array($conf['attributes.'])) {
t3lib_div::remapArrayKeys($conf['attributes.'], $typeConf['attributes.']['params.']);
- foreach ($conf['attributes.'] as $key => $value) {
- $attributes .= $key . ': "' . $value . '",';
- }
- $attributes = 'var attributes = {' . ($attributes ? (substr($attributes, -1 === ',' ? substr($attributes, 0, -1) : $attributes)) : '') . '};';
+ $attributes = 'var attributes = ' . (count($conf['attributes.']) ? json_encode($conf['attributes.']) : '{}') . ';';
$flashVersion = $this->stdWrap($conf['flashVersion'], $conf['flashVersion.']);
if (!$flashVersion) {
$flashVersion = $this->stdWrap($conf['flashVersion'], $conf['flashVersion.']);
if (!$flashVersion) {
$width = $width ? $width : $conf[$conf['type'] . '.']['defaultWidth'];
$height = $height ? $height : $conf[$conf['type'] . '.']['defaultHeight'];
$width = $width ? $width : $conf[$conf['type'] . '.']['defaultWidth'];
$height = $height ? $height : $conf[$conf['type'] . '.']['defaultHeight'];
- $player = $this->stdWrap($conf[$conf['type'] . '.']['player'], $conf[$conf['type'] . '.']['player.']);
- $installUrl = $conf['installUrl'] ? $conf['installUrl'] : $GLOBALS['TSFE']->absRefPrefix . 'typo3/contrib/flashmedia/swfobject/expressInstall.swf';
- $embed = 'swfobject.embedSWF("' . $player . '", "' . $replaceElementIdString . '", "' . $width . '", "' . $height . '",
- "' . $flashVersion . '", "' . $installUrl . '", flashvars, params, attributes);';
+ $embed = 'swfobject.embedSWF("' . $conf['player'] . '", "' . $replaceElementIdString . '", "' . $width . '", "' . $height . '",
+ "' . $flashVersion . '", "' . $installUrl . '", ' . $conf['embedParams'] . ');';
$content = $layout . '
<script type="text/javascript">
$content = $layout . '
<script type="text/javascript">
$content = '';
$params = '';
$content = '';
$params = '';
- $filename = $this->stdWrap($conf['file'],$conf['file.']);
- $incFile = $GLOBALS['TSFE']->tmpl->getFileName($filename);
- if ($incFile) {
- $filename = $incFile;
- $fileinfo = t3lib_div::split_fileref($filename);
+ $prefix = '';
+ if ($GLOBALS['TSFE']->baseUrl) {
+ $prefix = $GLOBALS['TSFE']->baseUrl;
+ }
+ if ($GLOBALS['TSFE']->absRefPrefix) {
+ $prefix = $GLOBALS['TSFE']->absRefPrefix;
+
+ $filename = $this->stdWrap($conf['file'],$conf['file.']);
+
$typeConf = $conf[$conf['type'] . '.'];
$typeConf = $conf[$conf['type'] . '.'];
-
- //add QTobject js-file
- $GLOBALS['TSFE']->additionalHeaderData['qtobject'] = '<script src="' . $GLOBALS['TSFE']->absRefPrefix . 'typo3/contrib/flashmedia/qtobject/qtobject.js"></script>';
+
+ //add QTobject js-file
+ $GLOBALS['TSFE']->addJsFile('typo3/contrib/flashmedia/qtobject/qtobject.js');
$replaceElementIdString = uniqid('mmqt');
$GLOBALS['TSFE']->register['MMQTID'] = $replaceElementIdString;
$qtObject = 'QTObject' . $replaceElementIdString;
$replaceElementIdString = uniqid('mmqt');
$GLOBALS['TSFE']->register['MMQTID'] = $replaceElementIdString;
$qtObject = 'QTObject' . $replaceElementIdString;
- // merge with default parameters
+ // merge with default parameters
$conf['params.'] = array_merge((array) $typeConf['default.']['params.'], (array) $conf['params.']);
if (is_array($conf['params.'])) {
$conf['params.'] = array_merge((array) $typeConf['default.']['params.'], (array) $conf['params.']);
if (is_array($conf['params.'])) {
$width = $width ? $width : $conf[$conf['type'] . '.']['defaultWidth'];
$height = $height ? $height : $conf[$conf['type'] . '.']['defaultHeight'];
$width = $width ? $width : $conf[$conf['type'] . '.']['defaultWidth'];
$height = $height ? $height : $conf[$conf['type'] . '.']['defaultHeight'];
- $embed = 'var ' . $qtObject . ' = new QTObject("' . $GLOBALS['TSFE']->absRefPrefix . $filename . '", "' . $replaceElementIdString . '", "' . $width . '", "' . $height . '");';
+ $embed = 'var ' . $qtObject . ' = new QTObject("' . $prefix . $filename . '", "' . $replaceElementIdString . '", "' . $width . '", "' . $height . '");';
$content = $layout . '
<script type="text/javascript">
$content = $layout . '
<script type="text/javascript">