Index: t3lib/class.t3lib_tsparser_ext.php =================================================================== --- t3lib/class.t3lib_tsparser_ext.php (revision 5326) +++ t3lib/class.t3lib_tsparser_ext.php (working copy) @@ -135,6 +135,7 @@ 'ctable' => Array('Content: \'Table\'', 'mf'), 'cuploads' => Array('Content: \'Filelinks\'', 'mg'), 'cmultimedia' => Array('Content: \'Multimedia\'', 'mh'), + 'cmedia' => Array('Content: \'Media\'', 'mr'), 'cmailform' => Array('Content: \'Form\'', 'mi'), 'csearch' => Array('Content: \'Search\'', 'mj'), 'clogin' => Array('Content: \'Login\'', 'mk'), Index: typo3/sysext/cms/ext_localconf.php =================================================================== --- typo3/sysext/cms/ext_localconf.php (revision 5326) +++ typo3/sysext/cms/ext_localconf.php (working copy) @@ -75,6 +75,14 @@ CType = multimedia } } + media { + icon = gfx/c_wiz/multimedia.gif + title = LLL:EXT:cms/layout/locallang_db_new_content_el.xml:special_media_title + description = LLL:EXT:cms/layout/locallang_db_new_content_el.xml:special_media_description + tt_content_defValues { + CType = media + } + } menu { icon = gfx/c_wiz/sitemap2.gif title = LLL:EXT:cms/layout/locallang_db_new_content_el.xml:special_sitemap_title @@ -94,7 +102,7 @@ } } - special.show = uploads,multimedia,menu,html + special.show = uploads,media,menu,html forms.header = LLL:EXT:cms/layout/locallang_db_new_content_el.xml:forms forms.elements { Index: typo3/sysext/cms/ext_tables.php =================================================================== --- typo3/sysext/cms/ext_tables.php (revision 5326) +++ typo3/sysext/cms/ext_tables.php (working copy) @@ -2,6 +2,8 @@ # TYPO3 SVN ID: $Id$ if (!defined ('TYPO3_MODE')) die ('Access denied.'); +include_once(t3lib_extMgm::extPath($_EXTKEY) . 'tslib/hooks/class.tx_cms_mediaitems.php'); + if (TYPO3_MODE == 'BE') { t3lib_extMgm::addModule('web','layout','top',t3lib_extMgm::extPath($_EXTKEY).'layout/'); t3lib_extMgm::addLLrefForTCAdescr('_MOD_web_layout','EXT:cms/locallang_csh_weblayout.xml'); Index: typo3/sysext/cms/flexform_media.xml =================================================================== --- typo3/sysext/cms/flexform_media.xml (revision 0) +++ typo3/sysext/cms/flexform_media.xml (revision 0) @@ -0,0 +1,221 @@ + + + + 1 + + + + + + LLL:EXT:cms/locallang_ttc.xml:media.options + + array + + + + + + input + 60 + trim + + + <_PADDING>2 + + popup + LLL:EXT:cms/locallang_ttc.xml:media.browseUrlTitle + link_popup.gif + + + page,folder,mail,spec + class,swf,swa,dcr,wav,avi,au,mov,asf,mpg,wmv,mp3,mp4,m4v + + height=300,width=500,status=0,menubar=0,scrollbars=1 + + + + + + + + + + check + + + + + + + + select + + + LLL:EXT:cms/locallang_ttc.xml:media.type.video + video + + + LLL:EXT:cms/locallang_ttc.xml:media.type.audio + audio + + + + + + + + + + input + 8 + 5 + trim + + + + + + + + input + 8 + 5 + trim + + + + + + + + select + + + LLL:EXT:cms/locallang_ttc.xml:media.renderType.auto + auto + + + LLL:EXT:cms/locallang_ttc.xml:media.renderType.swf + swf + + + LLL:EXT:cms/locallang_ttc.xml:media.renderType.qt + qt + + + LLL:EXT:cms/locallang_ttc.xml:media.renderType.object + object + + + tx_cms_mediaItems->customMediaRenderTypes + + + + + + LLL:EXT:cms/locallang_ttc.xml:media.additionalOptions + + array +
1
+ + + array + + LLL:EXT:cms/locallang_ttc.xml:media.params + + + + + + + select + + + LLL:EXT:cms/locallang_ttc.xml:media.params.autoPlay + autoplay + + + LLL:EXT:cms/locallang_ttc.xml:media.params.loop + loop + + + LLL:EXT:cms/locallang_ttc.xml:media.params.quality + quality + + + LLL:EXT:cms/locallang_ttc.xml:media.params.preview + preview + + + LLL:EXT:cms/locallang_ttc.xml:media.params.allowScriptAccess + allowscriptaccess + + + LLL:EXT:cms/locallang_ttc.xml:media.params.allowFullScreen + allowFullScreen + + + tx_cms_mediaItems->customMediaParams + + + + + + + + select + + + LLL:EXT:cms/locallang_ttc.xml:media.params.on + 1 + + + LLL:EXT:cms/locallang_ttc.xml:media.params.off + 0 + + + LLL:EXT:cms/locallang_ttc.xml:media.params.valueEntry + 2 + + + + + + + + + + input + 16 + + + + + + + + + array + + LLL:EXT:cms/locallang_ttc.xml:media.params.customEntry + + + + + + + text + 6 + 60 + + + + + + +
+
+
+
+
+
Index: typo3/sysext/cms/layout/locallang_db_new_content_el.xml =================================================================== --- typo3/sysext/cms/layout/locallang_db_new_content_el.xml (revision 5326) +++ typo3/sysext/cms/layout/locallang_db_new_content_el.xml (working copy) @@ -24,6 +24,12 @@ + + + + + + Index: typo3/sysext/cms/locallang_ttc.xml =================================================================== --- typo3/sysext/cms/locallang_ttc.xml (revision 5326) +++ typo3/sysext/cms/locallang_ttc.xml (working copy) @@ -24,6 +24,7 @@ + @@ -205,6 +206,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: typo3/sysext/cms/tbl_tt_content.php =================================================================== --- typo3/sysext/cms/tbl_tt_content.php (revision 5326) +++ typo3/sysext/cms/tbl_tt_content.php (working copy) @@ -62,6 +62,7 @@ array('LLL:EXT:cms/locallang_ttc.xml:CType.I.10', 'login', 'i/tt_content_login.gif'), array('LLL:EXT:cms/locallang_ttc.xml:CType.div.special', '--div--'), array('LLL:EXT:cms/locallang_ttc.xml:CType.I.7', 'multimedia', 'i/tt_content_mm.gif'), + array('LLL:EXT:cms/locallang_ttc.xml:CType.I.18', 'media', 'i/tt_content_mm.gif'), array('LLL:EXT:cms/locallang_ttc.xml:CType.I.11', 'splash', 'i/tt_content_news.gif'), array('LLL:EXT:cms/locallang_ttc.xml:CType.I.12', 'menu', 'i/tt_content_menu.gif'), array('LLL:EXT:cms/locallang_ttc.xml:CType.I.13', 'shortcut', 'i/tt_content_shortcut.gif'), @@ -813,7 +814,7 @@ 'config' => Array ( 'type' => 'group', 'internal_type' => 'file', - 'allowed' => 'txt,html,htm,class,swf,swa,dcr,wav,avi,au,mov,asf,mpg,wmv,mp3', + 'allowed' => 'txt,html,htm,class,swf,swa,dcr,wav,avi,au,mov,asf,mpg,wmv,mp3,mp4,m4v', 'max_size' => $GLOBALS['TYPO3_CONF_VARS']['BE']['maxFileSize'], 'uploadfolder' => 'uploads/media', 'size' => '2', @@ -955,6 +956,7 @@ ', + ',media' => file_get_contents(t3lib_extMgm::extPath('cms') . 'flexform_media.xml'), ) ) ), @@ -1032,6 +1034,12 @@ --div--;LLL:EXT:cms/locallang_ttc.xml:CType.I.7, multimedia;;;;3-3-3, bodytext;LLL:EXT:lang/locallang_general.php:LGL.parameters;;nowrap, --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.access, starttime, endtime' ), + 'media' => Array( + 'showitem' => 'CType;;4;;1-1-1, hidden, header;;3;;2-2-2, linkToTop;;;;3-3-3, + --div--;LLL:EXT:cms/locallang_ttc.xml:CType.I.18, pi_flexform;;;;3-3-3, + bodytext;LLL:EXT:cms/locallang_ttc.xml:media.alternativeContent;9;richtext:rte_transform[flag=rte_enabled|mode=ts_css];4-4-4, + --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.access, starttime, endtime' + ), 'script' => Array( 'showitem' => 'CType;;4;;1-1-1, hidden, header;LLL:EXT:lang/locallang_general.php:LGL.name;;;2-2-2, --div--;LLL:EXT:cms/locallang_ttc.xml:CType.I.15, select_key;;;;3-3-3, pages;;12, bodytext;LLL:EXT:lang/locallang_general.php:LGL.parameters;;nowrap, Index: typo3/sysext/cms/tslib/class.tslib_content.php =================================================================== --- typo3/sysext/cms/tslib/class.tslib_content.php (revision 5326) +++ typo3/sysext/cms/tslib/class.tslib_content.php (working copy) @@ -608,6 +608,15 @@ case 'MULTIMEDIA': $content.=$this->MULTIMEDIA($conf); break; + case 'MEDIA': + $content.=$this->MEDIA($conf); + break; + case 'SWFOBJECT': + $content.=$this->SWFOBJECT($conf); + break; + case 'QTOBJECT': + $content.=$this->QTOBJECT($conf); + break; default: // call hook functions for extra processing if($name && is_array($TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_content.php']['cObjTypeAndClassDefault'])) { @@ -2630,13 +2639,321 @@ return $content; } + /** + * Rendering the cObject, SWFOBJECT + * + * @param array Array of TypoScript properties + * @return string Output + */ + function MEDIA($conf) { + $content = ''; + $flexParams = $this->stdWrap($conf['flexParams'], $conf['flexParams.']); + if (substr($flexParams, 0, 1) === '<') { + // it is a content element + $this->readFlexformIntoConf($flexParams, $conf['parameter.']); + $url = $conf['parameter.']['mmFile']; + } else { + // it is a TS object + $url = $this->stdWrap($conf['file'], $conf['file.']); + } + + $mode = @file_exists(PATH_site . $url) ? 'file' : 'url'; + if ($mode === 'file') { + $filename = $GLOBALS['TSFE']->tmpl->getFileName($url); + $fileinfo = t3lib_div::split_fileref($filename); + $conf['file'] = $GLOBALS['TSFE']->absRefPrefix . $url; + } else { + $conf['file'] = $url; + if ($conf['parameter.']['mmforcePlayer'] || $conf['forcePlayer']) { + $mode = 'file'; + } + } + + $conf['type'] = isset($conf['parameter.']['mmType']) ? $conf['parameter.']['mmType'] : $conf['type']; + $typeConf = $conf[$conf['type'] . '.']; + $conf['predefined'] = array(); + + $renderType = 'auto'; + if (isset($conf['parameter.']['mmRenderType'])) { + $renderType = $conf['parameter.']['mmRenderType']; + } + $width = intval($conf['parameter.']['mmWidth']); + $height = intval($conf['parameter.']['mmHeight']); + if ($width) { + $conf['width'] = $width; + } else { + $conf['width'] = intval($conf['width']) ? $conf['width'] : $typeConf['defaultWidth']; + } + if ($height) { + $conf['height'] = $height; + } else { + $conf['height'] = intval($conf['height']) ? $conf['height'] : $typeConf['defaultHeight']; + } + + if (is_array($conf['parameter.']['mmMediaOptions.'])) { + $params = array(); + foreach ($conf['parameter.']['mmMediaOptions.'] as $key => $value) { + if (is_array($value)) { + if (isset($value['mmParamCustomEntry'])) { + //custom parameter entry + $rawTS = $value['mmParamCustomEntry']; + //read and merge + $tmp = t3lib_div::trimExplode(chr(10), $rawTS); + if (count($tmp)) { + foreach ($tmp as $tsLine) { + if (substr($tsLine, 0, 1) != '#' && $pos = strpos($tsLine, '.')) { + $parts[0] = substr($tsLine, 0, $pos); + $parts[1] = substr($tsLine, $pos + 1); + $valueParts = t3lib_div::trimExplode('=', $parts[1], true); + + switch (strtolower($parts[0])) { + case 'flashvars': + $conf['flashvars.'][$valueParts[0]] = $valueParts[1]; + break; + case 'params': + $conf['params.'][$valueParts[0]] = $valueParts[1]; + break; + case 'attributes': + $conf['attributes.'][$valueParts[0]] = $valueParts[1]; + break; + } + } + } + } + } else { + if (isset($value['mmParamSet'])) { + $pName = $value['mmParamName']; + $pSet = $value['mmParamSet']; + $pValue = $pSet == 2 ? $value['mmParamValue'] : ($pSet == 0 ? 'false' : 'true'); + $conf['predefined'][$pName] = $pValue; + } + } + } + } + } + + // render MEDIA + if ($mode == 'url' && $url != '') { + // url is called direct, not with player + $conf = array_merge($conf['mimeConf.']['swfobject.'], $conf); + $conf[$conf['type'] . '.']['player'] = strpos($url, '://') === false ? 'http://' . $url : $url; + $conf['file'] = ''; + $conf['installUrl'] = 'null'; + $conf['flashvars'] = array_merge((array) $conf['flashvars'], $conf['predefined']); + $content = $this->SWFOBJECT($conf); + } else { + if ($mode == 'url' && $url == '' && !$conf['allowEmptyUrl']) { + return '

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

'; + } + if ($renderType === 'auto') { + $handler = array_keys($conf['mimeHandler.']); + if (in_array($fileinfo['fileext'], $handler)) { + $renderType = strtolower($conf['mimeHandler.'][$fileinfo['fileext']]); + } + } + switch ($renderType) { + case 'swf': + $conf = array_merge($conf['mimeConf.']['swfobject.'], $conf); + $conf['flashvars.'] = array_merge((array) $conf['flashvars.'], $conf['predefined']); + $content = $this->SWFOBJECT($conf); + break; + case 'qt': + $conf = array_merge($conf['mimeConf.']['qtobject.'], $conf); + $conf['params.'] = array_merge((array) $conf['params.'], $conf['predefined']); + $content = $this->QTOBJECT($conf); + break; + case 'object': + $conf['params.'] = array_merge((array) $conf['params.'], $conf['predefined']); + $content = $this->MULTIMEDIA($conf); + default: + if (is_array ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['customMediaRender'])) { + foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['customMediaRender'] as $classRef) { + $hookObj = &t3lib_div::getUserObj($classRef); + $conf['file'] = $url; + $content = $hookObj->customMediaRender($renderType, $conf); + } + } + } + } + return $content; + } + + + /** + * Rendering the cObject, SWFOBJECT + * + * @param array Array of TypoScript properties + * @return string Output + */ + function SWFOBJECT($conf) { + $content = ''; + $flashvars = $params = $attributes = ''; + $filename = $this->stdWrap($conf['file'], $conf['file.']); + $flexParams = $this->stdWrap($conf['flexParams'], $conf['flexParams.']); + + if (substr($flexParams, 0, 1) === '<') { + $flexParams = t3lib_div::xml2array($flexParams, 'T3'); + $flashvars .= str_replace(chr(10), ',', $flexParams['data']['sDEF']['lDEF']['mmFlashVars']['vDEF']); + $params .= str_replace(chr(10), ',', $flexParams['data']['sDEF']['lDEF']['mmParams']['vDEF']); + $attributes .= str_replace(chr(10), ',', $flexParams['data']['sDEF']['lDEF']['mmAttributes']['vDEF']); + } + $typeConf = $conf[$conf['type'] . '.']; + //add SWFobject js-file + $GLOBALS['TSFE']->additionalHeaderData['SWFobject'] = ''; + + if ($filename) { + $conf['flashvars.']['file'] = $filename; + } + + // 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.']); + + if (is_array($conf['flashvars.'])) { + $this->arrayKeyMap($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) : '') . '};'; + + + if (is_array($conf['params.'])) { + $this->arrayKeyMap($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 : '') . '};'; + + if (is_array($conf['attributes.'])) { + $this->arrayKeyMap($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)) : '') . '};'; + + + $flashVersion = $this->stdWrap($conf['flashVersion'], $conf['flashVersion.']); + if (!$flashVersion) { + $flashVersion = '9'; + } + + $replaceElemIdStr = uniqid('mmswf'); + $GLOBALS['TSFE']->register['MMSWFID'] = $replaceElemIdStr; + + $layout = $this->stdWrap($conf['layout'], $conf['layout.']); + $layout = str_replace('###ID###', $replaceElemIdStr, $layout); + $layout = str_replace('###SWFOBJECT###', '
' . $alternativeContent . '
', $layout); + $alternativeContent = $this->stdWrap($conf['alternativeContent'], $conf['alternativeContent.']); + + $width = $this->stdWrap($conf['width'], $conf['width.']); + $height = $this->stdWrap($conf['height'], $conf['height.']); + + $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 . '", "' . $replaceElemIdStr . '", "' . $width . '", "' . $height . '", + "' . $flashVersion . '", "' . $installUrl . '", flashvars, params, attributes);'; + + $content = $layout . ' + '; + + return $content; + } + /** + * Rendering the cObject, QTOBJECT + * + * @param array Array of TypoScript properties + * @return string Output + */ + function QTOBJECT($conf) { + $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); + } + + $typeConf = $conf[$conf['type'] . '.']; + + //add QTobject js-file + $GLOBALS['TSFE']->additionalHeaderData['qtobject'] = ''; + $replaceElemIdStr = uniqid('mmqt'); + $GLOBALS['TSFE']->register['MMQTID'] = $replaceElemIdStr; + $qtObject = 'QTObject' . $replaceElemIdStr; + + $flexParams = $this->stdWrap($conf['flexParams'], $conf['flexParams.']); + + if (substr($flexParams, 0, 1) === '<') { + $flexParams = t3lib_div::xml2array($flexParams, 'T3'); + $p = str_replace(chr(10), ',', $flexParams['data']['sDEF']['lDEF']['mmParams']['vDEF']); + if ($p) { + $tmp = t3lib_div::trimExplode(',', $p, true); + foreach ($tmp as $value) { + $parts = t3lib_div::trimExplode(':', $value, true); + $params .= $qtObject . '.addParam("' .$parts[0] . '", "' . str_replace('"', '', $parts[1]) . '");' . chr(10); + } + } + } + + + // merge with default parameters + $conf['params.'] = array_merge((array) $typeConf['default.']['params.'], (array) $conf['params.']); + + if (is_array($conf['params.'])) { + $this->arrayKeyMap($conf['params.'], $typeConf['mapping.']['params.']); + foreach ($conf['params.'] as $key => $value) { + $params .= $qtObject . '.addParam("' .$key . '", "' . $value . '");' . chr(10); + } + } + $params = ($params ? substr($params, 0, -2) : '') . chr(10) . $qtObject . '.write();'; + + + $layout = $this->stdWrap($conf['layout'], $conf['layout.']); + $alternativeContent = $this->stdWrap($conf['alternativeContent'], $conf['alternativeContent.']); + if (strpos($layout, '###ID###')) { + $layout = str_replace('###ID###', $replaceElemIdStr, $layout); + } else { + $layout = str_replace('###QTOBJECT###', '
' . $alternativeContent . '
', $layout); + } + + $width = $this->stdWrap($conf['width'], $conf['width.']); + $height = $this->stdWrap($conf['height'], $conf['height.']); + $width = $width ? $width : $conf[$conf['type'] . '.']['defaultWidth']; + $height = $height ? $height : $conf[$conf['type'] . '.']['defaultHeight']; + + $embed = 'var ' . $qtObject . ' = new QTObject("' . $GLOBALS['TSFE']->absRefPrefix . $filename . '", "' . $replaceElemIdStr . '", "' . $width . '", "' . $height . '");'; + + + $content = $layout . ' + '; + + return $content; + } @@ -2646,13 +2963,70 @@ + + + /************************************ * * Various helper functions for content objects: * ************************************/ - + + + /** + * Converts a given config in Flexform to a conf-Array + * @param string Flexform data + * @param array Array to write the data into, by reference + * @param boolean is set if called recursive. Don't call function with this parameter, it's used inside the function only + * @access public + * + */ + function readFlexformIntoConf($flexData, &$conf, $recursive=0) { + if ($recursive === 0) { + $flexData = t3lib_div::xml2array($flexData, 'T3'); + } + + if (is_array($flexData)) { + if (isset($flexData['data']['sDEF']['lDEF'])) { + $flexData = $flexData['data']['sDEF']['lDEF']; + } + + foreach ($flexData as $key => $value) { + if (is_array($value['el']) && count($value['el']) > 0) { + foreach ($value['el'] as $ekey => $element) { + if (isset($element['vDEF'])) { + $conf[$ekey] = $element['vDEF']; + } else { + $this->readFlexformIntoConf($element, $conf[$key . '.'][$ekey . '.'], 1); + } + } + } else { + $this->readFlexformIntoConf($value['el'], $conf[$key . '.'], 1); + } + if ($value['vDEF']) { + $conf[$key] = $value['vDEF']; + } + } + } + } + /** + * Rename array keys with a given mapping table + * @param array Array by reference which should be remapped + * @param mixed if Array it is used for key renaming + */ + function arrayKeyMap(&$array, $mappingTable) { + if (is_array($mappingTable)) { + foreach ($mappingTable as $old => $new) { + if ($new && isset($array[$old])) { + $array[$new] = $array[$old]; + unset ($array[$old]); + } + } + } + } + + /** * Returns all parents of the given PID (Page UID) list * * @param string A list of page Content-Element PIDs (Page UIDs) / stdWrap Index: typo3/sysext/cms/tslib/hooks/class.tx_cms_mediaitems.php =================================================================== --- typo3/sysext/cms/tslib/hooks/class.tx_cms_mediaitems.php (revision 0) +++ typo3/sysext/cms/tslib/hooks/class.tx_cms_mediaitems.php (revision 0) @@ -0,0 +1,76 @@ +customMediaRenderTypes(&$params, $conf); + } + } + + + } + + /** + * Load extra predefined media params if they exist + * + * @param array $params: Existing types by reference + * @param array $conf: config array + */ + public function customMediaParams($params, $conf) { + + if (is_array ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['customMediaParams'])) { + foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['customMediaParams'] as $classRef) { + $hookObj = &t3lib_div::getUserObj($classRef); + $hookObj->customMediaParams(&$params, $conf); + } + } + + + } +} + +if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['tslib/hooks/class.tx_cms_mediaitems.php']) { + include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['tslib/hooks/class.tx_cms_mediaitems.php']); +} +?> Index: typo3/sysext/css_styled_content/pageTSconfig.txt =================================================================== --- typo3/sysext/css_styled_content/pageTSconfig.txt (revision 5326) +++ typo3/sysext/css_styled_content/pageTSconfig.txt (working copy) @@ -15,7 +15,7 @@ text_size.disabled=1 image_frames.disabled = 1 - CType.removeItems = div,rte,script,splash + CType.removeItems = div,rte,script,splash,swfobject,qtobject,multimedia } Index: typo3/sysext/css_styled_content/static/current/constants.txt =================================================================== --- typo3/sysext/css_styled_content/static/current/constants.txt (revision 5326) +++ typo3/sysext/css_styled_content/static/current/constants.txt (working copy) @@ -106,6 +106,21 @@ target = {$PAGE_TARGET} } +styles.content.media { + # cat=content/cMedia; type=int+; label= Video Media Width: define the default width for the media-object + videoPlayer = typo3/contrib/flashmedia/flvplayer.swf + # cat=content/cMedia; type=int+; label= Video Media Width: define the default width for the media-object + defaultVideoWidth = 600 + # cat=content/cMedia; type=int+; label= Video Media Height: define the default height for the media-object + defaultVideoHeight = 400 + # cat=content/cMedia; type=int+; label= Audio Media Width: define the default width for the media-object + audioPlayer = typo3/contrib/flashmedia/player.swf + # cat=content/cMedia; type=int+; label= Video Media Width: define the default width for the media-object + defaultAudioWidth = 300 + # cat=content/cMedia; type=int+; label= Audio Media Height: define the default height for the media-object + defaultAudioHeight = 30 +} + # cat=advanced/links; type=small; label= Target for internal links: Should match the name of the content PAGE-object in TypoScript when used with frames. Most cases: set to "" (empty). If you have frames in the template set to "page" PAGE_TARGET = Index: typo3/sysext/css_styled_content/static/current/setup.txt =================================================================== --- typo3/sysext/css_styled_content/static/current/setup.txt (revision 5326) +++ typo3/sysext/css_styled_content/static/current/setup.txt (working copy) @@ -810,7 +810,142 @@ } } +# ***************** +# CType: swfobject +# ***************** +tt_content.swfobject = COA +tt_content.swfobject { + 10 = < lib.stdheader + 20 = SWFOBJECT + 20 { + file = + width = + height = + + flexParams.field = pi_flexform + + alternativeContent.field = bodytext + + layout = ###SWFOBJECT### + + video.player = {$styles.content.media.videoPlayer} + audio.player = {$styles.content.media.audioPlayer} + + } + 20.stdWrap { + editIcons = tt_content: multimedia, imagewidth, imageheight, pi_flexform, bodytext + editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.multimedia + + prefixComment = 2 | SWFobject element: + } +} + +# ***************** +# CType: qtobject +# ***************** +tt_content.qtobject = COA +tt_content.qtobject { + 10 = < lib.stdheader + + 20 = QTOBJECT + 20 { + file = + width = + height = + + flexParams.field = pi_flexform + + alternativeContent.field = bodytext + + layout = ###QTOBJECT### + } + 20.stdWrap { + editIcons = tt_content: multimedia, imagewidth, imageheight, pi_flexform, bodytext + editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.multimedia + + prefixComment = 2 | QTobject element: + } +} + +# ***************** +# CType: media +# ***************** +tt_content.media = COA +tt_content.media { + 10 = < lib.stdheader + + 20 = MEDIA + 20 { + + flexParams.field = pi_flexform + alternativeContent < tt_content.text.20 + alternativeContent.field = bodytext + + type = video + renderType = auto + allowEmptyUrl = 0 + + mimeHandler { + default = MEDIA + mp3 = SWF + mp4 = SWF + m4v = SWF + mov = QT + avi = MEDIA + asf = MEDIA + class = MEDIA + swa = SWF + } + + mimeConf.swfobject < tt_content.swfobject.20 + mimeConf.qtobject < tt_content.qtobject.20 + + video { + player = {$styles.content.media.videoPlayer} + + defaultWidth = {$styles.content.media.defaultVideoWidth} + defaultHeight = {$styles.content.media.defaultVideoHeight} + + default { + params.quality = high + params.wmode = transparent + params.menu = false + params.allowScriptAccess = sameDomain + params.allowFullScreen = true + } + mapping { + + } + } + + audio { + player = {$styles.content.media.audioPlayer} + + defaultWidth = {$styles.content.media.defaultAudioWidth} + defaultHeight = {$styles.content.media.defaultAudioHeight} + + default { + params.quality = high + params.wmode = transparent + params.allowScriptAccess = sameDomain + params.menu = false + } + mapping { + flashvars.file = soundFile + } + } + } + 20.stdWrap { + editIcons = tt_content: pi_flexform, bodytext + editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.multimedia + + prefixComment = 2 | Media element: + } +} + + + # ****************** # CType: mailform # ******************