-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathext_localconf.php
60 lines (52 loc) · 3.59 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
<?php
// hook into typolink to comvert params 2 path
$TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tstemplate.php']['linkData-PostProc']['nawork_uri'] = 'Nawork\NaworkUri\Controller\Frontend\UrlController->params2uri';
// hook to extract params from path
$TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['checkAlternativeIdMethods-PostProc']['nawork_uri'] = 'Nawork\NaworkUri\Controller\Frontend\UrlController->uri2params';
// redirect old urls to new
$TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['configArrayPostProc']['nawork_uri'] = 'Nawork\NaworkUri\Controller\Frontend\UrlController->redirect2uri';
$TYPO3_CONF_VARS['SC_OPTIONS']['tce']['formevals']['tx_naworkuri_path'] = 'EXT:nawork_uri/Classes/Validation/class.tx_naworkuri_path.php';
// register transformation services
\Nawork\NaworkUri\Utility\TransformationUtility::registerTransformationService('Hidden', \Nawork\NaworkUri\Transformation\Hidden\TransformationService::class);
\Nawork\NaworkUri\Utility\TransformationUtility::registerTransformationService('Plain', \Nawork\NaworkUri\Transformation\Plain\TransformationService::class);
\Nawork\NaworkUri\Utility\TransformationUtility::registerTransformationService('ValueMap', \Nawork\NaworkUri\Transformation\ValueMap\TransformationService::class);
\Nawork\NaworkUri\Utility\TransformationUtility::registerTransformationService('PagePath', \Nawork\NaworkUri\Transformation\PagePath\TransformationService::class);
\Nawork\NaworkUri\Utility\TransformationUtility::registerTransformationService('Database', \Nawork\NaworkUri\Transformation\Database\TransformationService::class);
// register default configuration, but do not override if default is already set
if (class_exists(Nawork\NaworkUri\Utility\ConfigurationUtility::class)) { // check this to avoid php error when activating the extension
Nawork\NaworkUri\Utility\ConfigurationUtility::registerConfiguration(
'default',
'EXT:nawork_uri/Configuration/Url/DefaultConfiguration.xml',
FALSE
);
}
// configure caching framework
if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['naworkuri_configuration'])) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['naworkuri_configuration'] = array();
}
if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['naworkuri_configuration']['backend'])) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['naworkuri_configuration']['backend'] = TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend::class;
}
// init hook object array
$GLOBALS['TYPO3_CONF_VARS']['EXT']['tx_naworkuri'][Nawork\NaworkUri\Controller\Frontend\UrlController::class] = array();
// add nawork-uri fields to pageOverlayFields
$GLOBALS['TYPO3_CONF_VARS']['FE']['pageOverlayFields'] .= ',tx_naworkuri_pathsegment,tx_naworkuri_exclude';
// slot registration
$extensionConfiguration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['nawork_uri']);
if ($extensionConfiguration['pageNotFoundBasicLanguageSupportEnable']) {
$signalSlotDispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class
);
$signalSlotDispatcher->connect(
\Nawork\NaworkUri\Controller\Frontend\UrlController::class,
'afterSetting404PageId',
\Nawork\NaworkUri\Slot\AfterSetting404PageId::class,
'afterSetting404PageId'
);
$signalSlotDispatcher->connect(
\Nawork\NaworkUri\Controller\Frontend\UrlController::class,
'beforeInternal404Request',
\Nawork\NaworkUri\Slot\BeforeInternal404Request::class,
'beforeInternal404Request'
);
}