<?php
defined('TYPO3') || die('Access denied.');

call_user_func(
    function()
    {

        \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
            'Contact',
            'Contact',
            [
                \Medienreaktor\Contact\Controller\PersonController::class => 'list'
            ],
            // non-cacheable actions
            [
                \Medienreaktor\Contact\Controller\PersonController::class => ''
            ]
        );

    // wizards
    \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
        'mod {
            wizards.newContentElement.wizardItems.plugins {
                elements {
                    contact {
                        iconIdentifier = contact-plugin-contact
                        title = LLL:EXT:contact/Resources/Private/Language/locallang_db.xlf:tx_contact_contact.name
                        description = LLL:EXT:contact/Resources/Private/Language/locallang_db.xlf:tx_contact_contact.description
                        tt_content_defValues {
                            CType = list
                            list_type = contact_contact
                        }
                    }
                }
                show = *
            }
       }'
    );
		$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
		
			$iconRegistry->registerIcon(
				'contact-plugin-contact',
				\TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
				['source' => 'EXT:contact/Resources/Public/Icons/user_plugin_contact.svg']
			);
		
    }
);
