forked from b13/container
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ext_localconf.php
65 lines (57 loc) · 3.99 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
<?php
defined('TYPO3') || die('Access denied.');
call_user_func(static function () {
$typo3Version = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Information\Typo3Version::class);
if ($typo3Version->getMajorVersion() < 12) {
// remove container colPos from "unused" page-elements (v12: IsContentUsedOnPageLayoutEvent)
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['record_is_used']['tx_container'] =
\B13\Container\Hooks\UsedRecords::class . '->addContainerChildren';
// add tx_container_parent parameter to wizard items (v12: ModifyNewContentElementWizardItemsEvent)
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms']['db_new_content_el']['wizardItemsHook']['tx_container'] =
\B13\Container\Hooks\WizardItems::class;
// LocalizationController Xclass (v12: AfterRecordSummaryForLocalizationEvent)
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Backend\Controller\Page\LocalizationController::class] = [
'className' => \B13\Container\Xclasses\LocalizationController::class,
];
}
$commandMapHooks = [
'tx_container-post-process' => \B13\Container\Hooks\Datahandler\CommandMapPostProcessingHook::class,
'tx_container-before-start' => \B13\Container\Hooks\Datahandler\CommandMapBeforeStartHook::class,
'tx_container-delete' => \B13\Container\Hooks\Datahandler\DeleteHook::class,
'tx_container-after-finish' => \B13\Container\Hooks\Datahandler\CommandMapAfterFinishHook::class,
];
$datamapHooks = [
'tx_container-before-start' => \B13\Container\Hooks\Datahandler\DatamapBeforeStartHook::class,
'tx_container-pre-process-field-array' => \B13\Container\Hooks\Datahandler\DatamapPreProcessFieldArrayHook::class,
];
// EXT:content_defender
$packageManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Package\PackageManager::class);
if ($packageManager->isPackageActive('content_defender')) {
$contentDefenderVersion = $packageManager->getPackage('content_defender')->getPackageMetaData()->getVersion();
if (version_compare($contentDefenderVersion, '3.1.0', '>=') || $contentDefenderVersion === 'dev-main') {
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['content_defender']['ColumnConfigurationManipulationHook']['tx_container'] =
\B13\Container\ContentDefender\Hooks\ColumnConfigurationManipulationHook::class;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\IchHabRecht\ContentDefender\Hooks\DatamapDataHandlerHook::class] = [
'className' => \B13\Container\ContentDefender\Xclasses\DatamapHook::class,
];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\IchHabRecht\ContentDefender\Hooks\CmdmapDataHandlerHook::class] = [
'className' => \B13\Container\ContentDefender\Xclasses\CommandMapHook::class,
];
}
}
// set our hooks at the beginning of Datamap Hooks
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'] = array_merge(
$commandMapHooks,
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'] ?? []
);
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'] = array_merge(
$datamapHooks,
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']
);
if ($packageManager->isPackageActive('typo3/cms-install')) {
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update'][B13\Container\Updates\ContainerMigrateSorting::IDENTIFIER]
= B13\Container\Updates\ContainerMigrateSorting::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update'][B13\Container\Updates\ContainerDeleteChildrenWithWrongPid::IDENTIFIER]
= B13\Container\Updates\ContainerDeleteChildrenWithWrongPid::class;
}
});