forked from extcode/cart_products
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ext_localconf.php
126 lines (105 loc) · 4.97 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
<?php
defined('TYPO3_MODE') or die();
call_user_func(function ($extensionKey) {
$_LLL_be = 'LLL:EXT:cart_products/Resources/Private/Language/locallang_be.xlf:';
// Configure plugins
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'cart_products',
'Products',
[
\Extcode\CartProducts\Controller\ProductController::class => 'show, list, teaser, showForm',
],
[
\Extcode\CartProducts\Controller\ProductController::class => 'showForm',
]
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'cart_products',
'TeaserProducts',
[
\Extcode\CartProducts\Controller\ProductController::class => 'teaser, showForm',
],
[
\Extcode\CartProducts\Controller\ProductController::class => 'showForm',
]
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'cart_products',
'SingleProduct',
[
\Extcode\CartProducts\Controller\ProductController::class => 'show, showForm',
],
[
\Extcode\CartProducts\Controller\ProductController::class => 'showForm',
]
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'cart_products',
'ProductPartial',
[
\Extcode\CartProducts\Controller\ProductController::class => 'showForm',
],
[
\Extcode\CartProducts\Controller\ProductController::class => 'showForm',
]
);
// Icon Registry
if (TYPO3_MODE === 'BE') {
$icons = [
'apps-pagetree-folder-cartproducts-products' => 'apps_pagetree_folder_cartproducts_products.svg',
'apps-pagetree-page-cartproducts-products' => 'apps_pagetree_page_cartproducts_products.svg',
'ext-cartproducts-wizard-icon' => 'cartproducts_plugin_wizard.svg',
];
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
\TYPO3\CMS\Core\Imaging\IconRegistry::class
);
foreach ($icons as $identifier => $fileName) {
$iconRegistry->registerIcon(
$identifier,
\TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
[
'source' => 'EXT:cart_products/Resources/Public/Icons/' . $fileName,
]
);
}
}
// TSconfig
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('
<INCLUDE_TYPOSCRIPT: source="FILE:EXT:cart_products/Configuration/TSconfig/ContentElementWizard.tsconfig">
');
// Cart Hooks
// ke_search Hook - register indexer for products
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['registerIndexerConfiguration'][] =
\Extcode\CartProducts\Hooks\KeSearchIndexer::class;
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['customIndexer'][] =
\Extcode\CartProducts\Hooks\KeSearchIndexer::class;
// processDatamapClass Hook
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']['cartproducts_allowed'] =
\Extcode\CartProducts\Hooks\DatamapDataHandlerHook::class;
// clearCachePostProc Hook
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc']['cartproducts_clearcache'] =
\Extcode\CartProducts\Hooks\DataHandler::class . '->clearCachePostProc';
// register "cartproducts:" namespace
$GLOBALS['TYPO3_CONF_VARS']['SYS']['fluid']['namespaces']['cartproducts'][] = 'Extcode\\CartProducts\\ViewHelpers';
// Signal Slots
$dispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class
);
$dispatcher->connect(
\Extcode\Cart\Utility\StockUtility::class,
'handleStock',
\Extcode\CartProducts\Utility\StockUtility::class,
'handleStock'
);
// register "cartproducts:" namespace
$GLOBALS['TYPO3_CONF_VARS']['SYS']['fluid']['namespaces']['cartproducts'][]
= 'Extcode\\CartProducts\\ViewHelpers';
// update wizard for slugs
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['cartProductsSlugUpdater'] =
\Extcode\CartProducts\Updates\SlugUpdater::class;
// register listTemplateLayouts
$GLOBALS['TYPO3_CONF_VARS']['EXT']['cart_products']['templateLayouts']['products'][] = [$_LLL_be . 'flexforms_template.templateLayout.products.table', 'table'];
$GLOBALS['TYPO3_CONF_VARS']['EXT']['cart_products']['templateLayouts']['products'][] = [$_LLL_be . 'flexforms_template.templateLayout.products.grid', 'grid'];
$GLOBALS['TYPO3_CONF_VARS']['EXT']['cart_products']['templateLayouts']['teaser_products'][] = [$_LLL_be . 'flexforms_template.templateLayout.products.table', 'table'];
$GLOBALS['TYPO3_CONF_VARS']['EXT']['cart_products']['templateLayouts']['teaser_products'][] = [$_LLL_be . 'flexforms_template.templateLayout.products.grid', 'grid'];
}, 'cart_products');