diff --git a/CHANGELOG.md b/CHANGELOG.md
index dcd9de4..72ce3dd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
### Added
### Changed
+- Replace switchable controller actions with separate plugins (#575)
### Deprecated
diff --git a/Configuration/FlexForms/Plugin.xml b/Configuration/FlexForms/Plugin.xml
deleted file mode 100644
index a32f305..0000000
--- a/Configuration/FlexForms/Plugin.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-
-
- array
-
-
-
-
- reload
-
- select
- selectSingle
-
-
- LLL:EXT:tea/Resources/Private/Language/locallang.xlf:plugin.tea.index
- Tea->index
-
-
- LLL:EXT:tea/Resources/Private/Language/locallang.xlf:plugin.tea.show
- Tea->show
-
-
-
-
-
-
-
-
-
-
diff --git a/Configuration/TCA/Overrides/tt_content.php b/Configuration/TCA/Overrides/tt_content.php
index 21aeb20..0f13a4f 100644
--- a/Configuration/TCA/Overrides/tt_content.php
+++ b/Configuration/TCA/Overrides/tt_content.php
@@ -7,18 +7,23 @@ defined('TYPO3') || die();
// extension name, matching the PHP namespaces (but without the vendor)
'Tea',
// arbitrary, but unique plugin name (not visible in the BE)
- 'Tea',
+ 'TeaIndex',
// plugin title, as visible in the drop-down in the BE
- 'LLL:EXT:tea/Resources/Private/Language/locallang.xlf:plugin.tea',
+ 'LLL:EXT:tea/Resources/Private/Language/locallang.xlf:plugin.tea_index',
// the icon visible in the drop-down in the BE
'EXT:tea/Resources/Public/Icons/Extension.svg'
);
-// This removes the default controls from the plugin.
-$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['tea_tea'] = 'recursive,select_key,pages';
-// These two commands add the flexform configuration for the plugin.
-$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['tea_tea'] = 'pi_flexform';
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
- 'tea_tea',
- 'FILE:EXT:tea/Configuration/FlexForms/Plugin.xml'
+\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
+ 'Tea',
+ 'TeaShow',
+ 'LLL:EXT:tea/Resources/Private/Language/locallang.xlf:plugin.tea_show',
+ 'EXT:tea/Resources/Public/Icons/Extension.svg'
);
+
+// This removes the default controls from the plugin.
+$controlsToRemove = 'recursive,select_key,pages';
+$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist'] = [
+ 'tea_teaindex' => $controlsToRemove,
+ 'tea_teashow' => $controlsToRemove,
+];
diff --git a/Resources/Private/Language/de.locallang.xlf b/Resources/Private/Language/de.locallang.xlf
index cbe0ace..0f4f79d 100644
--- a/Resources/Private/Language/de.locallang.xlf
+++ b/Resources/Private/Language/de.locallang.xlf
@@ -3,19 +3,11 @@
-
-
- Tee
-
-
-
- Ansicht
-
-
+
Teeliste
-
+
Tee-Einzelansicht
diff --git a/Resources/Private/Language/locallang.xlf b/Resources/Private/Language/locallang.xlf
index 19852ed..c91701a 100644
--- a/Resources/Private/Language/locallang.xlf
+++ b/Resources/Private/Language/locallang.xlf
@@ -3,16 +3,10 @@
-
-
-
-
-
-
-
+
-
+
diff --git a/Resources/Private/Templates/Tea/Index.html b/Resources/Private/Templates/Tea/Index.html
index 91dccc5..21c5435 100644
--- a/Resources/Private/Templates/Tea/Index.html
+++ b/Resources/Private/Templates/Tea/Index.html
@@ -25,7 +25,7 @@
{tea.uid}
-
+
{tea.title}
|
diff --git a/ext_localconf.php b/ext_localconf.php
index ff7f2d9..5dad551 100644
--- a/ext_localconf.php
+++ b/ext_localconf.php
@@ -8,14 +8,24 @@ defined('TYPO3') or die('Access denied.');
// extension name, matching the PHP namespaces (but without the vendor)
'Tea',
// arbitrary, but unique plugin name (not visible in the BE)
- 'Tea',
+ 'TeaIndex',
// all actions
[
- \TTN\Tea\Controller\TeaController::class => 'index, show',
+ \TTN\Tea\Controller\TeaController::class => 'index',
],
// non-cacheable actions
[
\TTN\Tea\Controller\TeaController::class => '',
]
);
+ \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
+ 'Tea',
+ 'TeaShow',
+ [
+ \TTN\Tea\Controller\TeaController::class => 'show',
+ ],
+ [
+ \TTN\Tea\Controller\TeaController::class => '',
+ ]
+ );
})();