Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Build/composer-unused/composer-unused.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
declare(strict_types=1);

use ComposerUnused\ComposerUnused\Configuration\Configuration;
use ComposerUnused\ComposerUnused\Configuration\NamedFilter;


return static function (Configuration $config): Configuration {
$config->addNamedFilter(NamedFilter::fromString('typo3/cms-fluid'));
return $config;
};
4 changes: 4 additions & 0 deletions Build/phpstan/phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ parameters:
- '$_FILES'
- '$_SERVER'
message: 'Use PSR-7 API instead'

excludePaths:
# We need this Class only for V12. So we exclude it here
- ../../Classes/Upgrades/AbstractListTypeToCTypeUpdate.php
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is related to the upgrade wizard (which is not part of this PR). So we don't need the changed to this file in this PR.


ignoreErrors:
-
Expand Down
3 changes: 2 additions & 1 deletion Configuration/Services.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
->services()
->defaults()
->autowire()
->autoconfigure();
->autoconfigure()
->public();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed for this PR? If so, why?


$services
->load('TTN\\Tea\\', '../Classes/*')
Expand Down
88 changes: 50 additions & 38 deletions Configuration/TCA/Overrides/tt_content.php
Original file line number Diff line number Diff line change
@@ -1,56 +1,68 @@
<?php

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;

defined('TYPO3') || die();

call_user_func(
static function (): void {
// This makes the plugin selectable in the BE.
$indexPluginSignature = ExtensionUtility::registerPlugin(
// extension name, matching the PHP namespaces (but without the vendor)
'Tea',
// arbitrary, but unique plugin name (not visible in the BE)
'TeaIndex',
// plugin title, as visible in the drop-down in the BE
'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',
/**
* Add new select group for content element
*/
ExtensionManagementUtility::addTcaSelectItemGroup(
'tt_content',
'CType',
'tea',
'LLL:EXT:tea/Resources/Private/Language/locallang_db.xlf:tx_tea_domain_model_tea.pluginGroup',
'after:default'
);

// These two commands add the flexform configuration for the plugin.
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$indexPluginSignature] = 'pi_flexform';
ExtensionManagementUtility::addPiFlexFormValue(
$indexPluginSignature,
'FILE:EXT:tea/Configuration/FlexForms/TeaIndex.xml',
);
/**
* Register all plugins
*/
$plugins = ['tea_index', 'tea_show', 'tea_front_end_editor'];

$showPluginSignature = ExtensionUtility::registerPlugin(
'Tea',
'TeaShow',
'LLL:EXT:tea/Resources/Private/Language/locallang.xlf:plugin.tea_show',
'EXT:tea/Resources/Public/Icons/Extension.svg',
);
foreach ($plugins as $contentType) {
// This makes the plugin selectable in the BE.
ExtensionUtility::registerPlugin(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ExtensionUtility::registerPlugin returns the plugin signature. Can we (re-)use it for ExtensionManagementUtility::addToAllTCAtypes and ExtensionManagementUtility::addPiFlexFormValue?

// extension name, matching the PHP namespaces (but without the vendor)
'Tea',
// arbitrary, but unique plugin name (not visible in the BE)
GeneralUtility::underscoredToUpperCamelCase($contentType),
// plugin title, as visible in the drop-down in the BE
'LLL:EXT:tea/Resources/Private/Language/locallang.xlf:plugin.' . $contentType,
// the icon visible in the drop-down in the BE
'EXT:tea/Resources/Public/Icons/Extension.svg',
'tea'
);

$editorPluginSignature = ExtensionUtility::registerPlugin(
'Tea',
'TeaFrontEndEditor',
'LLL:EXT:tea/Resources/Private/Language/locallang.xlf:plugin.tea_frontend_editor',
'EXT:tea/Resources/Public/Icons/Extension.svg',
);
}

// These two commands add the flexform configuration for the plugin.
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$editorPluginSignature] = 'pi_flexform';
// Add the FlexForm to the show item list
ExtensionManagementUtility::addToAllTCAtypes(
'tt_content',
'--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.plugin, pi_flexform',
'tea_teaindex',
'after:palette:headers'
);
// Add the flexform configuration for the TeaIndex plugin.
ExtensionManagementUtility::addPiFlexFormValue(
'*',
'FILE:EXT:tea/Configuration/FlexForms/TeaIndex.xml',
'tea_teaindex'
);
// Add the flexform configuration for the FE editor plugin.
ExtensionManagementUtility::addPiFlexFormValue(
$editorPluginSignature,
'FILE:EXT:tea/Configuration/FlexForms/FrontEndEditor.xml'
'*',
'FILE:EXT:tea/Configuration/FlexForms/FrontEndEditor.xml',
'tea_front_end_editor'
);

// This removes the default controls from the plugins.
$controlsToRemove = 'recursive,pages';
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist'][$indexPluginSignature] = $controlsToRemove;
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist'][$showPluginSignature] = $controlsToRemove;
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist'][$editorPluginSignature] = $controlsToRemove;
},
/**
* Register TeaIndex as "Insert Record"
*/
ExtensionManagementUtility::addToInsertRecords('tea_index');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we do this, we should have the other plugins as well.

}
);
14 changes: 13 additions & 1 deletion Resources/Private/Language/de.locallang_db.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@
<source>Visible</source>
<target>Sichtbar</target>
</trans-unit>
</body>
<trans-unit id="tx_tea_domain_model_tea.pluginGroup">
<source>Tea plugins</source>
<target>Tea</target>
</trans-unit>
<trans-unit id="plugin.tea_index.title">
<source>Tea Index</source>
<target>Teeliste</target>
</trans-unit>
<trans-unit id="plugin.tea_index.description">
<source>Tea plugin to show the listview.</source>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<source>Tea plugin to show the listview.</source>
<source>Tea plugin to show the list view.</source>

