-
Notifications
You must be signed in to change notification settings - Fork 7
/
ext_localconf.php
61 lines (54 loc) · 2.24 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
50
51
52
53
54
55
56
57
58
59
60
61
<?php
defined('TYPO3_MODE') || die('Access denied.');
(static function ($_EXTKEY = 'sci_api') {
if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][\Sci\SciApi\Constants::CACHE])) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][\Sci\SciApi\Constants::CACHE] = [
'groups' => ['system'],
];
}
if (!isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][\Sci\SciApi\Constants::CACHE]['frontend'])) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][\Sci\SciApi\Constants::CACHE]['frontend'] =
\TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class;
}
$contentBlocks = Sci\SciApi\Service\ConfigurationService::configuration();
foreach ($contentBlocks as $contentBlock) {
/***************
* Add content element PageTSConfig
*/
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
'
mod.wizards.newContentElement.wizardItems.common {
elements {
' . $contentBlock['CType'] . ' {
iconIdentifier = ' . $contentBlock['CType'] . '
title = SEE TSCONFING TITLE
description = SEE TSCONFING DESCRIPTION
tt_content_defValues {
CType = ' . $contentBlock['CType'] . '
}
}
}
show := addToList(' . $contentBlock['CType'] . ')
}
'
);
// Backend Preview PageTS
if ($contentBlock['EditorPreview.html']) {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
'
mod.web_layout.tt_content.preview.' . $contentBlock['CType'] . ' = ' . $contentBlock['EditorPreview.html']
);
}
/***************
* Register Icons
*/
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
\TYPO3\CMS\Core\Imaging\IconRegistry::class
);
$iconRegistry->registerIcon(
$contentBlock['CType'],
$contentBlock['iconProviderClass'],
['source' => $contentBlock['icon']]
);
}
})();