-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathext_localconf.php
259 lines (197 loc) · 9.52 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
<?php
/**
* The local extension configuration.
*
* @noinspection PhpFullyQualifiedNameUsageInspection
*/
defined('TYPO3_MODE') or die();
(static function () {
// === Variables ===
$namespace = 'T3v';
$extensionKey = 't3v_navigations';
$extensionSignature = \T3v\T3vCore\Utility\ExtensionUtility::getSignature($namespace, $extensionKey);
$tsConfigFolder = \T3v\T3vCore\Utility\ExtensionUtility::getTSConfigFolder($extensionKey);
$iconsFolder = \T3v\T3vCore\Utility\ExtensionUtility::getIconsFolder($extensionKey);
// === TSconfig ===
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
"<INCLUDE_TYPOSCRIPT: source=\"{$tsConfigFolder}/Page.tsconfig\">"
);
// === Content Elements ===
// --- Flyout Navigation Content Element ---
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
$extensionSignature,
// The unique name of the Content Element in upper camel case:
'FlyoutNavigation',
// The array holding the controller-action-combinations that are accessible:
[
// The first controller and its first action will be the default
'ContentElements\FlyoutNavigationContentElement' => 'index'
],
// The array of non-cacheable controller-action-combinations (they must already be enabled):
[
// 'ContentElements\FlyoutNavigationContentElement' => 'index'
]
);
// --- Footer Navigation Content Element ---
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
$extensionSignature,
// The unique name of the Content Element in upper camel case:
'FooterNavigation',
// The array holding the controller-action-combinations that are accessible:
[
// The first controller and its first action will be the default
'ContentElements\FooterNavigationContentElement' => 'index'
],
// The array of non-cacheable controller-action-combinations (they must already be enabled):
[
// 'ContentElements\FooterNavigationContentElement' => 'index'
]
);
// --- Header Navigation Content Element ---
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
$extensionSignature,
// The unique name of the Content Element in upper camel case:
'HeaderNavigation',
// The array holding the controller-action-combinations that are accessible:
[
// The first controller and its first action will be the default
'ContentElements\HeaderNavigationContentElement' => 'index'
],
// The array of non-cacheable controller-action-combinations (they must already be enabled):
[
// 'ContentElements\HeaderNavigationContentElement' => 'index'
]
);
// --- L10n Navigation Content Element ---
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
$extensionSignature,
// The unique name of the Content Element in upper camel case:
'L10nNavigation',
// The array holding the controller-action-combinations that are accessible:
[
// The first controller and its first action will be the default
'ContentElements\L10nNavigationContentElement' => 'index'
],
// The array of non-cacheable controller-action-combinations (they must already be enabled):
[
// 'ContentElements\L10nNavigationContentElement' => 'index'
]
);
// --- Main Navigation Content Element ---
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
$extensionSignature,
// The unique name of the Content Element in upper camel case:
'MainNavigation',
// The array holding the controller-action-combinations that are accessible:
[
// The first controller and its first action will be the default
'ContentElements\MainNavigationContentElement' => 'index'
],
// The array of non-cacheable controller-action-combinations (they must already be enabled):
[
// 'ContentElements\MainNavigationContentElement' => 'index'
]
);
// --- Mobile Navigation Content Element ---
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
$extensionSignature,
// The unique name of the Content Element in upper camel case:
'MobileNavigation',
// The array holding the controller-action-combinations that are accessible:
[
// The first controller and its first action will be the default
'ContentElements\MobileNavigationContentElement' => 'index'
],
// The array of non-cacheable controller-action-combinations (they must already be enabled):
[
// 'ContentElements\MobileNavigationContentElement' => 'index'
]
);
// --- Overview Navigation Content Element ---
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
$extensionSignature,
// The unique name of the content element in upper camel case:
'OverviewNavigation',
// The array holding the controller-action-combinations that are accessible:
[
// The first controller and its first action will be the default
'ContentElements\OverviewNavigationContentElement' => 'index'
],
// The array of non-cacheable controller-action-combinations (they must already be enabled):
[
// 'ContentElements\OverviewNavigationContentElement' => 'index'
]
);
// --- Quick Navigation Content Element ---
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
$extensionSignature,
// The unique name of the content element in upper camel case:
'QuickNavigation',
// The array holding the controller-action-combinations that are accessible:
[
// The first controller and its first action will be the default
'ContentElements\QuickNavigationContentElement' => 'index'
],
// The array of non-cacheable controller-action-combinations (they must already be enabled):
[
// 'ContentElements\QuickNavigationContentElement' => 'index'
]
);
// --- Subpages Navigation Content Element ---
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
$extensionSignature,
// The unique name of the content element in upper camel case:
'SubpagesNavigation',
// The array holding the controller-action-combinations that are accessible:
[
// The first controller and its first action will be the default
'ContentElements\SubpagesNavigationContentElement' => 'index'
],
// The array of non-cacheable controller-action-combinations (they must already be enabled):
[
// 'ContentElements\SubpagesNavigationContentElement' => 'index'
]
);
// --- Vendor Navigation Content Element ---
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
$extensionSignature,
// The unique name of the Content Element in upper camel case:
'VendorNavigation',
// The array holding the controller-action-combinations that are accessible:
[
// The first controller and its first action will be the default
'ContentElements\VendorNavigationContentElement' => 'index'
],
// The array of non-cacheable controller-action-combinations (they must already be enabled):
[
// 'ContentElements\VendorNavigationContentElement' => 'index'
]
);
// === Backend ===
if (TYPO3_MODE === 'BE') {
// --- Icons ---
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
$icons = [
'Flyout Navigation Content Element' => "{$iconsFolder}/ContentElements/FlyoutNavigationContentElement.svg",
'Footer Navigation Content Element' => "{$iconsFolder}/ContentElements/FooterNavigationContentElement.svg",
'Header Navigation Content Element' => "{$iconsFolder}/ContentElements/HeaderNavigationContentElement.svg",
'L10n Navigation Content Element' => "{$iconsFolder}/ContentElements/L10nNavigationContentElement.svg",
'Main Navigation Content Element' => "{$iconsFolder}/ContentElements/MainNavigationContentElement.svg",
'Mobile Navigation Content Element' => "{$iconsFolder}/ContentElements/MobileNavigationContentElement.svg",
'Overview Navigation Content Element' => "{$iconsFolder}/ContentElements/OverviewNavigationContentElement.svg",
'Quick Navigation Content Element' => "{$iconsFolder}/ContentElements/QuickNavigationContentElement.svg",
'Subpages Navigation Content Element' => "{$iconsFolder}/ContentElements/SubpagesNavigationContentElement.svg",
'Vendor Navigation Content Element' => "{$iconsFolder}/ContentElements/VendorNavigationContentElement.svg"
];
foreach ($icons as $name => $source) {
$iconIdentifier = \T3v\T3vCore\Utility\IconUtility::getIdentifier($name);
$iconSignature = \T3v\T3vCore\Utility\IconUtility::getSignature($extensionKey, $iconIdentifier);
$iconRegistry->registerIcon(
$iconSignature,
\TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
['source' => $source]
);
}
}
// === T3v Generator ===
})();