-
Notifications
You must be signed in to change notification settings - Fork 14
/
ext_localconf.php
197 lines (171 loc) · 8.66 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
<?php
defined('TYPO3_MODE') || die;
(function () {
// Extbase
$extbaseContainer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
\TYPO3\CMS\Extbase\Object\Container\Container::class
);
$extbaseContainer->registerImplementation(
\Pixelant\PxaProductManager\Attributes\ValueUpdater\UpdaterInterface::class,
\Pixelant\PxaProductManager\Attributes\ValueUpdater\ValueUpdaterService::class
);
// Configure plugins
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Pixelant.pxa_product_manager',
'LazyLoading',
[
\Pixelant\PxaProductManager\Controller\Api\LazyLoadingController::class => 'list',
],
[
\Pixelant\PxaProductManager\Controller\Api\LazyLoadingController::class => 'list',
]
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Pixelant.pxa_product_manager',
'LazyAvailableFilters',
[
\Pixelant\PxaProductManager\Controller\Api\LazyAvailableFiltersController::class => 'list',
],
[
\Pixelant\PxaProductManager\Controller\Api\LazyAvailableFiltersController::class => 'list',
]
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Pixelant.pxa_product_manager',
'ProductShow',
[
\Pixelant\PxaProductManager\Controller\ProductShowController::class => 'show'
]
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Pixelant.pxa_product_manager',
'ProductList',
[
\Pixelant\PxaProductManager\Controller\LazyProductController::class => 'list'
]
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Pixelant.pxa_product_manager',
'ProductRender',
[
\Pixelant\PxaProductManager\Controller\ProductRenderController::class => 'init'
]
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Pixelant.pxa_product_manager',
'CustomProductList',
[
\Pixelant\PxaProductManager\Controller\CustomProductController::class => 'list'
]
);
// Register field control for identifier attribute
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1534315213786] = [
'nodeName' => 'attributeIdentifierControl',
'priority' => 30,
'class' => \Pixelant\PxaProductManager\Backend\FormEngine\FieldControl\AttributeIdentifierControl::class
];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1608645557] = [
'nodeName' => 'productParentValue',
'priority' => '30',
'class' => \Pixelant\PxaProductManager\Backend\FormEngine\FieldWizard\ParentValueFieldWizard::class,
];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1611778775] = [
'nodeName' => 'hiddenAttributeType',
'priority' => '30',
'class' => \Pixelant\PxaProductManager\Backend\FormEngine\FieldWizard\HiddenAttributeTypeValueFieldWizard::class,
];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1609921375] = [
'nodeName' => 'inheritedProductField',
'priority' => '30',
'class' => \Pixelant\PxaProductManager\Backend\FormEngine\FieldInformation\InheritedProductFieldInformation::class,
];
// Add attributes fields to Product edit form
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['formDataGroup']['tcaDatabaseRecord'][\Pixelant\PxaProductManager\Backend\FormDataProvider\ProductFormDataProvider::class] = [
'depends' => [
\TYPO3\CMS\Backend\Form\FormDataProvider\DatabaseRowInitializeNew::class,
\TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems::class
]
];
// Add attributes fields to Product edit form
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['formDataGroup']['tcaDatabaseRecord'][\Pixelant\PxaProductManager\Backend\FormDataProvider\AttributeValueFormDataProvider::class] = [
'depends' => [
\TYPO3\CMS\Backend\Form\FormDataProvider\DatabaseRowInitializeNew::class,
\TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems::class
]
];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['formDataGroup']['tcaDatabaseRecord'][\Pixelant\PxaProductManager\Backend\FormDataProvider\NewAttributeRelationRecordsDataProvider::class] = [
'depends' => [
\TYPO3\CMS\Backend\Form\FormDataProvider\EvaluateDisplayConditions::class
]
];
// Modify data structure of flexform. Hook will dynamically load flexform parts for selected action
// Register default plugin actions with flexform settings
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
\Pixelant\PxaProductManager\Configuration\Flexform\Registry::class
)->registerDefaultActions();
// Register hook to show plugin flexform settings preview
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['list_type_Info']['pxaproductmanager_pi1']['pxa_product_manager'] =
\Pixelant\PxaProductManager\Hook\PageLayoutView::class . '->getExtensionSummary';
// Include page TS
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
'<INCLUDE_TYPOSCRIPT: source="DIR:EXT:pxa_product_manager/Configuration/TypoScript/PageTS/" extensions="ts">'
);
// LinkHandler
// t3://pxappm?product=[product_id]
// t3://pxappm?category=[category_id]
$linkType = 'pxappm';
$GLOBALS['TYPO3_CONF_VARS']['SYS']['linkHandler'][$linkType]
= \Pixelant\PxaProductManager\LinkHandler\LinkHandling::class;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['linkHandler'][$linkType]
= \Pixelant\PxaProductManager\LinkHandler\LinkHandlingFormData::class;
$GLOBALS['TYPO3_CONF_VARS']['FE']['typolinkBuilder'][$linkType]
= \Pixelant\PxaProductManager\Service\TypolinkBuilderService::class;
// Draw header hook
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/db_layout.php']['drawHeaderHook']['pxa_product_manager']
= \Pixelant\PxaProductManager\Hook\PageHookRelatedCategories::class . '->render';
// Register icons
$icons = [
'ext-pxa-product-manager-wizard-icon' => 'package.svg',
'apps-pagetree-productdisplay-default' => 'T3Icons/apps/apps-pagetree-productdisplay-default.svg',
'apps-pagetree-productdisplay-hideinmenu' => 'T3Icons/apps/apps-pagetree-productdisplay-hideinmenu.svg',
];
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
\TYPO3\CMS\Core\Imaging\IconRegistry::class
);
foreach ($icons as $identifier => $path) {
$iconRegistry->registerIcon(
$identifier,
\TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
['source' => 'EXT:pxa_product_manager/Resources/Public/Icons/Svg/' . $path]
);
}
// Cache framework
$cacheIdentifier = 'pm_cache_categories';
if (
isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$cacheIdentifier])
&& !is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$cacheIdentifier])
) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$cacheIdentifier] = [];
}
if (!isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$cacheIdentifier]['frontend'])) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$cacheIdentifier]['frontend']
= \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class;
}
if (!isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$cacheIdentifier]['options'])) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$cacheIdentifier]['options']
= ['defaultLifetime' => 0];
}
if (! isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$cacheIdentifier]['groups'])) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$cacheIdentifier]['groups']
= ['pages', 'system'];
}
// Allow backend users to drag and drop the new page type:
$pdDokType = \Pixelant\PxaProductManager\Domain\Repository\PageRepository::DOKTYPE_PRODUCT_DISPLAY;
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig(
'options.pageTree.doktypesToShowInNewPageDragArea := addToList(' . $pdDokType . ')'
);
// Add doktype to yoast_seo:s allowedDoktypes.
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('yoast_seo')) {
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['yoast_seo']['allowedDoktypes']['product_display'] = $pdDokType;
}
})();