thuecat/Configuration/TCA/tx_thuecat_import_configuration.php
Daniel Siepmann 54d244b804
TYPO3 V12 Update (#116)
* Support TYPO3 v12 and PHP 8.3
2023-12-05 09:43:55 +01:00

96 lines
3.4 KiB
PHP

<?php
declare(strict_types=1);
use WerkraumMedia\ThueCat\Extension;
defined('TYPO3') or die();
return (static function (string $extensionKey, string $tableName) {
$languagePath = Extension::getLanguagePath() . 'locallang_tca.xlf:' . $tableName;
$flexFormConfigurationPath = 'FILE:EXT:' . Extension::EXTENSION_KEY . '/Configuration/FlexForm/';
return [
'ctrl' => [
'label' => 'title',
'iconfile' => Extension::getIconPath() . $tableName . '.svg',
'type' => 'type',
'default_sortby' => 'title',
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'title' => $languagePath,
'enablecolumns' => [
'disabled' => 'disable',
],
'searchFields' => 'title',
'rootLevel' => -1,
],
'columns' => [
'title' => [
'label' => $languagePath . '.title',
'config' => [
'type' => 'input',
'max' => 255,
'eval' => 'trim,unique',
'required' => true,
],
],
'type' => [
'label' => $languagePath . '.type',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'items' => [
[
'label' => $languagePath . '.type.static',
'value' => 'static',
],
[
'label' => $languagePath . '.type.syncScope',
'value' => 'syncScope',
],
[
'label' => $languagePath . '.type.containsPlace',
'value' => 'containsPlace',
],
],
],
],
'configuration' => [
'label' => $languagePath . '.configuration',
'config' => [
'type' => 'flex',
'ds_pointerField' => 'type',
'ds' => [
'default' => $flexFormConfigurationPath . 'ImportConfiguration/Static.xml',
'static' => $flexFormConfigurationPath . 'ImportConfiguration/Static.xml',
'syncScope' => $flexFormConfigurationPath . 'ImportConfiguration/SyncScope.xml',
'containsPlace' => $flexFormConfigurationPath . 'ImportConfiguration/ContainsPlace.xml',
],
],
],
'tstamp' => [
'config' => [
'type' => 'datetime',
'format' => 'datetime',
'readOnly' => true,
],
],
// Configured for usage within Extbase, not TCA itself
'logs' => [
'config' => [
'type' => 'inline',
'foreign_table' => 'tx_thuecat_import_log',
'foreign_field' => 'configuration',
'readOnly' => true,
],
],
],
'types' => [
'0' => [
'showitem' => 'title, type, configuration',
],
],
];
})(Extension::EXTENSION_KEY, 'tx_thuecat_import_configuration');