/** * Render videos from various video portals * * @param Tx_News_Domain_Model_Media $element * @param integer $width * @param integer $height * @return string */ public function render(Tx_News_Domain_Model_Media $element, $width, $height) { $content = $finalUrl = ''; $url = Tx_News_Service_FileService::getCorrectUrl($element->getContent()); // get the correct rewritten url $mediaWizard = \TYPO3\CMS\Frontend\MediaWizard\MediaWizardProviderManager::getValidMediaWizardProvider($url); if ($mediaWizard !== NULL) { $finalUrl = $mediaWizard->rewriteUrl($url); } // override width & height if both are set if ($element->getWidth() > 0 && $element->getHeight() > 0) { $width = $element->getWidth(); $height = $element->getHeight(); } if (!empty($finalUrl)) { $GLOBALS['TSFE']->getPageRenderer()->addJsFile('typo3conf/ext/news/Resources/Public/JavaScript/Contrib/swfobject-2-2.js'); $uniqueDivId = 'mediaelement' . Tx_News_Service_FileService::getUniqueId($element); $content .= '<div id="' . htmlspecialchars($uniqueDivId) . '"></div> <script type="text/javascript"> var params = { allowScriptAccess: "always", allowfullscreen : "true" }; var atts = { id: ' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue($uniqueDivId) . ' }; swfobject.embedSWF(' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue($finalUrl) . ', ' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue($uniqueDivId) . ', "' . (int) $width . '", "' . (int) $height . '", "8", null, null, params, atts); </script>'; } return $content; }
} } '); $TYPO3_CONF_VARS['SYS']['contentTable'] = 'tt_content'; $TYPO3_CONF_VARS['FE']['eID_include']['tx_cms_showpic'] = 'EXT:cms/tslib/showpic.php'; if (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_INSTALL) { $TYPO3_CONF_VARS['SC_OPTIONS']['ext/install']['compat_version']['cms'] = array('title' => 'CMS Frontend', 'version' => 4000000, 'description' => '<ul>' . '<li><p>The extension simluatestatic has been removed in TYPO3 6.0</p></li>' . '<li><p>CSS Stylesheets and JavaScript are put into an external file by default.</p>' . '<p>Technically, that means that the default value of "config.inlineStyle2TempFile" is now set to "1" and that of "config.removeDefaultJS" to "external"</p></li>' . '</ul>'); } // Registering hooks for the treelist cache $TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] = 'TYPO3\\CMS\\Frontend\\Hooks\\TreelistCacheUpdateHooks'; $TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'][] = 'TYPO3\\CMS\\Frontend\\Hooks\\TreelistCacheUpdateHooks'; $TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['moveRecordClass'][] = 'TYPO3\\CMS\\Frontend\\Hooks\\TreelistCacheUpdateHooks'; if (TYPO3_MODE === 'FE') { // Register the core media wizard provider \TYPO3\CMS\Frontend\MediaWizard\MediaWizardProviderManager::registerMediaWizardProvider('TYPO3\\CMS\\Frontend\\MediaWizard\\MediaWizardProvider'); // Register eID provider for ExtDirect for the frontend $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['ExtDirect'] = PATH_tslib . 'extdirecteid.php'; } // Register search keys $GLOBALS['TYPO3_CONF_VARS']['SYS']['livesearch']['page'] = 'pages'; $GLOBALS['TYPO3_CONF_VARS']['SYS']['livesearch']['content'] = 'tt_content'; // Register hook to show preview info $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_previewInfo']['cms'] = 'TYPO3\\CMS\\Frontend\\Hooks\\FrontendHooks->hook_previewInfo'; /** * Extension: frontend * File: C:/xampp/htdocs/typo3_6.2.14/typo3/sysext/frontend/ext_localconf.php */ $_EXTKEY = 'frontend'; $_EXTCONF = $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$_EXTKEY]; if (!defined('TYPO3_MODE')) {
/** * Resolves the URL of an file * * @param $media * * @return null|string */ protected function retrieveMediaUrl($media) { $returnValue = NULL; if (class_exists('TYPO3\\CMS\\Mediace\\MediaWizard\\MediaWizardProviderManager')) { // 7.2 $mediaWizard = \TYPO3\CMS\Mediace\MediaWizard\MediaWizardProviderManager::getValidMediaWizardProvider($media); } elseif (class_exists('TYPO3\\CMS\\Frontend\\MediaWizard\\MediaWizardProviderManager')) { // before 7.2 $mediaWizard = \TYPO3\CMS\Frontend\MediaWizard\MediaWizardProviderManager::getValidMediaWizardProvider($media); } else { throw new \Exception('You are running TYPO3 > CMS 7.2. Please install the mediace extension', 12367238462384.0); } // Get the path relative to the page currently outputted if (substr($media, 0, 5) === "file:") { $fileUid = substr($media, 5); if (MathUtility::canBeInterpretedAsInteger($fileUid)) { $fileObject = ResourceFactory::getInstance()->getFileObject($fileUid); if ($fileObject instanceof FileInterface) { $returnValue = $fileObject->getPublicUrl(); } } } elseif (is_file(PATH_site . $media)) { $returnValue = $GLOBALS['TSFE']->tmpl->getFileName($media); } elseif ($mediaWizard !== NULL) { $cObj = new ContentObjectRenderer(); $returnValue = $cObj->typoLink_URL(array('parameter' => $mediaWizard->rewriteUrl($media))); } elseif (GeneralUtility::isValidUrl($media)) { $returnValue = $media; } return $returnValue; }
/** * Resolves the URL of an file * * @param string $file * @return string|NULL */ protected function retrieveMediaUrl($file) { $returnValue = NULL; // because the file value can possibly have link parameters, use explode to split all values $fileParts = explode(' ', $file); /** @var $mediaWizard \TYPO3\CMS\Frontend\MediaWizard\MediaWizardProviderInterface */ $mediaWizard = \TYPO3\CMS\Frontend\MediaWizard\MediaWizardProviderManager::getValidMediaWizardProvider($fileParts[0]); // Get the path relative to the page currently outputted if (substr($fileParts[0], 0, 5) === 'file:') { $fileUid = substr($fileParts[0], 5); if (!empty($fileUid) && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($fileUid)) { $fileObject = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->getFileObject($fileUid); if ($fileObject instanceof \TYPO3\CMS\Core\Resource\FileInterface) { $returnValue = $fileObject->getPublicUrl(); } } } elseif (is_file(PATH_site . $fileParts[0])) { $returnValue = $GLOBALS['TSFE']->tmpl->getFileName($fileParts[0]); } elseif ($mediaWizard !== NULL) { $returnValue = $this->cObj->typoLink_URL(array('parameter' => $mediaWizard->rewriteUrl($fileParts[0]))); } elseif (\TYPO3\CMS\Core\Utility\GeneralUtility::isValidUrl($fileParts[0])) { $returnValue = $fileParts[0]; } return $returnValue; }
/** * Resolves the URL of an file * * @param string $file * @return string|NULL */ protected function retrieveMediaUrl($file) { $returnValue = NULL; /** @var $mediaWizard \TYPO3\CMS\Frontend\MediaWizard\MediaWizardProviderInterface */ $mediaWizard = \TYPO3\CMS\Frontend\MediaWizard\MediaWizardProviderManager::getValidMediaWizardProvider($file); // Get the path relative to the page currently outputted if (is_file(PATH_site . $file)) { $returnValue = $GLOBALS['TSFE']->tmpl->getFileName($file); } elseif ($mediaWizard !== NULL) { $returnValue = $this->cObj->typoLink_URL(array('parameter' => $mediaWizard->rewriteUrl($file))); } elseif (\TYPO3\CMS\Core\Utility\GeneralUtility::isValidUrl($file)) { $returnValue = $file; } return $returnValue; }