Skip to content

Commit

Permalink
[TASK] Use Core system column enrichment (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
nhovratov authored Sep 16, 2024
1 parent 4d76c61 commit 5d37c15
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 685 deletions.
118 changes: 0 additions & 118 deletions Classes/Generator/TcaGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -948,129 +948,11 @@ protected function generateBaseTableTca(TableDefinition $tableDefinition): array
}
if ($capability->isLanguageAware()) {
$ctrl += [
'transOrigPointerField' => 'l10n_parent',
'translationSource' => 'l10n_source',
'transOrigDiffSourceField' => 'l10n_diffsource',
'languageField' => 'sys_language_uid',
];
}
if ($capability->isEditLockingEnabled()) {
$columns['editlock'] = [
'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:editlock',
'config' => [
'type' => 'check',
'renderType' => 'checkboxToggle',
],
];
}
if ($capability->hasDisabledRestriction()) {
$columns['hidden'] = [
'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.disable',
'config' => [
'type' => 'check',
'renderType' => 'checkboxToggle',
],
];
}
if ($capability->hasUserGroupRestriction()) {
$columns['fe_group'] = [
'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.fe_group',
'config' => [
'type' => 'select',
'renderType' => 'selectMultipleSideBySide',
'size' => 5,
'maxitems' => 20,
'items' => [
[
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.hide_at_login',
'value' => -1,
],
[
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.any_login',
'value' => -2,
],
[
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.usergroups',
'value' => '--div--',
],
],
'exclusiveKeys' => '-1,-2',
'foreign_table' => 'fe_groups',
],
];
}
if ($capability->hasStartTimeRestriction()) {
$columns['starttime'] = [
'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime',
'config' => [
'type' => 'datetime',
'default' => 0,
],
'l10n_mode' => 'exclude',
'l10n_display' => 'defaultAsReadonly',
];
}
if ($capability->hasEndTimeRestriction()) {
$columns['endtime'] = [
'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.endtime',
'config' => [
'type' => 'datetime',
'default' => 0,
'range' => [
'upper' => mktime(0, 0, 0, 1, 1, 2038),
],
],
'l10n_mode' => 'exclude',
'l10n_display' => 'defaultAsReadonly',
];
}
if ($capability->isLanguageAware()) {
$columns['sys_language_uid'] = [
'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language',
'config' => [
'type' => 'language',
],
];
$columns['l10n_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' => $tableDefinition->getTable(),
'foreign_table_where' => 'AND ' . $tableDefinition->getTable() . '.pid=###CURRENT_PID### AND ' . $tableDefinition->getTable() . '.sys_language_uid IN (-1,0)',
'default' => 0,
],
];
$columns['l10n_diffsource'] = [
'config' => [
'type' => 'passthrough',
],
];
}
if ($capability->hasInternalDescription()) {
$columns['internal_description'] = [
'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.description',
'config' => [
'type' => 'text',
'rows' => 5,
'cols' => 30,
],
];
}

// This is a child table and can only be created by the parent.
foreach ($tableDefinition->getParentReferences() ?? [] as $parentReference) {
Expand Down
Loading

0 comments on commit 5d37c15

Please sign in to comment.