-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathext_localconf.php
More file actions
executable file
·66 lines (54 loc) · 2.52 KB
/
ext_localconf.php
File metadata and controls
executable file
·66 lines (54 loc) · 2.52 KB
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
<?php
/*
* Copyright (c) 2025-2026 Netresearch DTT GmbH
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/**
* This file is part of the package netresearch/contexts.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
use Netresearch\Contexts\Form\CombinationFormElement;
use Netresearch\Contexts\Form\DefaultSettingsFormElement;
use Netresearch\Contexts\Form\RecordSettingsFormElement;
use Netresearch\Contexts\Query\Restriction\ContextRestriction;
use Netresearch\Contexts\Xclass\Backend\Tree\Repository\PageTreeRepository;
defined('TYPO3') || die('Access denied.');
// Add context fields to rootline
// TYPO3 v13: addRootLineFields may not be initialized by default
if (!isset($GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields'])) {
$GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields'] = '';
}
$GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields']
= (string) $GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields']
. ',tx_contexts_enable,tx_contexts_disable';
// XClass: This is needed for the context fields in the page tree
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][TYPO3\CMS\Backend\Tree\Repository\PageTreeRepository::class] = [
'className' => PageTreeRepository::class,
];
// Contexts query restriction - applied to all database queries
if (!isset($GLOBALS['TYPO3_CONF_VARS']['DB']['additionalQueryRestrictions'][ContextRestriction::class])) {
$GLOBALS['TYPO3_CONF_VARS']['DB']['additionalQueryRestrictions'][ContextRestriction::class] = [];
}
// Register custom form elements for TCA
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1700000001] = [
'nodeName' => 'defaultSettingsFormElement',
'priority' => 40,
'class' => DefaultSettingsFormElement::class,
];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1700000002] = [
'nodeName' => 'combinationFormElement',
'priority' => 40,
'class' => CombinationFormElement::class,
];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1700000003] = [
'nodeName' => 'recordSettingsFormElement',
'priority' => 40,
'class' => RecordSettingsFormElement::class,
];
// DataHandler hooks for processing context settings during record save/update
// Note: TYPO3 v12/v13 DataHandler still uses SC_OPTIONS hooks, not PSR-14 events
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']['contexts']
= Netresearch\Contexts\Service\DataHandlerService::class;