-
Notifications
You must be signed in to change notification settings - Fork 1
/
ext_localconf.php
49 lines (41 loc) · 1.68 KB
/
ext_localconf.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
use Digitalwerk\ContentElementRegistry\Core\ContentElementRegistry;
use Digitalwerk\ContentElementRegistry\Hook\ContentElementPreviewRenderer;
use Digitalwerk\ContentElementRegistry\Utility\ContentElementRegistryUtility;
use TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider;
use TYPO3\CMS\Core\Imaging\IconRegistry;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
defined('TYPO3') or die();
call_user_func(
function ($extKey) {
$iconRegistry = $iconRegistry = GeneralUtility::makeInstance(
IconRegistry::class
);
$contentElementsRegistry = ContentElementRegistry::getInstance();
foreach ($contentElementsRegistry->getContentElements() as $contentElement) {
//Register CE icon
$iconRegistry->registerIcon(
$contentElement->getIconIdentifier(),
SvgIconProvider::class,
[
'source' => $contentElement->getIconSrcPath(),
]
);
//Register CE wizard item
ExtensionManagementUtility::addPageTSConfig(
ContentElementRegistryUtility::convertArrayToTypoScript(
$contentElement->getWizardPageTSconfig(),
'mod.wizards.newContentElement.wizardItems'
)
);
//Register CE rendering definition
ExtensionManagementUtility::addTypoScript(
$extKey,
'setup',
ContentElementRegistryUtility::convertArrayToTypoScript($contentElement->getTypoScriptConfiguration())
);
}
},
'content_element_registry'
);