<?php

use Opentalent\OtTemplating\Controller\OtCustomizerController;
use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Core\Http\ApplicationType;

defined('TYPO3') || die('Access denied.');

// ext_tables.php contient les directives permettant de configurer le backend

call_user_func(
    function()
    {
        // Include the configuration files
        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
            'ot_templating',
            'Configuration/TypoScript',
            'Templating');

        /**
         * Registers the customizer backend module
         */
        \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
            'OtTemplating',
            'web', // Make module a submodule of 'web'
            'otcustomizer', // Submodule key
            'before:OtStatsOtstats', // Position
            array(
                OtCustomizerController::class => 'index,selectTemplate,updatePreferences',
            ),
            array(
                'access' => 'user,group',
                'icon' => 'EXT:ot_templating/Resources/Public/Icons/Extension.png',
                'labels' => 'LLL:EXT:ot_templating/Resources/Private/Language/locallang_mod.xlf',
            )
        );
    }
);
