-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathext_localconf.php
230 lines (187 loc) · 10.8 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
<?php
defined('TYPO3') || die('Access denied.');
use TYPO3\CMS\Core\Utility\VersionNumberUtility;
call_user_func(function ($extensionKey): void {
if (!defined('TT_PRODUCTS_EXT')) {
define('TT_PRODUCTS_EXT', 'tt_products');
}
if (!defined('TT_PRODUCTS_SESSION')) {
define('TT_PRODUCTS_SESSION', 'TX_TTPRODUCTS');
}
if (!defined('PATH_BE_TTPRODUCTS')) {
define('PATH_BE_TTPRODUCTS', \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($extensionKey));
}
if (!defined('PATH_FE_TTPRODUCTS_REL')) {
define(
'PATH_FE_TTPRODUCTS_REL',
\TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix(
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($extensionKey)
)
);
}
if (!defined('ADDONS_EXT')) {
define('ADDONS_EXT', 'addons_tt_products');
}
if (!defined('POOL_EXT')) {
define('POOL_EXT', 'pool');
}
// The autoloader does not work in ext_localconf.php and in the folder Configuratin/TCA
require_once PATH_BE_TTPRODUCTS . 'control/class.tx_ttproducts_control_address.php';
require_once PATH_BE_TTPRODUCTS . 'Classes/Domain/Model/Dto/EmConfiguration.php';
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded(POOL_EXT)) {
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/pool/mod_main/index.php']['addClass'][] = 'EXT:' . $extensionKey . '/hooks/class.tx_ttproducts_hooks_pool.php:&tx_ttproducts_hooks_pool';
}
if (!defined('TT_PRODUCTS_DIV_DLOG')) {
define('TT_PRODUCTS_DIV_DLOG', '0'); // for development error logging
}
if (
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('taxajax')
) {
$GLOBALS['TYPO3_CONF_VARS']['FE']['taxajax_include'][$extensionKey] = \JambageCom\TtProducts\Controller\TaxajaxController::class . '::processRequest';
}
$typo3VersionArray = VersionNumberUtility::convertVersionStringToArray(VersionNumberUtility::getCurrentTypo3Version());
$typo3VersionMain = $typo3VersionArray['version_main'];
$extensionConfiguration = [];
$originalConfiguration = [];
$extensionConfiguration = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
\TYPO3\CMS\Core\Configuration\ExtensionConfiguration::class
)->get($extensionKey);
if (
isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$extensionKey]) &&
is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$extensionKey])
) {
$originalConfiguration = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$extensionKey];
}
if (
!isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$extensionKey]['exclude']) ||
!is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$extensionKey]['exclude'])
) {
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$extensionKey]['exclude'] = [];
}
if (
isset($extensionConfiguration) && is_array(
$extensionConfiguration
)
) {
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$extensionKey] =
array_merge($extensionConfiguration, $originalConfiguration);
} elseif (!isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$extensionKey])) {
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$extensionKey] = [];
}
$extensionConfiguration = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$extensionKey];
if (isset($extensionConfiguration) && is_array($extensionConfiguration)) {
if (
isset($extensionConfiguration['exclude']) && is_array($extensionConfiguration['exclude'])
) {
$excludeArray = [];
foreach ($extensionConfiguration['exclude'] as $tablename => $excludefields) {
if ($excludefields != '' && is_string($excludefields)) {
$excludeArray[$tablename] = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $excludefields);
}
}
if (count($excludeArray)) {
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$extensionKey]['exclude'] = $excludeArray;
}
}
}
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig('options.saveDocNew.tt_products=1');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig('options.saveDocNew.tt_products_language=1');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig('options.saveDocNew.tt_products_cat=1');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig('options.saveDocNew.tt_products_cat_language=1');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig('options.saveDocNew.tt_products_articles=1');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig('options.saveDocNew.tt_products_articles_language=1');
// replace the output of the former CODE field with the flexform
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['list_type_Info'][5][] = 'JambageCom\\TtProducts\\Hooks\\CmsBackend->pmDrawItem';
// class for displaying the category tree in BE forms.
$listType = $extensionKey . '_pi_int';
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['list_type_Info'][$listType][] = 'JambageCom\\TtProducts\\Hooks\\CmsBackend->pmDrawItem';
if (
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('searchbox')) {
$listType = $extensionKey . '_pi_search';
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['list_type_Info'][$listType][] = 'JambageCom\\TtProducts\\Hooks\\CmsBackend->pmDrawItem';
}
// hooks for FE extensions
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['login_confirmed'][$extensionKey] = 'JambageCom\\TtProducts\\Hooks\\FrontendProcessor->loginConfirmed';
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('patch10011')) {
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['patch10011']['includeLibs'][$extensionKey] =
\JambageCom\TtProducts\UserFunc\MatchCondition::class;
}
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ws_flexslider']['listAction'][$extensionKey] = 'EXT:' . $extensionKey . '/hooks/class.tx_ttproducts_ws_flexslider.php:&tx_ttproducts_ws_flexslider';
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['transactor']['listener'][$extensionKey] = \JambageCom\TtProducts\Hooks\TransactorListener::class;
if (
isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$extensionKey]['hook.']) &&
!empty($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$extensionKey]['hook.']['setPageTitle'])
) {
// TYPO3 page title
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-output'][] = 'JambageCom\\TtProducts\\Hooks\\ContentPostProcessor->setPageTitle';
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-cached'][] = 'JambageCom\\TtProducts\\Hooks\\ContentPostProcessor->setPageTitle';
}
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tce']['formevals'][\JambageCom\Div2007\Hooks\Evaluation\Double6::class] = '';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43($extensionKey, 'pi_int/class.tx_ttproducts_pi_int.php', '_pi_int', 'list_type', 0);
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('searchbox')) {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43($extensionKey, 'pi_search/class.tx_ttproducts_pi_search.php', '_pi_search', 'list_type', 0);
}
// add missing setup for the tt_content "list_type = 5" which is used by tt_products
$addLine = 'tt_content.list.20.5 = < plugin.tt_products';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript(
$extensionKey,
'setup',
'
# Setting ' . $extensionKey . ' plugin TypoScript
' . $addLine . '
',
43
);
$addressExtKey = '';
$addressTable = tx_ttproducts_control_address::getAddressTablename($addressExtKey);
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$extensionKey]['addressTable'] = $addressTable;
// Register Status Report Hook
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status']['providers']['Shop System'][] = \JambageCom\TtProducts\Hooks\StatusProvider::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['productMMArticleTtProducts']
= \JambageCom\TtProducts\Updates\ProductMMArticleTtProductsUpdater::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['productMMGraduatedPriceTtProducts']
= \JambageCom\TtProducts\Updates\ProductMMGraduatedPriceTtProductsUpdater::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['OrderMMProductTtProducts']
= \JambageCom\TtProducts\Updates\OrderMMProductTtProductsUpdater::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['productDatasheetTtProducts']
= \JambageCom\TtProducts\Updates\ProductDatasheetUpdater::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['productImageTtProducts']
= \JambageCom\TtProducts\Updates\ProductImageUpdater::class;
$GLOBALS['TYPO3_CONF_VARS']['LOG']['JambageCom']['TtProducts']['Api']['writerConfiguration'][\TYPO3\CMS\Core\Log\LogLevel::WARNING] = [
// configuration for WARNING severity, including all
// levels with higher severity (ERROR, CRITICAL, EMERGENCY)
// add a SyslogWriter
\TYPO3\CMS\Core\Log\Writer\SyslogWriter::class => [],
];
if ($typo3VersionMain >= 13) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1613165400] = [
'nodeName' => 'orderedProductsElement',
'priority' => 40,
'class' => \JambageCom\TtProducts\Form\Element\OrderedProductsElement::class,
];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1613221454] = [
'nodeName' => 'orderHtmlElement',
'priority' => 40,
'class' => \JambageCom\TtProducts\Form\Element\OrderHtmlElement::class,
];
} else {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1613165400] = [
'nodeName' => 'orderedProductsElement',
'priority' => 40,
'class' => \JambageCom\TtProducts\Form\Element\OldOrderedProductsElement::class,
];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1613221454] = [
'nodeName' => 'orderHtmlElement',
'priority' => 40,
'class' => \JambageCom\TtProducts\Form\Element\OldOrderHtmlElement::class,
];
}
$excludedParameters = [
'tt_products[sword]',
'sword',
'tt_products[activity][verify]',
'tt_products[backPID]',
];
$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'] =
array_merge($GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'], $excludedParameters);
}, 'tt_products');