-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathext_localconf.php
148 lines (131 loc) · 5.89 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<?php
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;
use TYPO3\CMS\Core\Imaging\IconRegistry;
use TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider;
use Fab\VidiFrontend\Form\Elements\EnableFieldsElement;
use Fab\VidiFrontend\Form\Elements\TemplateMenuElement;
use Fab\VidiFrontend\Form\Elements\AdditionalSettingsListHelpElement;
use TYPO3\CMS\Extbase\SignalSlot\Dispatcher;
use Fab\VidiFrontend\Controller\ContentController;
use Fab\VidiFrontend\Controller\TemplateBasedContentController;
defined('TYPO3') or die();
call_user_func(
function () {
$configuration = $configuration = GeneralUtility::makeInstance(
ExtensionConfiguration::class
)->get('vidi_frontend');
if (!isset($configuration['autoload_typoscript']) || true === (bool)$configuration['autoload_typoscript']) {
ExtensionManagementUtility::addTypoScript(
'vidi_frontend',
'constants',
'<INCLUDE_TYPOSCRIPT: source="FILE:EXT:vidi_frontend/Configuration/TypoScript/constants.txt">'
);
ExtensionManagementUtility::addTypoScript(
'vidi_frontend',
'setup',
'<INCLUDE_TYPOSCRIPT: source="FILE:EXT:vidi_frontend/Configuration/TypoScript/setup.txt">'
);
}
ExtensionUtility::configurePlugin(
'VidiFrontend',
'Pi1',
[
ContentController::class => 'index, list, show, execute',
],
[
ContentController::class => isset($configuration['non_cacheable_actions'])
? $configuration['non_cacheable_actions']
: 'list, execute',
]
);
$nonCacheableControllerActions = !isset($configuration['is_index_view_cached']) || (bool)$configuration['is_index_view_cached']
? 'list'
: 'index, list';
ExtensionUtility::configurePlugin(
'VidiFrontend',
'TemplateBasedContent',
[
TemplateBasedContentController::class => 'index, list, show',
],
[
TemplateBasedContentController::class => $nonCacheableControllerActions,
]
);
// Register icons
$icons = [
'content-vidi-frontend' => 'EXT:vidi_frontend/Resources/Public/Images/VidiFrontend.png',
];
$iconRegistry = GeneralUtility::makeInstance(IconRegistry::class);
foreach ($icons as $identifier => $path) {
$iconRegistry->registerIcon(
$identifier, BitmapIconProvider::class, ['source' => $path]
);
}
ExtensionManagementUtility::addPageTSConfig(
'mod {
wizards.newContentElement.wizardItems.plugins {
#header = LLL:EXT:sitepackage/Resources/Private/Language/newContentElements.xlf:extra
elements {
tx_vidifrontend_pi1 {
iconIdentifier = content-vidi-frontend
title = LLL:EXT:vidi_frontend/Resources/Private/Language/locallang.xlf:wizard.title
description = LLL:EXT:vidi_frontend/Resources/Private/Language/locallang.xlf:wizard.description
tt_content_defValues {
CType = list
list_type = vidifrontend_pi1
}
}
tx_vidifrontend_templatebasedcontent {
iconIdentifier = content-vidi-frontend
title = LLL:EXT:vidi_frontend/Resources/Private/Language/locallang.xlf:wizard_template_based.title
description = LLL:EXT:vidi_frontend/Resources/Private/Language/locallang.xlf:wizard_template_based.description
tt_content_defValues {
CType = list
list_type = vidifrontend_templatebasedcontent
}
}
}
}
}'
);
// Register new nodes
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1656697370] = [
'nodeName' => 'vidiFrontendEnableFields',
'priority' => 40,
'class' => EnableFieldsElement::class,
];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1656697371] = [
'nodeName' => 'vidiFrontendTemplateMenu',
'priority' => 40,
'class' => TemplateMenuElement::class,
];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1656697372] = [
'nodeName' => 'vidiFrontendAdditionalSettingsListHelpListTemplates',
'priority' => 40,
'class' => AdditionalSettingsListHelpElement::class,
'parameters' => [
'typoscriptConfigurationKey' => 'listTemplates',
],
];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1656697373] = [
'nodeName' => 'vidiFrontendAdditionalSettingsListHelpTemplates',
'priority' => 40,
'class' => AdditionalSettingsListHelpElement::class,
'parameters' => [
'typoscriptConfigurationKey' => 'template',
],
];
// Connect "preProcessTca" signal slot with the metadata service.
$signalSlotDispatcher = GeneralUtility::makeInstance(Dispatcher::class);
$signalSlotDispatcher->connect(
'Fab\Vidi\Tca\Tca',
'preProcessTca',
'Fab\VidiFrontend\Configuration\TcaTweak',
'tweakFileReferences',
true
);
}
);