Skip to content
Snippets Groups Projects
Commit 5c5c2986 authored by Georgi's avatar Georgi
Browse files

Merge branch 'feature/typo3_v13_support'

parents 6a0f6c14 d8ad27e0
No related branches found
Tags 5.1.0
1 merge request!14Feature/typo3 v13 support
......@@ -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);
......
......@@ -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;
}
}
......@@ -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.
......
......@@ -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) {
......
......@@ -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(
......
......@@ -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": {
......
......@@ -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' => [],
......
......@@ -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'] ??= [];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment