[BUGFIX] Show records in ws preview if live is hidden
[Packages/TYPO3.CMS.git] / typo3 / sysext / indexed_search / ext_localconf.php
1 <?php
2
3 defined('TYPO3') or die();
4
5 // register plugin
6 \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
7 'IndexedSearch',
8 'Pi2',
9 [\TYPO3\CMS\IndexedSearch\Controller\SearchController::class => 'form,search,noTypoScript'],
10 [\TYPO3\CMS\IndexedSearch\Controller\SearchController::class => 'form,search']
11 );
12
13 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-cached']['indexed_search'] = \TYPO3\CMS\IndexedSearch\Hook\TypoScriptFrontendHook::class . '->indexPageContent';
14
15 // Configure default document parsers:
16 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['external_parsers'] = [
17 'pdf' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
18 'doc' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
19 'docx' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
20 'dotx' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
21 'pps' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
22 'ppsx' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
23 'ppt' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
24 'pptx' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
25 'potx' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
26 'xls' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
27 'xlsx' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
28 'xltx' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
29 'sxc' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
30 'sxi' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
31 'sxw' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
32 'ods' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
33 'odp' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
34 'odt' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
35 'rtf' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
36 'txt' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
37 'html' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
38 'htm' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
39 'csv' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
40 'xml' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
41 'jpg' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
42 'jpeg' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
43 'tif' => \TYPO3\CMS\IndexedSearch\FileContentParser::class
44 ];
45
46 $extConf = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
47 \TYPO3\CMS\Core\Configuration\ExtensionConfiguration::class
48 )->get('indexed_search');
49
50 if (isset($extConf['useMysqlFulltext']) && (bool)$extConf['useMysqlFulltext']) {
51 // Use all index_* tables except "index_rel" and "index_words"
52 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['use_tables'] =
53 'index_phash,index_fulltext,index_section,index_grlist,index_stat_word,index_debug,index_config';
54 } else {
55 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['use_tables'] =
56 'index_phash,index_fulltext,index_rel,index_words,index_section,index_grlist,index_stat_word,index_debug,index_config';
57 }
58
59 // Add search to new content element wizard
60 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('
61 mod.wizards.newContentElement.wizardItems.forms {
62 elements.search {
63 iconIdentifier = content-elements-searchform
64 title = LLL:EXT:indexed_search/Resources/Private/Language/locallang_pi.xlf:pi_wizard_title
65 description = LLL:EXT:indexed_search/Resources/Private/Language/locallang_pi.xlf:pi_wizard_description
66 tt_content_defValues {
67 CType = list
68 list_type = indexedsearch_pi2
69 }
70 }
71 show :=addToList(search)
72 }
73 ');
74
75 // Use the advanced doubleMetaphone parser instead of the internal one (usage of metaphone parsers is generally disabled by default)
76 if (isset($extConf['enableMetaphoneSearch']) && (int)$extConf['enableMetaphoneSearch'] == 2) {
77 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['metaphone'] = \TYPO3\CMS\IndexedSearch\Utility\DoubleMetaPhoneUtility::class;
78 }
79 unset($extConf);