2018-05-26 20:46:55 +02:00
|
|
|
<?php
|
2021-11-17 13:14:43 +01:00
|
|
|
|
2023-05-09 06:11:25 +02:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
use TTN\Tea\Controller\TeaController;
|
2023-05-08 18:38:12 +02:00
|
|
|
use TYPO3\CMS\Core\Information\Typo3Version;
|
|
|
|
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
|
|
|
|
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
2023-05-09 06:11:25 +02:00
|
|
|
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;
|
|
|
|
|
2022-08-28 12:22:38 +02:00
|
|
|
defined('TYPO3') or die('Access denied.');
|
2019-12-07 19:15:24 +01:00
|
|
|
|
2023-05-09 06:11:25 +02:00
|
|
|
// This makes the plugin available for front-end rendering.
|
|
|
|
ExtensionUtility::configurePlugin(
|
|
|
|
// extension name, matching the PHP namespaces (but without the vendor)
|
|
|
|
'Tea',
|
|
|
|
// arbitrary, but unique plugin name (not visible in the BE)
|
|
|
|
'TeaIndex',
|
|
|
|
// all actions
|
|
|
|
[
|
|
|
|
TeaController::class => 'index',
|
|
|
|
],
|
|
|
|
// non-cacheable actions
|
|
|
|
[
|
|
|
|
TeaController::class => '',
|
|
|
|
]
|
|
|
|
);
|
|
|
|
ExtensionUtility::configurePlugin(
|
|
|
|
'Tea',
|
|
|
|
'TeaShow',
|
|
|
|
[
|
|
|
|
TeaController::class => 'show',
|
|
|
|
],
|
|
|
|
[
|
|
|
|
TeaController::class => '',
|
|
|
|
]
|
|
|
|
);
|
2023-05-08 18:38:12 +02:00
|
|
|
$versionInformation = GeneralUtility::makeInstance(Typo3Version::class);
|
|
|
|
// Only include page.tsconfig if TYPO3 version is below 12 so that it is not imported twice.
|
|
|
|
if ($versionInformation->getMajorVersion() < 12) {
|
|
|
|
ExtensionManagementUtility::addPageTSConfig(
|
|
|
|
'@import "EXT:tea/Configuration/page.tsconfig"'
|
|
|
|
);
|
|
|
|
}
|