<?php

use Nahrstedt\Sitepackage\Service\BrandingService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\SignalSlot\Dispatcher;
use TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService;

defined('TYPO3_MODE') || die();

/***************
 * Add default RTE configuration
 */
$GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['bn_sitepackage'] = 'EXT:bn_sitepackage/Configuration/RTE/Default.yaml';


$GLOBALS['TYPO3_CONF_VARS']['SYS']['lang']['cache']['clear_menu'] = TRUE;


$GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride']['de']['EXT:pxa_product_manager/Resources/Private/Language/locallang.xlf'][] = 'EXT:bn_sitepackage/Resources/Private/Language/de.locallang_ppm.xlf';




/***************
 * BE login window styling
 */

if (TYPO3_MODE === 'BE') {
    $signalSlotDispatcher = GeneralUtility::makeInstance(Dispatcher::class);

    /**
     * Add backend styling
     */
    $signalSlotDispatcher->connect(
        ExtensionManagementService::class,
        'hasInstalledExtensions',
        BrandingService::class,
        'setBackendStyling'
    );

}