(also in the other file)

<target>Tea Plugin für eine Listenansicht.</target>
</trans-unit>
</body>
</file>
</xliff>
11 changes: 10 additions & 1 deletion Resources/Private/Language/locallang_db.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@
<trans-unit id="tx_tea_domain_model_tea.hidden">
<source>Visible</source>
</trans-unit>
</body>
<trans-unit id="tx_tea_domain_model_tea.pluginGroup">
<source>Tea</source>
</trans-unit>
<trans-unit id="plugin.tea_index.title">
<source>Tea Index</source>
</trans-unit>
<trans-unit id="plugin.tea_index.description">
<source>Tea plugin to show the listview.</source>
</trans-unit>
</body>
</file>
</xliff>
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
"tt_content"
,"uid","pid","CType","header","list_type","pi_flexform"
,1,1,"list","Tea FrontEnd Editor","tea_teafrontendeditor","<?xml version=""1.0"" encoding=""utf-8"" standalone=""yes"" ?>
<T3FlexForms>
<data>
<sheet index=""pagesAndFolders"">
<language index=""lDEF"">
<field index=""persistence.storagePid"">
<value index=""vDEF"">2</value>
</field>
</language>
</sheet>
</data>
</T3FlexForms>"
,"uid","pid","CType","header","pi_flexform"
,1,1,"tea_teafrontendeditor","Tea FrontEnd Editor","<?xml version=""1.0"" encoding=""utf-8"" standalone=""yes"" ?>
<T3FlexForms>
<data>
<sheet index=""pagesAndFolders"">
<language index=""lDEF"">
<field index=""persistence.storagePid"">
<value index=""vDEF"">2</value>
</field>
</language>
</sheet>
</data>
</T3FlexForms>"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"tt_content"
,"uid","pid","CType","header","list_type","pi_flexform"
,1,1,"list","Tea index","tea_teaindex","<?xml version=""1.0"" encoding=""utf-8"" standalone=""yes"" ?>
,"uid","pid","CType","header","pi_flexform"
,1,1,"tea_teaindex","Tea index","<?xml version=""1.0"" encoding=""utf-8"" standalone=""yes"" ?>
<T3FlexForms>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should indent the XML to align with the <?xml again.

<data>
<sheet index=""pagesAndFolders"">
Expand All @@ -18,4 +18,4 @@
</sheet>
</data>
</T3FlexForms>"
,2,3,"list","Tea show","tea_teashow",""
,2,3,"tea_teashow","Tea show",""
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"psr/http-message": "^1.0.1",
"typo3/cms-core": "^12.4.41",
"typo3/cms-extbase": "^12.4.41 || ^13.4",
"typo3/cms-fluid": "^12.4.41 || ^13.4",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this needs to stay as we have Fluid templates.

"typo3/cms-frontend": "^12.4.41 || ^13.4"
},
"require-dev": {
Expand Down
12 changes: 9 additions & 3 deletions ext_localconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use TTN\Tea\Controller\FrontEndEditorController;
use TTN\Tea\Controller\TeaController;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;

defined('TYPO3') or die('Access denied.');
Expand All @@ -21,7 +22,8 @@
// non-cacheable actions
[
TeaController::class => '',
]
],
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
);
ExtensionUtility::configurePlugin(
'Tea',
Expand All @@ -31,7 +33,8 @@
],
[
TeaController::class => '',
]
],
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
);

// This makes the plugin available for front-end rendering.
Expand All @@ -49,5 +52,8 @@
// All actions need to be non-cacheable because they either contain dynamic data,
// or because they are specific to the logged-in FE user (while FE content is cached by FE groups).
FrontEndEditorController::class => 'index, edit, update, create, new, delete',
]
],
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
);

ExtensionManagementUtility::addPageTSConfig('@import \'EXT:tea/Configuration/TSconfig/Page/ContentElementWizard.tsconfig\'');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file does not exist, and this PR does not introduce it. So this line should be removed.