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

call_user_func(function () {
    /**
     * Temporary variables
     */
    $extensionKey = 'muehlherr_sitepackage';
    
    /**
     * Default PageTS for muehlherr_sitepackage
     */
    \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerPageTSConfigFile(
        $extensionKey,
        'Configuration/TsConfig/Page/All.tsconfig',
        'OttoMühlherr'
    );
});


$GLOBALS['TCA']['tt_content']['types']['media']['columnsOverrides']['assets']['config'] = array_replace_recursive(
    $GLOBALS['TCA']['tt_content']['types']['media']['columnsOverrides']['assets']['config'],
    [
        'filter' => [
            0 => [
                'parameters' => [
                    'allowedFileExtensions' => 'youtube, vimeo, mp4, webm'
                ]
            ]
        ],
        'overrideChildTca' => [
            'columns' => [
                'uid_local' => [
                    'config' => [
                        'appearance' => [
                            'elementBrowserAllowed' => 'youtube, vimeo, mp4, webm'
                        ]
                    ]
                ]
            ]
        ]
    ]

);
