forked from wazum/sluggi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ext_localconf.php
72 lines (58 loc) · 2.96 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
<?php
declare(strict_types=1);
use TYPO3\CMS\Backend\Form\FormDataProvider\EvaluateDisplayConditions;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use Wazum\Sluggi\Backend\Controller\FormSlugAjaxController;
use Wazum\Sluggi\Backend\Form\InputSlugElement;
use Wazum\Sluggi\Backend\Form\InputTextWithSlugImpactElement;
use Wazum\Sluggi\Backend\FormDataProvider;
use Wazum\Sluggi\Backend\PageRendererRenderPreProcess;
use Wazum\Sluggi\DataHandler\HandleExcludeSlugForSubpages;
use Wazum\Sluggi\DataHandler\HandlePageCopy;
use Wazum\Sluggi\DataHandler\HandlePageMove;
use Wazum\Sluggi\DataHandler\HandlePageUpdate;
use Wazum\Sluggi\Helper\Configuration;
use Wazum\Sluggi\Service\SlugService;
defined('TYPO3') || exit;
(static function (): void {
// Register some DataHandler hooks for page related actions
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']['sluggi-update']
= HandlePageUpdate::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass']['sluggi-copy']
= HandlePageCopy::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['moveRecordClass']['sluggi-move']
= HandlePageMove::class;
// Load custom JavaScript
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-preProcess'][]
= PageRendererRenderPreProcess::class . '->run';
// Render custom options for slug fields
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Backend\Form\Element\InputSlugElement::class] = [
'className' => InputSlugElement::class,
];
// Use a custom slug service
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Redirects\Service\SlugService::class] = [
'className' => SlugService::class,
];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1569661269] = [
'nodeName' => 'inputTextWithSlugImpact',
'priority' => 40,
'class' => InputTextWithSlugImpactElement::class,
];
// Modify feature related TCA on the fly
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['formDataGroup']['tcaDatabaseRecord'][FormDataProvider::class] = [
'depends' => [
EvaluateDisplayConditions::class,
],
];
// Overwrite the controller that returns slug suggestions
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Backend\Controller\FormSlugAjaxController::class] = [
'className' => FormSlugAjaxController::class,
];
if (Configuration::get('disable_slug_update_information')) {
unset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['updateSignalHook']['redirects:slugChanged']);
}
if (ExtensionManagementUtility::isLoaded('masi')) {
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']['sluggi-exclude']
= HandleExcludeSlugForSubpages::class;
}
})();