Skip to content
Snippets Groups Projects
Commit 25077f14 authored by Georgi's avatar Georgi
Browse files

[TASK] TYPO3 v13 Support

parent f298e948
No related branches found
No related tags found
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;
}
}
......@@ -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(
......
......@@ -35,7 +35,7 @@ $EM_CONF['sg_vimeo'] = [
'version' => '5.0.1',
'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