From a19bea948f3545e876ebca66b94eefb1da004334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tanel=20P=C3=B5ld?= Date: Thu, 8 Feb 2024 22:12:03 +0200 Subject: [PATCH] [TASK] add v13 compatibility and drop v11 --- .../TCA/Overrides/sys_file_reference.php | 266 ++++++++---------- Configuration/TCA/Overrides/tt_content.php | 46 +-- composer.json | 8 +- ext_emconf.php | 10 +- ext_localconf.php | 15 +- ext_tables.php | 2 +- ext_tables.sql | 1 - 7 files changed, 156 insertions(+), 192 deletions(-) diff --git a/Configuration/TCA/Overrides/sys_file_reference.php b/Configuration/TCA/Overrides/sys_file_reference.php index d4bd303..4fede47 100644 --- a/Configuration/TCA/Overrides/sys_file_reference.php +++ b/Configuration/TCA/Overrides/sys_file_reference.php @@ -1,52 +1,46 @@ array ( - 'exclude' => 1, - 'label' => 'LLL:EXT:youtubevideo/Resources/Private/Language/locallang_db.xlf:tx_youtubevideo_rel.title', - 'config' => [ - 'type' => 'check', - 'renderType' => 'checkboxToggle', - 'default' => 1, - 'behaviour' => [ - 'allowLanguageSynchronization' => true, - ], - 'items' => [ - [ - 0 => '', - 1 => '', - ] - ], - ] - ), - 'tx_youtubevideo_starttime' => array( - 'exclude' => 0, - 'label' => 'LLL:EXT:youtubevideo/Resources/Private/Language/locallang_db.xlf:tx_youtubevideo_starttime.title', - 'config' => array( - 'type' => 'input', - 'size' => '8', - 'eval' => 'trim,nospace,Brightside\Youtubevideo\Evaluation\HoursMinutesSeconds', - 'behaviour' => [ - 'allowLanguageSynchronization' => true, - ], - ), - ), - 'tx_youtubevideo_endtime' => array( - 'exclude' => 0, - 'label' => 'LLL:EXT:youtubevideo/Resources/Private/Language/locallang_db.xlf:tx_youtubevideo_endtime.title', - 'config' => array( - 'type' => 'input', - 'size' => '1', - 'eval' => 'trim,nospace,Brightside\Youtubevideo\Evaluation\HoursMinutesSeconds', - 'behaviour' => [ - 'allowLanguageSynchronization' => true, - ], - ), - ), - 'tx_youtubevideo_ratio' => array( + 'tx_youtubevideo_rel' => [ + 'exclude' => 1, + 'label' => 'LLL:EXT:youtubevideo/Resources/Private/Language/locallang_db.xlf:tx_youtubevideo_rel.title', + 'config' => [ + 'type' => 'check', + 'renderType' => 'checkboxToggle', + 'default' => 1, + 'behaviour' => [ + 'allowLanguageSynchronization' => true, + ], + ], + ], + 'tx_youtubevideo_starttime' => [ + 'exclude' => 0, + 'label' => 'LLL:EXT:youtubevideo/Resources/Private/Language/locallang_db.xlf:tx_youtubevideo_starttime.title', + 'config' => [ + 'type' => 'input', + 'size' => '8', + 'eval' => 'trim,nospace,Brightside\Youtubevideo\Evaluation\HoursMinutesSeconds', + 'behaviour' => [ + 'allowLanguageSynchronization' => true, + ], + ], + ], + 'tx_youtubevideo_endtime' => [ + 'exclude' => 0, + 'label' => 'LLL:EXT:youtubevideo/Resources/Private/Language/locallang_db.xlf:tx_youtubevideo_endtime.title', + 'config' => [ + 'type' => 'input', + 'size' => '1', + 'eval' => 'trim,nospace,Brightside\Youtubevideo\Evaluation\HoursMinutesSeconds', + 'behaviour' => [ + 'allowLanguageSynchronization' => true, + ], + ], + ], + 'tx_youtubevideo_ratio' => [ 'exclude' => 1, 'label' => 'LLL:EXT:youtubevideo/Resources/Private/Language/locallang_db.xlf:tx_youtubevideo_ratio.title', - 'config' => array( + 'config' => [ 'type' => 'select', 'renderType' => 'selectSingle', 'items' => [ @@ -56,118 +50,98 @@ 'size' => 1, 'maxitems' => 1, 'behaviour' => [ - 'allowLanguageSynchronization' => true, + 'allowLanguageSynchronization' => true, ] - ) - ), - 'tx_youtubevideo_mute' => array ( - 'exclude' => 1, - 'label' => 'LLL:EXT:youtubevideo/Resources/Private/Language/locallang_db.xlf:tx_youtubevideo_mute.title', - 'config' => [ - 'type' => 'check', - 'renderType' => 'checkboxToggle', - 'behaviour' => [ - 'allowLanguageSynchronization' => true, ], - 'items' => [ - [ - 0 => '', - 1 => '', - ] + ], + 'tx_youtubevideo_mute' => [ + 'exclude' => 1, + 'label' => 'LLL:EXT:youtubevideo/Resources/Private/Language/locallang_db.xlf:tx_youtubevideo_mute.title', + 'config' => [ + 'type' => 'check', + 'renderType' => 'checkboxToggle', + 'behaviour' => [ + 'allowLanguageSynchronization' => true, + ], + + ], + ], + 'tx_youtubevideo_fullscreen' => [ + 'exclude' => 1, + 'label' => 'LLL:EXT:youtubevideo/Resources/Private/Language/locallang_db.xlf:tx_youtubevideo_fullscreen.title', + 'config' => [ + 'type' => 'check', + 'renderType' => 'checkboxToggle', + 'default' => 1, + 'behaviour' => [ + 'allowLanguageSynchronization' => true, + ], ], - ] - ), - 'tx_youtubevideo_fullscreen' => array ( - 'exclude' => 1, - 'label' => 'LLL:EXT:youtubevideo/Resources/Private/Language/locallang_db.xlf:tx_youtubevideo_fullscreen.title', - 'config' => [ - 'type' => 'check', - 'renderType' => 'checkboxToggle', - 'default' => 1, - 'behaviour' => [ - 'allowLanguageSynchronization' => true, - ], - 'items' => [ - [ - 0 => '', - 1 => '', - 'invertStateDisplay' => false, - ] - ], - ] - ), - 'tx_youtubevideo_loop' => array ( - 'exclude' => 1, - 'label' => 'LLL:EXT:youtubevideo/Resources/Private/Language/locallang_db.xlf:tx_youtubevideo_loop.title', - 'config' => [ - 'type' => 'check', - 'renderType' => 'checkboxToggle', - 'behaviour' => [ - 'allowLanguageSynchronization' => true, - ], - 'items' => [ - [ - 0 => '', - 1 => '', - ] - ], - ] - ), - 'tx_youtubevideo_coverimage' => [ - 'exclude' => 1, - 'label' => 'LLL:EXT:youtubevideo/Resources/Private/Language/locallang_db.xlf:tx_youtubevideo_cover.image', - 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( - 'tx_youtubevideo_coverimage', - [ - 'behaviour' => [ - 'allowLanguageSynchronization' => true, + ], + 'tx_youtubevideo_loop' => [ + 'exclude' => 1, + 'label' => 'LLL:EXT:youtubevideo/Resources/Private/Language/locallang_db.xlf:tx_youtubevideo_loop.title', + 'config' => [ + 'type' => 'check', + 'renderType' => 'checkboxToggle', + 'behaviour' => [ + 'allowLanguageSynchronization' => true, + ], ], - 'overrideChildTca' => [ - 'columns' => [ - 'crop' => [ - 'config' => [ - 'cropVariants' => [ - 'widescreen' => [ - 'title' => 'Widescreen (16:9)', - 'selectedRatio' => '16:9', - 'allowedAspectRatios' => [ - '16:9' => [ - 'title' => 'Widescreen', - 'value' => 16 / 9, - ], + ], + 'tx_youtubevideo_coverimage' => [ + 'exclude' => 1, + 'label' => 'LLL:EXT:youtubevideo/Resources/Private/Language/locallang_db.xlf:tx_youtubevideo_cover.image', + 'config' => [ + 'type' => 'file', + 'allowed' => $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'], + 'behaviour' => [ + 'allowLanguageSynchronization' => true, + ], + 'overrideChildTca' => [ + 'columns' => [ + 'crop' => [ + 'config' => [ + 'cropVariants' => [ + 'widescreen' => [ + 'title' => 'Widescreen (16:9)', + 'selectedRatio' => '16:9', + 'allowedAspectRatios' => [ + '16:9' => [ + 'title' => 'Widescreen', + 'value' => 16 / 9, + ], + ], + ], + 'tv' => [ + 'title' => 'Standard (4:3)', + 'selectedRatio' => '4:3', + 'allowedAspectRatios' => [ + '4:3' => [ + 'title' => 'TV', + 'value' => 4 / 3, + ], + ], + ], + ], + ], + ], + ], + 'types' => [ + '0' => [ + 'showitem' => ' + --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette, + --palette--;;filePalette' ], - ], - 'tv' => [ - 'title' => 'Standard (4:3)', - 'selectedRatio' => '4:3', - 'allowedAspectRatios' => [ - '4:3' => [ - 'title' => 'TV', - 'value' => 4 / 3, - ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [ + 'showitem' => ' + crop, + --palette--;;filePalette' ], - ], ], - ], - ], - ], - 'types' => [ - '0' => [ - 'showitem' => ' - --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette, - --palette--;;filePalette' ], - \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [ - 'showitem' => ' - crop, - --palette--;;filePalette' - ], ], - ], ], - $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] - ), - ], ); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns( diff --git a/Configuration/TCA/Overrides/tt_content.php b/Configuration/TCA/Overrides/tt_content.php index 50e30c4..4f29a87 100644 --- a/Configuration/TCA/Overrides/tt_content.php +++ b/Configuration/TCA/Overrides/tt_content.php @@ -1,45 +1,50 @@ get('youtubevideo'); // Add to content type dropdown -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem( - "tt_content", - "CType", +ExtensionManagementUtility::addTcaSelectItem( + 'tt_content', + 'CType', [ - 'YouTube Video', - 'youtubevideo_pi1', - 'youtubevideo_icon' + 'label' => 'YouTube Video', + 'description' => '', + 'value' => 'youtubevideo_pi1', + 'icon' => 'youtubevideo_icon', + 'group' => 'default', ], 'textmedia', 'after' ); + + $tempColumns = array( 'tx_youtubevideo_assets' => [ 'exclude' => 1, 'label' => 'Video', - 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('tx_youtubevideo_assets', [ - 'behaviour' => [ + 'config' => [ + 'type' => 'file', + 'allowed' => 'youtube', + 'behaviour' => [ 'allowLanguageSynchronization' => true, ], 'appearance' => [ 'createNewRelationLinkTitle' => 'Video', 'showPossibleLocalizationRecords' => true, ], - 'overrideChildTca' => [ + 'overrideChildTca' => [ 'types' => [ \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [ 'showitem' => ' @@ -48,7 +53,8 @@ ], ], ], - ], 'youtube'), + ], + ], 'tx_youtubevideo_colcount' => [ 'exclude' => 1, @@ -86,12 +92,6 @@ 'config' => [ 'type' => 'check', 'renderType' => 'checkboxToggle', - 'items' => [ - [ - 0 => '', - 1 => '', - ] - ], 'behaviour' => [ 'allowLanguageSynchronization' => true, ], @@ -99,7 +99,7 @@ ], ); -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('tt_content', $tempColumns); +ExtensionManagementUtility::addTCAcolumns('tt_content', $tempColumns); $GLOBALS['TCA']['tt_content']['types']['youtubevideo_pi1']['previewRenderer'] = \Brightside\Youtubevideo\Preview\YoutubevideoPreviewRenderer::class; $GLOBALS['TCA']['tt_content']['types']['youtubevideo_pi1']['showitem'] = ' --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general, diff --git a/composer.json b/composer.json index 6988e40..cf6f3a5 100644 --- a/composer.json +++ b/composer.json @@ -13,10 +13,10 @@ } ], "require": { - "typo3/cms-core": "^11.5 || ^12.4", - "typo3/cms-fluid-styled-content": "^11.5 || ^12.4", - "t3brightside/embedassets": "^1.2", - "t3brightside/paginatedprocessors": "^1.5" + "typo3/cms-core": "^12.4 || ^13.0", + "typo3/cms-fluid-styled-content": "^12.4 || ^13.0", + "t3brightside/embedassets": "^1.3", + "t3brightside/paginatedprocessors": "^1.6" }, "autoload": { "psr-4": { diff --git a/ext_emconf.php b/ext_emconf.php index 5e40b61..d180faf 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -4,7 +4,7 @@ 'title' => 'YouTube Video', 'description' => 'YouTube videos with custom cover images, gallery layout, pagination, GDPR, and backend previews.', 'category' => 'fe', - 'version' => '2.5.0', + 'version' => '3.0.0', 'state' => 'stable', 'clearcacheonload' => true, 'author' => 'Tanel Põld', @@ -12,10 +12,10 @@ 'author_company' => 'Brightside OÜ / t3brightside.com', 'constraints' => [ 'depends' => [ - 'typo3' => '11.5.0-12.4.99', - 'fluid_styled_content' => '11.5.0-12.4.99', - 'embedassets' => '1.2.0-1.99.99', - 'paginatedprocessors' => '1.5.0-1.5.99' + 'typo3' => '12.4.0-13.9.99', + 'fluid_styled_content' => '12.4.0-13.9.99', + 'embedassets' => '1.3.0-1.99.99', + 'paginatedprocessors' => '1.6.0-1.99.99' ], ], ]; diff --git a/ext_localconf.php b/ext_localconf.php index 521ea65..8afa294 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -1,26 +1,17 @@ getMajorVersion() < 12) { - ExtensionManagementUtility::addPageTSConfig(' - @import "EXT:youtubevideo/Configuration/page.tsconfig" - '); - } - $iconRegistry = GeneralUtility::makeInstance(IconRegistry::class); $iconRegistry->registerIcon( 'youtubevideo_icon', \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, - ['source' => 'EXT:youtubevideo/Resources/Public/Icons/ext_icon_content.svg'] + ['source' => 'EXT:youtubevideo/Resources/Public/Icons/ext_icon_content.svg'] ); - $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tce']['formevals']['Brightside\\Youtubevideo\\Evaluation\\HoursMinutesSeconds'] = ''; + $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tce']['formevals'][HoursMinutesSeconds::class] = ''; })(); diff --git a/ext_tables.php b/ext_tables.php index 609eefe..f4c7327 100644 --- a/ext_tables.php +++ b/ext_tables.php @@ -2,6 +2,6 @@ defined('TYPO3') || die('Access denied.'); (function () { - $GLOBALS['TBE_STYLES']['skins']['youtubevideo']['stylesheetDirectories'][] = + $GLOBALS['TYPO3_CONF_VARS']['BE']['stylesheets']['youtubevideo'] = 'EXT:youtubevideo/Resources/Public/Css/Backend/'; })(); diff --git a/ext_tables.sql b/ext_tables.sql index f16ce62..c09bdc7 100644 --- a/ext_tables.sql +++ b/ext_tables.sql @@ -9,7 +9,6 @@ CREATE TABLE tt_content ( tx_youtubevideo_descriptions int(1) DEFAULT '0' NOT NULL, ); - CREATE TABLE sys_file_reference ( tx_youtubevideo_autoplay tinyint(1) unsigned DEFAULT '0' NOT NULL, tx_youtubevideo_rel tinyint(1) unsigned DEFAULT '0' NOT NULL,