Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support to get it work with TYPO3 9.5 LTS #30

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
72 changes: 72 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# remove PHPStorm folders
*.idea
.idea/*

# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# Windows shortcuts
*.lnk

# =========================
# Operating System Files
# =========================

# OSX
# =========================

.DS_Store
.AppleDouble
.LSOverride

# Thumbnails
._*

# Files that might appear on external disk
.Spotlight-V100
.Trashes

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# remove npm folders and config
node_modules/
package-lock.json
.sass-cache/

/var/
public/fileadmin/
public/uploads/
public/typo3conf/ext/
public/typo3conf/l10n/
public/typo3temp/
public/typo3/
public/typo3conf/ENABLE_INSTALL_TOOL
public/index.php
*.log
vendor
PackageStates.php
LocalConfiguration.php
node_modules/
/DB/
src_t3
public/typo3conf/LocalConfiguration.php
public/typo3conf/LocalConfiguration_dev.php
public/typo3conf/LocalConfiguration_live.php
6 changes: 3 additions & 3 deletions Classes/ContentObject/FlowPlayerContentObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
* The TYPO3 project - inspiring people to share!
*/

use TYPO3\CMS\Core\Utility\ArrayUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\StringUtility;
use \TYPO3\CMS\Core\Utility\ArrayUtility;
use \TYPO3\CMS\Core\Utility\GeneralUtility;
use \TYPO3\CMS\Core\Utility\StringUtility;

