<?php
defined('TYPO3_MODE') || die();


/***************
 * Add content element to selector list
 */
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem(
    'tt_content',
    'CType',
    [
        'LLL:EXT:amds_bear/Resources/Private/Language/locallang_db.xlf:amdsbear_teaserbox.wizard.title',
        'amdsbear_teaserbox',
        'tx_amdsbear_teaserbox'
    ],
    'amdsbear_alert',
    'after'
);


/***************
 * Assign Icon
 */

$GLOBALS['TCA']['tt_content']['ctrl']['typeicon_classes']['amdsbear_teaserbox'] = 'tx_amdsbear_teaserbox';

/***************
 * Register fields
 */

$GLOBALS['TCA']['tt_content']['types'] += [
    'amdsbear_teaserbox' =>
        [
            'columnsOverrides' =>
                [
                    'bodytext' =>
                        [
                            'config' =>
                                [
                                    'richtextConfiguration' => 'default',
                                    'enableRichtext' => 1,
                                ],
                        ],
                    'image' =>
                        [
                            'config' => [
                                'maxitems' => 1
                            ],
                        ],
                ],
            'showitem' => '
                    --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,
                    --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.general;general,header,subheader,bodytext,header_link,
                  
                    --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.appearance,image,
                    --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.frames;frames,
                    --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.appearanceLinks;appearanceLinks,
                    --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language,
                    --palette--;;language,
                    --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access,
                    --palette--;;hidden,
                    --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.access;access,
                    --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:categories,
                    --div--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_category.tabs.category,categories,
                    --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:notes,rowDescription,
                    --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:extended,tx_gridelements_container,tx_gridelements_columns, --div--;LLL:EXT:gridelements/Resources/Private/Language/locallang_db.xlf:gridElements
                    ',
        ],
];

