forked from extcode/cart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ext_localconf.php
127 lines (116 loc) · 5.15 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
<?php
defined('TYPO3_MODE') or die();
call_user_func(function ($extensionKey) {
// Configure plugins
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Cart',
'MiniCart',
[
\Extcode\Cart\Controller\Cart\CartPreviewController::class => 'show',
\Extcode\Cart\Controller\Cart\CurrencyController::class => 'update',
],
// non-cacheable actions
[
\Extcode\Cart\Controller\Cart\CartPreviewController::class => 'show',
\Extcode\Cart\Controller\Cart\CurrencyController::class => 'update',
]
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Cart',
'Cart',
[
\Extcode\Cart\Controller\Cart\CartController::class => 'show, clear, update',
\Extcode\Cart\Controller\Cart\CountryController::class => 'update',
\Extcode\Cart\Controller\Cart\CouponController::class => 'add, remove',
\Extcode\Cart\Controller\Cart\CurrencyController::class => 'update',
\Extcode\Cart\Controller\Cart\OrderController::class => 'show, create',
\Extcode\Cart\Controller\Cart\PaymentController::class => 'update',
\Extcode\Cart\Controller\Cart\ProductController::class => 'add, remove',
\Extcode\Cart\Controller\Cart\ShippingController::class => 'update',
\Extcode\Cart\Controller\Order\PaymentController::class => 'update',
],
[
\Extcode\Cart\Controller\Cart\CartController::class => 'show, clear, update',
\Extcode\Cart\Controller\Cart\CountryController::class => 'update',
\Extcode\Cart\Controller\Cart\CouponController::class => 'add, remove',
\Extcode\Cart\Controller\Cart\CurrencyController::class => 'update',
\Extcode\Cart\Controller\Cart\OrderController::class => 'show, create',
\Extcode\Cart\Controller\Cart\PaymentController::class => 'update',
\Extcode\Cart\Controller\Cart\ProductController::class => 'add, remove',
\Extcode\Cart\Controller\Cart\ShippingController::class => 'update',
\Extcode\Cart\Controller\Order\PaymentController::class => 'update',
]
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Cart',
'Currency',
[
\Extcode\Cart\Controller\Cart\CurrencyController::class => 'edit, update',
],
[
\Extcode\Cart\Controller\Cart\CurrencyController::class => 'edit, update',
]
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Cart',
'Order',
[
\Extcode\Cart\Controller\Order\Order::class => 'list, show',
],
[
\Extcode\Cart\Controller\Order\Order::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',
];
$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/Resources/Public/Icons/' . $fileName,
]
);
}
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
\TYPO3\CMS\Core\Imaging\IconRegistry::class
);
}
// TSconfig
\TYPO3\CMS\Core\Utility\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'][] =
\Extcode\Cart\Hooks\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') {
\TYPO3\CMS\Core\Utility\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/
}
}'
);
}
});
}, 'cart');