<?php
defined('TYPO3') or die();

$GLOBALS['TCA']['tx_news_domain_model_news']['columns']['fal_media']['config'] = [
    ### !!! Watch out for fieldName different from columnName
    'type' => 'file',
    'allowed' => $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'],
    'behaviour' => [
        'allowLanguageSynchronization' => true,
    ],
    'appearance' => [
        'createNewRelationLinkTitle' => 'LLL:EXT:news/Resources/Private/Language/locallang_db.xlf:tx_news_domain_model_news.fal_media.add',
        'showPossibleLocalizationRecords' => true,
        'showRemovedLocalizationRecords' => true,
        'showAllLocalizationLink' => true,
        'showSynchronizationLink' => true
    ],
    'foreign_match_fields' => [
        'fieldname' => 'fal_media',
        'tablenames' => 'tx_news_domain_model_news',
    ],
    'overrideChildTca' => [
        'types' => [
            \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
                'showitem' => '
                        --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;newsPalette,
                        --palette--;;imageoverlayPalette,
                        --palette--;;filePalette'
            ],
        ],
        'columns' => [
            'crop' => [
                'config' => [
                    'cropVariants' => [
                        'default' => [
                            'disabled' => true,
                        ],
                        'preview' => [
                            'title' => 'Vorschau',
                            'selectedRatio' => '3:2',
                            'allowedAspectRatios' => [
                                '3:2' => [
                                    'title' => '3:2',
                                    'value' => 3 / 2
                                ]
                            ]
                        ]
                    ]
                ]
            ]
        ]
    ],
];