forked from tpwd/ke_search
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ext_localconf.php
85 lines (71 loc) · 4.03 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
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php
defined('TYPO3') or die();
(function () {
// add Searchbox Plugin, override class name with namespace
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43('ke_search', '', '_pi1');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript(
'tx_kesearch',
'setup',
'plugin.tx_kesearch_pi1.userFunc = Tpwd\KeSearch\Plugins\SearchboxPlugin->main'
);
// add Resultlist Plugin, override class name with namespace
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43('ke_search', '', '_pi2');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript(
'tx_kesearch',
'setup',
'plugin.tx_kesearch_pi2.userFunc = Tpwd\KeSearch\Plugins\ResultlistPlugin->main'
);
// add cachable Searchbox Plugin, override class name with namespace
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43('ke_search', '', '_pi3', 'list_type', 1);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript(
'tx_kesearch',
'setup',
'plugin.tx_kesearch_pi3.userFunc = Tpwd\KeSearch\Plugins\SearchboxPlugin->main'
);
// Add TypoScript configuration for dashboard widgets
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptSetup(
'<INCLUDE_TYPOSCRIPT: source="FILE:EXT:ke_search/Configuration/TypoScript/Backend/dashboard.typoscript">'
);
// add page TSconfig (Content element wizard icons, hide index table)
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
'<INCLUDE_TYPOSCRIPT: source="FILE:EXT:ke_search/Configuration/TSconfig/Page/pageTSconfig.tsconfig">'
);
// use hooks for generation of sortdate values
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['registerAdditionalFields'][] =
\Tpwd\KeSearch\Hooks\AdditionalFields::class;
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyPagesIndexEntry'][] =
\Tpwd\KeSearch\Hooks\AdditionalFields::class;
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyContentIndexEntry'][] =
\Tpwd\KeSearch\Hooks\AdditionalFields::class;
// Custom validators for TCA (eval)
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tce']['formevals']
['Tpwd\\KeSearch\\UserFunction\\CustomFieldValidation\\FilterOptionTagValidator'] =
'EXT:ke_search/Classes/UserFunction/CustomFieldValidation/FilterOptionTagValidator.php';
// logging
$extConf = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
\TYPO3\CMS\Core\Configuration\ExtensionConfiguration::class
)->get('ke_search');
$loglevel = strtolower($extConf['loglevel'] ?? 'ERROR');
$GLOBALS['TYPO3_CONF_VARS']['LOG']['Tpwd']['KeSearch']['writerConfiguration'] = [
$loglevel => [
\TYPO3\CMS\Core\Log\Writer\FileWriter::class => [
'logFileInfix' => 'kesearch',
],
],
];
// register "after save" hook
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']
['ke_search-filter-option'] = \Tpwd\KeSearch\Hooks\FilterOptionHook::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass']
['ke_search-filter-option'] = \Tpwd\KeSearch\Hooks\FilterOptionHook::class;
// Upgrade Wizards
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['keSearchMakeTagsAlphanumericUpgradeWizard']
= \Tpwd\KeSearch\Updates\MakeTagsAlphanumericUpgradeWizard::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['keSearchPopulateFilterOptionsSlugsUpgradeWizard']
= \Tpwd\KeSearch\Updates\PopulateFilterOptionSlugsUpgradeWizard::class;
// Custom aspects for routing
$GLOBALS['TYPO3_CONF_VARS']['SYS']['routing']['aspects']['KeSearchUrlEncodeMapper'] =
\Tpwd\KeSearch\Routing\Aspect\KeSearchUrlEncodeMapper::class;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['routing']['aspects']['KeSearchTagToSlugMapper'] =
\Tpwd\KeSearch\Routing\Aspect\KeSearchTagToSlugMapper::class;
})();