forked from in2code-de/in2publish_core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ext_tables.php
executable file
·195 lines (183 loc) · 9.69 KB
/
ext_tables.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
<?php
use In2code\In2publishCore\Component\ConfigContainer\ConfigContainer;
use In2code\In2publishCore\Controller\FileController;
use In2code\In2publishCore\Controller\RecordController;
use In2code\In2publishCore\Features\AdminTools\Backend\Form\DescriptionCompatibilityAugmentation;
use In2code\In2publishCore\Features\AdminTools\Service\ToolsRegistry;
use In2code\In2publishCore\Features\ContextMenuPublishEntry\ContextMenu\PublishItemProvider;
use In2code\In2publishCore\Features\RedirectsSupport\Controller\RedirectController;
use In2code\In2publishCore\Features\WarningOnForeign\Service\HeaderWarningColorRenderer;
use In2code\In2publishCore\Service\Context\ContextService;
use In2code\In2publishCore\Testing\Tests\Adapter\AdapterSelectionTest;
use In2code\In2publishCore\Testing\Tests\Adapter\RemoteAdapterTest;
use In2code\In2publishCore\Testing\Tests\Adapter\TransmissionAdapterTest;
use In2code\In2publishCore\Testing\Tests\Application\ForeignDatabaseConfigTest;
use In2code\In2publishCore\Testing\Tests\Application\ForeignDomainTest;
use In2code\In2publishCore\Testing\Tests\Application\ForeignInstanceTest;
use In2code\In2publishCore\Testing\Tests\Application\LocalDomainTest;
use In2code\In2publishCore\Testing\Tests\Application\LocalInstanceTest;
use In2code\In2publishCore\Testing\Tests\Application\SiteConfigurationTest;
use In2code\In2publishCore\Testing\Tests\Configuration\ConfigurationFormatTest;
use In2code\In2publishCore\Testing\Tests\Configuration\ConfigurationMigrationTest;
use In2code\In2publishCore\Testing\Tests\Configuration\ForeignConfigurationFormatTest;
use In2code\In2publishCore\Testing\Tests\Database\DatabaseDifferencesTest;
use In2code\In2publishCore\Testing\Tests\Database\ForeignDatabaseTest;
use In2code\In2publishCore\Testing\Tests\Database\LocalDatabaseTest;
use In2code\In2publishCore\Testing\Tests\Database\TableGarbageCollectorTest;
use In2code\In2publishCore\Testing\Tests\Fal\CaseSensitivityTest;
use In2code\In2publishCore\Testing\Tests\Fal\DefaultStorageIsConfiguredTest;
use In2code\In2publishCore\Testing\Tests\Fal\IdenticalDriverTest;
use In2code\In2publishCore\Testing\Tests\Fal\MissingStoragesTest;
use In2code\In2publishCore\Testing\Tests\Fal\UniqueStorageTargetTest;
use TYPO3\CMS\Backend\Form\FormDataProvider\EvaluateDisplayConditions;
use TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsProcessFieldDescriptions;
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;
use const In2code\In2publishCore\TYPO3_V11;
(static function (): void {
/***************************************************** Guards *****************************************************/
if (!defined('TYPO3')) {
die('Access denied.');
}
if (!class_exists(ContextService::class)) {
// Early return when installing per ZIP: autoload is not yet generated
return;
}
if (!empty($GLOBALS['IN2PUBLISH_IS_FRONTEND'])) {
// Early return when frontend is called
return;
}
/**************************************************** Instances ***************************************************/
$configContainer = GeneralUtility::makeInstance(ConfigContainer::class);
$contextService = GeneralUtility::makeInstance(ContextService::class);
$iconRegistry = GeneralUtility::makeInstance(IconRegistry::class);
$isForeign = $contextService->isForeign();
/******************************************* Colorize the BE on Foreign *******************************************/
if ($isForeign && $configContainer->get('features.warningOnForeign.colorizeHeader.enable')) {
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-preProcess'][1582191172] = HeaderWarningColorRenderer::class . '->render';
}
/************************************************* END ON FOREIGN *************************************************/
if ($isForeign) {
return;
}
if (TYPO3_V11) {
/**
* Deprecated registering of Backend Modules
* Register Backend Modules for TYPO3 v11
* can be removed in TYPO3 v13
*/
if ($configContainer->get('module.m1')) {
ExtensionUtility::registerModule(
'in2publish_core',
'web',
'm1',
'',
[
RecordController::class => 'index,detail,publishRecord,toggleFilterStatus',
],
[
'access' => 'user,group',
'iconIdentifier' => 'in2publish-core-overview-module',
'labels' => 'LLL:EXT:in2publish_core/Resources/Private/Language/locallang_mod1.xlf',
],
);
}
if ($configContainer->get('module.m3')) {
ExtensionUtility::registerModule(
'in2publish_core',
'file',
'm3',
'',
[
FileController::class => 'index,publishFolder,publishFile,toggleFilterStatus',
],
[
'access' => 'user,group',
'iconIdentifier' => 'in2publish-core-file-module',
'labels' => 'LLL:EXT:in2publish_core/Resources/Private/Language/locallang_mod3.xlf',
],
);
}
if ($configContainer->get('module.m4')) {
$toolsRegistry = GeneralUtility::makeInstance(ToolsRegistry::class);
$controllerActions = $toolsRegistry->processDataForTypo3V11();
if (!empty($controllerActions)) {
ExtensionUtility::registerModule(
'in2publish_core',
'tools',
'm4',
'',
$controllerActions,
[
'access' => 'admin',
'iconIdentifier' => 'in2publish-core-tools-module',
'labels' => 'LLL:EXT:in2publish_core/Resources/Private/Language/locallang_mod4.xlf',
],
);
}
}
/************************************************ Redirect Support ************************************************/
if (
$configContainer->get('features.redirectsSupport.enable')
&& ExtensionManagementUtility::isLoaded('redirects')
) {
ExtensionUtility::registerModule(
'in2publish_core',
'site',
'm5',
'after:redirects',
[
RedirectController::class => 'list,publish,selectSite',
],
[
'access' => 'user,group',
'iconIdentifier' => 'in2publish-core-redirect-module',
'labels' => 'LLL:EXT:in2publish_core/Resources/Private/Language/locallang_mod5.xlf',
],
);
}
}
/******************************************* Context Menu Publish Entry *******************************************/
if ($configContainer->get('features.contextMenuPublishEntry.enable')) {
$GLOBALS['TYPO3_CONF_VARS']['BE']['ContextMenu']['ItemProviders'][1595598780] = PublishItemProvider::class;
$iconRegistry->registerIcon(
'tx_in2publishcore_contextmenupublishentry_publish',
SvgIconProvider::class,
['source' => 'EXT:in2publish_core/Resources/Public/Icons/Publish.svg'],
);
}
/*********************************************** Tests Registration ***********************************************/
$GLOBALS['in2publish_core']['tests'][] = AdapterSelectionTest::class;
$GLOBALS['in2publish_core']['tests'][] = ConfigurationFormatTest::class;
$GLOBALS['in2publish_core']['tests'][] = ConfigurationMigrationTest::class;
$GLOBALS['in2publish_core']['tests'][] = LocalDatabaseTest::class;
$GLOBALS['in2publish_core']['tests'][] = ForeignDatabaseTest::class;
$GLOBALS['in2publish_core']['tests'][] = DatabaseDifferencesTest::class;
$GLOBALS['in2publish_core']['tests'][] = RemoteAdapterTest::class;
$GLOBALS['in2publish_core']['tests'][] = TransmissionAdapterTest::class;
$GLOBALS['in2publish_core']['tests'][] = LocalInstanceTest::class;
$GLOBALS['in2publish_core']['tests'][] = LocalDomainTest::class;
$GLOBALS['in2publish_core']['tests'][] = ForeignDatabaseConfigTest::class;
$GLOBALS['in2publish_core']['tests'][] = ForeignInstanceTest::class;
$GLOBALS['in2publish_core']['tests'][] = ForeignDomainTest::class;
$GLOBALS['in2publish_core']['tests'][] = CaseSensitivityTest::class;
$GLOBALS['in2publish_core']['tests'][] = DefaultStorageIsConfiguredTest::class;
$GLOBALS['in2publish_core']['tests'][] = IdenticalDriverTest::class;
$GLOBALS['in2publish_core']['tests'][] = MissingStoragesTest::class;
$GLOBALS['in2publish_core']['tests'][] = UniqueStorageTargetTest::class;
$GLOBALS['in2publish_core']['tests'][] = ForeignConfigurationFormatTest::class;
$GLOBALS['in2publish_core']['tests'][] = SiteConfigurationTest::class;
$GLOBALS['in2publish_core']['tests'][] = TableGarbageCollectorTest::class;
/************************************************ Debugging Helper ************************************************/
if ($configContainer->get('debug.addFormEngineDescription')) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['formDataGroup']['tcaDatabaseRecord'][DescriptionCompatibilityAugmentation::class] = [
'depends' => [
TcaColumnsProcessFieldDescriptions::class,
EvaluateDisplayConditions::class,
],
];
}
})();