forked from extcode/cart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ext_localconf.php
142 lines (125 loc) · 4.31 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
<?php
defined('TYPO3') or die();
use Extcode\Cart\Controller\Cart\CartController;
use Extcode\Cart\Controller\Cart\CartPreviewController;
use Extcode\Cart\Controller\Cart\CountryController;
use Extcode\Cart\Controller\Cart\CouponController;
use Extcode\Cart\Controller\Cart\CurrencyController;
use Extcode\Cart\Controller\Cart\OrderController;
use Extcode\Cart\Controller\Cart\PaymentController;
use Extcode\Cart\Controller\Cart\ProductController;
use Extcode\Cart\Controller\Cart\ShippingController;
use Extcode\Cart\Hooks\MailAttachmentHook;
use TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider;
use TYPO3\CMS\Core\Imaging\IconRegistry;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;
// configure plugins
ExtensionUtility::configurePlugin(
'Cart',
'MiniCart',
[
CartPreviewController::class => 'show',
CurrencyController::class => 'update',
],
[
CartPreviewController::class => 'show',
CurrencyController::class => 'update',
]
);
ExtensionUtility::configurePlugin(
'Cart',
'Cart',
[
CartController::class => 'show, clear, update',
CountryController::class => 'update',
CouponController::class => 'add, remove',
CurrencyController::class => 'update',
OrderController::class => 'show, create',
PaymentController::class => 'update',
ProductController::class => 'add, remove',
ShippingController::class => 'update',
],
[
CartController::class => 'show, clear, update',
CountryController::class => 'update',
CouponController::class => 'add, remove',
CurrencyController::class => 'update',
OrderController::class => 'show, create',
PaymentController::class => 'update',
ProductController::class => 'add, remove',
ShippingController::class => 'update',
]
);
ExtensionUtility::configurePlugin(
'Cart',
'Currency',
[
CurrencyController::class => 'edit, update',
],
[
CurrencyController::class => 'edit, update',
]
);
ExtensionUtility::configurePlugin(
'Cart',
'Order',
[
\Extcode\Cart\Controller\Order\OrderController::class => 'list, show',
],
[
\Extcode\Cart\Controller\Order\OrderController::class => 'list, show',
]
);
// Icon Registry
if (TYPO3_MODE === 'BE') {
$icons = [
'apps-pagetree-folder-cart-coupons' => 'apps_pagetree_folder_cart_coupons.svg',
'apps-pagetree-folder-cart-orders' => 'apps_pagetree_folder_cart_orders.svg',
'apps-pagetree-page-cart-cart' => 'apps_pagetree_page_cart_cart.svg',
'ext-cart-wizard-icon' => 'cart_plugin_wizard.svg',
'ext-cart-module' => 'module.svg',
'ext-cart-module-order' => 'module_orders.svg'
];
$iconRegistry = GeneralUtility::makeInstance(
IconRegistry::class
);
foreach ($icons as $identifier => $fileName) {
$iconRegistry->registerIcon(
$identifier,
SvgIconProvider::class,
[
'source' => 'EXT:cart/Resources/Public/Icons/' . $fileName,
]
);
}
}
// TSconfig
ExtensionManagementUtility::addPageTSConfig('
<INCLUDE_TYPOSCRIPT: source="FILE:EXT:cart/Configuration/TSconfig/ContentElementWizard.tsconfig">
');
// register "cart:" namespace
$GLOBALS['TYPO3_CONF_VARS']['SYS']['fluid']['namespaces']['cart'][] = 'Extcode\\Cart\\ViewHelpers';
if (TYPO3_MODE === 'FE') {
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['cart']['MailAttachmentsHook'][] =
MailAttachmentHook::class;
}
// view paths for TYPO3 Mail API
$GLOBALS['TYPO3_CONF_VARS']['MAIL']['templateRootPaths']['1588829280'] = 'EXT:cart/Resources/Private/Templates/';
$GLOBALS['TYPO3_CONF_VARS']['MAIL']['partialRootPaths']['1588829280'] = 'EXT:cart/Resources/Private/Partials/';
// view paths for TYPO3 Dashboard
call_user_func(static function () {
if (TYPO3_MODE === 'BE') {
ExtensionManagementUtility::addTypoScriptSetup(
'
module.tx_dashboard {
view {
templateRootPaths.1588697552 = EXT:cart/Resources/Private/Templates/
partialRootPaths.1588697552 = EXT:cart/Resources/Private/Partials/
layoutRootPaths.1588697552 = EXT:cart/Resources/Private/Layouts/
}
}'
);
}
});