-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathext_localconf.php
More file actions
51 lines (44 loc) · 2.54 KB
/
Copy pathext_localconf.php
File metadata and controls
51 lines (44 loc) · 2.54 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
<?php
declare(strict_types=1);
defined('TYPO3') or die();
// Decode tx_ailabel_origin / tx_ailabel_reviewed from the tx_ailabel_metadata JSON
// column into the edit form, since these virtual TCA fields have no real column of
// their own.
// Must also depend on TcaJson: on a new record, DatabaseRowDefaultValues forces
// tx_ailabel_metadata to '' (no TCA default set), and only TcaJson (for command=new)
// turns that back into an array - without this second dependency, core's own provider
// order between TcaJson and this class is unspecified.
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['formDataGroup']['tcaDatabaseRecord']
[\B13\AiLabel\Form\FormDataProvider\EnrichAiMetaData::class] = [
'depends' => [
\TYPO3\CMS\Backend\Form\FormDataProvider\DatabaseEditRow::class,
\TYPO3\CMS\Backend\Form\FormDataProvider\TcaJson::class,
],
];
// Fold tx_ailabel_origin / tx_ailabel_reviewed into the tx_ailabel_metadata JSON
// column instead of writing them to their own (non-existent) columns. No PSR-14
// replacement exists for this yet, this hook is still the supported extension point.
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][]
= \B13\AiLabel\Hooks\AiMetaDataHandlerHook::class;
// Renders "tx_ailabel_reviewed" as a normal checkboxToggle field, without TYPO3
// auto-creating a real database column for it (that only happens for type=check).
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1732880001] = [
'nodeName' => 'aiLabelVirtualCheckbox',
'priority' => 40,
'class' => \B13\AiLabel\Form\Element\VirtualCheckboxElement::class,
];
// Renders "tx_ailabel_origin" as a normal selectSingle field, without TYPO3
// auto-creating a real database column for it (that only happens for type=select).
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1785502900] = [
'nodeName' => 'aiLabelVirtualSelect',
'priority' => 40,
'class' => \B13\AiLabel\Form\Element\VirtualSelectElement::class,
];
// Bakes the AI badge into processed images, for the "baked" image marker mode only.
// Ordered before LocalImageProcessor, which it extends - its canProcessTask() returns
// false unless the mode is active and the file actually needs a watermark, so in every
// other case the registry falls through to core's processor untouched.
$GLOBALS['TYPO3_CONF_VARS']['SYS']['fal']['processors']['AiLabelWatermarkProcessor'] = [
'className' => \B13\AiLabel\Imaging\AiWatermarkProcessor::class,
'before' => ['LocalImageProcessor'],
];