mirror of https://github.com/FriendsOfTYPO3/tea.git synced 2024-12-22 23:46:10 +01:00

[FEATURE] Make the records localizable (#751)

This commit is contained in:
Łukasz Uznański 2023-05-03 14:10:23 +02:00 committed by GitHub
parent b06eb38f9a
commit 62ed478ce6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,6 +13,10 @@ $tca = [
'enablecolumns' => [
'fe_group' => 'fe_group',
],
'transOrigPointerField' => 'l18n_parent',
'transOrigDiffSourceField' => 'l18n_diffsource',
'languageField' => 'sys_language_uid',
'translationSource' => 'l10n_source',
],
'types' => [
'1' => ['showitem' => '
@ -29,6 +33,43 @@ $tca = [
],
],
'columns' => [
'sys_language_uid' => [
'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language',
'config' => [
'type' => 'language',
],
],
'l18n_parent' => [
'displayCond' => 'FIELD:sys_language_uid:>:0',
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'items' => [
[
'label' => '',
'value' => 0,
],
],
'foreign_table' => 'tx_tea_domain_model_product_tea',
'foreign_table_where' =>
'AND {#tx_tea_domain_model_product_tea}.{#pid}=###CURRENT_PID###'
. ' AND {#tx_tea_domain_model_product_tea}.{#sys_language_uid} IN (-1,0)',
'default' => 0,
],
],
'l10n_source' => [
'config' => [
'type' => 'passthrough',
],
],
'l18n_diffsource' => [
'config' => [
'type' => 'passthrough',
'default' => '',
],
],
'title' => [
'label' => 'LLL:EXT:tea/Resources/Private/Language/locallang_db.xlf:tx_tea_domain_model_product_tea.title',
'config' => [
@ -112,6 +153,13 @@ if ($typo3Version->getMajorVersion() < 12) {
]
);
unset($tca['columns']['title']['required']);
$tca['columns']['l18n_parent']['config']['items'] = [
[
0 => '',
1 => 0,
],
];
$tca['columns']['image'] = [
'label' => 'LLL:EXT:tea/Resources/Private/Language/locallang_db.xlf:tx_tea_domain_model_product_tea.image',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(