/**
* Contains FlowPlayer class object.
Expand Down
13 changes: 9 additions & 4 deletions Classes/ContentObject/MultimediaContentObject.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace FoT3\Mediace\ContentObject;

/*
Expand All @@ -19,6 +20,7 @@
*/
class MultimediaContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractContentObject
{

/**
* Rendering the cObject, MULTIMEDIA
*
Expand All @@ -33,16 +35,18 @@ public function render($conf = array())
if ($incFile) {
$fileinfo = \TYPO3\CMS\Core\Utility\GeneralUtility::split_fileref($incFile);
if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList('txt,html,htm', $fileinfo['fileext'])) {
$content = $GLOBALS['TSFE']->tmpl->fileContent($incFile);
$content = file_get_contents($incFile);
} else {
// Default params...
$parArray = array();
// Src is added
$width = isset($conf['width.']) ? $this->cObj->stdWrap($conf['width'], $conf['width.']) : $conf['width'];
$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'];
$height = isset($conf['height.']) ? $this->cObj->stdWrap($conf['height'],
$conf['height.']) : $conf['height'];
if (!$height) {
$height = 200;
}
Expand All @@ -63,7 +67,8 @@ public function render($conf = array())
$parArray['height'] = 'height="' . $height . '"';
}
// fetching params
$params = isset($conf['params.']) ? $this->cObj->stdWrap($conf['params'], $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);
Expand Down
4 changes: 2 additions & 2 deletions Classes/ContentObject/QuicktimeObjectContentObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* The TYPO3 project - inspiring people to share!
*/

use TYPO3\CMS\Core\Utility\ArrayUtility;
use TYPO3\CMS\Core\Utility\StringUtility;
use \TYPO3\CMS\Core\Utility\ArrayUtility;
use \TYPO3\CMS\Core\Utility\StringUtility;

/**
* Contains QTOBJECT content object.
Expand Down
5 changes: 2 additions & 3 deletions Configuration/TCA/Overrides/tt_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
$GLOBALS['TCA']['tt_content']['ctrl']['typeicon_classes']['multimedia'] = 'mimetypes-x-content-multimedia';
$GLOBALS['TCA']['tt_content']['ctrl']['typeicon_classes']['media'] = 'mimetypes-x-content-multimedia';


// Register new CType in item list just before "menu"
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem('tt_content', 'CType',
array(
Expand Down Expand Up @@ -93,6 +92,6 @@
}
$GLOBALS['TCA']['tt_content']['types']['multimedia']['columnsOverrides']['bodytext']['defaultExtras'] = $baseDefaultExtrasOfBodytext . 'nowrap';


// Add flexform
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('*', 'FILE:EXT:mediace/Configuration/FlexForms/media.xml', 'media');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('*',
'FILE:EXT:mediace/Configuration/FlexForms/media.xml', 'media');
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
# TYPO3 Extension "mediace"

**This is only a compatibility upgrade to get old elements work with TYPO3 9.5!!**

**Do not use it for new projects!!!**

Adds media-based content elements with Flash or native HTML5 to your website.

The functionality was part of TYPO3, until TYPO3 CMS 7 LTS, and moved into its own
extension, receiving its own public repository.

Related changelog entries:
https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.2/Breaking-65778-MediaWizardProviderMovedToSystemExtension.html
https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.2/Breaking-64719-MediaContentMovedToSystemExtension.html
https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.6/Important-68079-ExtensionMediaceMovedToTER.html


## Installation
The latest version can be installed via TER (http://typo3.org) or via composer
by adding ''composer require friendsoftypo3/mediace'' in a TYPO3 CMS 7+ installation.
Expand Down
11 changes: 6 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"name": "friendsoftypo3/mediace",
"type": "typo3-cms-extension",
"description": "Allows to have non-FAL Media Content Elements like Video and Audio, behaves like TYPO3 4.x and TYPO3 6.x, but acts as compatibility layer for TYPO3 CMS 7.",
"description": "Allows to have non-FAL Media Content Elements like Video and Audio, behaves like TYPO3 4.x and TYPO3 6.x, but acts as compatibility layer for TYPO3 CMS 9.",
"homepage": "https://typo3.org",
"license": ["GPL-2.0+"],

"license": [
"GPL-2.0+"
],
"require": {
"typo3/cms-core": "~7.6.0",
"typo3/cms-frontend": "~7.6.0"
"php": ">=7.1.0",
"typo3/cms-core": "^9.5 || ^10.0 || 10.*@dev"
},
"replace": {
"mediace": "*"
Expand Down
21 changes: 11 additions & 10 deletions ext_emconf.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
$EM_CONF[$_EXTKEY] = array(
$EM_CONF[$_EXTKEY] = [
'title' => 'Media Content Element',
'description' => 'The media functionality from TYPO3 6.2 and earlier can be found here. This extension provides ContentObjects and Content Elements.',
'category' => 'fe',
Expand All @@ -9,12 +9,13 @@
'uploadfolder' => 0,
'createDirs' => 'uploads/media',
'clearCacheOnLoad' => 1,
'version' => '7.6.4',
'constraints' => array(
'depends' => array(
'typo3' => '7.6.0-7.6.99',
),
'conflicts' => array(),
'suggests' => array(),
)
);
'version' => '9.5.1',
'constraints' => [
'depends' => [
'typo3' => '9.5.0-10.4.99',
'php' => '7.1.0-7.3.99',
],
'conflicts' => [],
'suggests' => [],
]
];
19 changes: 12 additions & 7 deletions ext_localconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@

// Register additional content objects
$GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects']['MULTIMEDIA'] = \FoT3\Mediace\ContentObject\MultimediaContentObject::class;
$GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects']['MEDIA'] = \FoT3\Mediace\ContentObject\MediaContentObject::class;
$GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects']['SWFOBJECT'] = \FoT3\Mediace\ContentObject\ShockwaveFlashObjectContentObject::class;
$GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects']['MEDIA'] = \FoT3\Mediace\ContentObject\MediaContentObject::class;
$GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects']['SWFOBJECT'] = \FoT3\Mediace\ContentObject\ShockwaveFlashObjectContentObject::class;
$GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects']['FLOWPLAYER'] = \FoT3\Mediace\ContentObject\FlowPlayerContentObject::class;
$GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects']['QTOBJECT'] = \FoT3\Mediace\ContentObject\QuicktimeObjectContentObject::class;
$GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects']['QTOBJECT'] = \FoT3\Mediace\ContentObject\QuicktimeObjectContentObject::class;

// Register the "media" CType to the "New Content Element" wizard
/* Register the "media" CType to the "New Content Element" wizard */
/* do not include the media element in wizard because it should not used for new elements because of deprecation */
/*
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('
mod.wizards.newContentElement.wizardItems {
special.elements.media {
Expand All @@ -20,10 +22,13 @@
special.show := addToList(media)
}
');

*/
// Add Default TypoScript for CType "media" and "multimedia" after default content rendering
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript('mediace', 'constants', '<INCLUDE_TYPOSCRIPT: source="FILE:EXT:mediace/Configuration/TypoScript/constants.txt">', 'defaultContentRendering');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript('mediace', 'setup', '<INCLUDE_TYPOSCRIPT: source="FILE:EXT:mediace/Configuration/TypoScript/setup.txt">', 'defaultContentRendering');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript('mediace', 'constants',
'<INCLUDE_TYPOSCRIPT: source="FILE:EXT:mediace/Configuration/TypoScript/constants.txt">',
'defaultContentRendering');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript('mediace', 'setup',
'<INCLUDE_TYPOSCRIPT: source="FILE:EXT:mediace/Configuration/TypoScript/setup.txt">', 'defaultContentRendering');

if (TYPO3_MODE === 'FE') {
// Register the basic media wizard provider
Expand Down