diff --git a/Classes/Controller/VimeoController.php b/Classes/Controller/VimeoController.php index 8f736280eca9ccad14510423274ed79f8a39314e..74144e942b169371bc45f385b946341534427fae 100644 --- a/Classes/Controller/VimeoController.php +++ b/Classes/Controller/VimeoController.php @@ -40,6 +40,7 @@ use TYPO3\CMS\Core\Imaging\ImageManipulation\CropVariantCollection; use TYPO3\CMS\Core\Resource\FileReference; use TYPO3\CMS\Core\Resource\FileRepository; use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Core\Utility\VersionNumberUtility; use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; use TYPO3\CMS\Extbase\Service\ImageService; @@ -98,6 +99,13 @@ class VimeoController extends ActionController { } } + $typo3Version = VersionNumberUtility::getCurrentTypo3Version(); + if (version_compare($typo3Version, '13.0.0', '<')) { + $disableVimeoCache = (bool) GeneralUtility::_GP('disableVimeoCache'); + } else { + $disableVimeoCache = (bool) ($this->request->getParsedBody()['disableVimeoCache'] ?? $this->request->getQueryParams()['disableVimeoCache'] ?? null); + } + // Add third-party filters $filterInstances = $this->handleFrontendFilters($filterValues); diff --git a/Classes/Filter/FilterParameterBag.php b/Classes/Filter/FilterParameterBag.php index e49e22c1d3cea7080dc514da81fba4b1672af144..aa9a76f74e86870a92f2dc09c13c77117629a5bf 100644 --- a/Classes/Filter/FilterParameterBag.php +++ b/Classes/Filter/FilterParameterBag.php @@ -26,39 +26,51 @@ namespace SGalinski\SgVimeo\Filter; class FilterParameterBag { - protected array $parameters; - protected array $filterInstances; + protected array $parameters; + protected array $filterInstances; + protected bool $disableCache = FALSE; - public function __construct(array $parameters = [], array $filterInstances = []) { - $this->parameters = $parameters; - $this->filterInstances = $filterInstances; - } + public function __construct(array $parameters = [], array $filterInstances = [], bool $disableCache = FALSE) { + $this->parameters = $parameters; + $this->filterInstances = $filterInstances; + $this->disableCache = $disableCache; + } - public function get(string $key, $default = NULL) { - return $this->parameters[$key] ?? $default; - } + public function get(string $key, $default = NULL) { + return $this->parameters[$key] ?? $default; + } - public function set(string $key, $value): void { - $this->parameters[$key] = $value; - } + public function set(string $key, $value): void { + $this->parameters[$key] = $value; + } - public function all(): array { - return $this->parameters; - } + public function all(): array { + return $this->parameters; + } - public function remove(string $key): void { - unset($this->parameters[$key]); - } + public function remove(string $key): void { + unset($this->parameters[$key]); + } - public function merge(array $parameters): void { - $this->parameters = array_merge($this->parameters, $parameters); - } + public function merge(array $parameters): void { + $this->parameters = array_merge($this->parameters, $parameters); + } - public function getFilterInstances(): array { - return $this->filterInstances; - } + public function getFilterInstances(): array { + return $this->filterInstances; + } - public function setFilterInstances(array $filterInstances): void { - $this->filterInstances = $filterInstances; - } + public function setFilterInstances(array $filterInstances): void { + $this->filterInstances = $filterInstances; + } + + public function getDisableCache(): bool + { + return $this->disableCache; + } + + public function setDisableCache(bool $disableCache): void + { + $this->disableCache = $disableCache; + } } diff --git a/Classes/Service/LicenceCheckService.php b/Classes/Service/LicenceCheckService.php index c7825c5faf4870e1b378fd7eec6b32d6fdae5049..b46e40fa85ca683bdbaf10c50958b42862593526 100644 --- a/Classes/Service/LicenceCheckService.php +++ b/Classes/Service/LicenceCheckService.php @@ -129,12 +129,13 @@ class LicenceCheckService { '4.2.0' => 1717678615, // Tue, 06 Jun 2023 14:57:50 GMT '5.0.0' => 1729271668, // Tue, 18 Oct 2024 20:15:50 GMT+3 '5.0.1' => 1732058531, // Tue, 19 Nov 2024 23:15:50 GMT+3 + '5.1.0' => 1733341275, // Wed, 04 Dez 2024 20:57:50 GMT+3 ]; /** * The current extension version */ - public const CURRENT_VERSION = '5.0.0'; + public const CURRENT_VERSION = '5.1.0'; /** * @param mixed $validUntil A timestamp, which says the lifetime of this key. diff --git a/Classes/Service/VimeoService.php b/Classes/Service/VimeoService.php index 4377bc4d980efa9bbd574365d1fcf22fb130579d..4d6877c99187cb491defa4dc57d445133e2edaf3 100644 --- a/Classes/Service/VimeoService.php +++ b/Classes/Service/VimeoService.php @@ -145,7 +145,7 @@ class VimeoService implements LoggerAwareInterface { $response = []; $this->maxResultsPerPage = $maxResults; $cacheKey = 'sg_vimeo' . sha1($vimeoId . $maxResults . $queryString . $filtersHash); - $disableVimeoCache = (bool) GeneralUtility::_GP('disableVimeoCache'); + $disableVimeoCache = $parameterBag->getDisableCache(); if (!$disableVimeoCache) { $cachedResult = $this->cache->get($cacheKey); if ($cachedResult) { diff --git a/Configuration/TCA/Overrides/tt_content.php b/Configuration/TCA/Overrides/tt_content.php index d06cac87a8090af06cdf21219f32988171a46e54..66a03459e3cea9e06871509326a2bd90bed0a618 100644 --- a/Configuration/TCA/Overrides/tt_content.php +++ b/Configuration/TCA/Overrides/tt_content.php @@ -6,7 +6,10 @@ use TYPO3\CMS\Extbase\Utility\ExtensionUtility; $pluginSignature = ExtensionUtility::registerPlugin( 'SgVimeo', 'Vimeo', - 'Vimeo Videos' + 'Vimeo Videos', + 'extension-sg_vimeo', + 'plugins', + 'LLL:EXT:sg_vimeo/Resources/Private/Language/locallang.xlf:vimeoPluginDescription' ); $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform'; ExtensionManagementUtility::addPiFlexFormValue( diff --git a/composer.json b/composer.json index 6323d53bc56fa5de631f05140b36e555f513c063..5ebcbd03614e76e22fb883266e101fc0027fd671 100644 --- a/composer.json +++ b/composer.json @@ -4,9 +4,9 @@ "description": "A solution for embedding Vimeo videos, playlists, or channels easily into TYPO3 pages.", "homepage": "https://www.sgalinski.de", "license": "GPL-2.0-or-later", - "version": "5.0.1", + "version": "5.1.0", "require": { - "typo3/cms-core": "^12.4.0", + "typo3/cms-core": "^12.4 || ^13.4", "vimeo/vimeo-api": "^3.0" }, "replace": { diff --git a/ext_emconf.php b/ext_emconf.php index 088d56413805a9d96e3f9e48c1d6a83904f6dfea..a6ff2db7f3d1939f1e5599876a91a520c3e1334c 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -32,10 +32,10 @@ $EM_CONF['sg_vimeo'] = [ 'author_email' => 'stefan@sgalinski.de', 'author_company' => 'sgalinski Internet Services (https://www.sgalinski.de)', 'state' => 'stable', - 'version' => '5.0.1', + 'version' => '5.1.0', 'constraints' => [ 'depends' => [ - 'typo3' => '12.4.0-12.4.99', + 'typo3' => '12.4.0-13.4.99', 'php' => '8.1.0-8.3.99', ], 'conflicts' => [], diff --git a/ext_localconf.php b/ext_localconf.php index 04869ea577a64cb6a82c36af13502a51d6375420..374ee207cebe8cb8ba0a285c203aec6057cdf540 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -6,6 +6,7 @@ use SGalinski\SgVimeo\Form\Element\LicenceStatus; use SGalinski\SgVimeo\Hooks\LicenceCheckHook; use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; use TYPO3\CMS\Extbase\Utility\ExtensionUtility; +use TYPO3\CMS\Core\Utility\VersionNumberUtility; if ($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['sg_vimeo']['uncached'] ?? FALSE) { // Uncached version @@ -30,10 +31,13 @@ if ($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['sg_vimeo']['uncached'] ?? FALSE) ); } -// include Plugin sg_twitter -ExtensionManagementUtility::addPageTSConfig( - '@import "EXT:sg_vimeo/Configuration/TsConfig/Page/NewContentElementWizard.tsconfig"' -); +$currentTypo3Version = VersionNumberUtility::getCurrentTypo3Version(); +if (version_compare($currentTypo3Version, '13.0.0', '<')) { +// include Plugin sg_vimeo + ExtensionManagementUtility::addPageTSConfig( + '@import "EXT:sg_vimeo/Configuration/TsConfig/Page/NewContentElementWizard.tsconfig"' + ); +} // Caching $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['sgvimeo_cache'] ??= [];