forked from teaminmedias-pluswerk/ke_search
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ext_tables.php
128 lines (110 loc) · 4.56 KB
/
ext_tables.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?php
if (!defined('TYPO3_MODE')) {
die('Access denied.');
}
$extPath = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('ke_search');
$extRelPath = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('ke_search');
if (TYPO3_MODE == 'BE') {
require_once($extPath . 'Classes/lib/class.tx_kesearch_lib_items.php');
}
// add help file
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr(
'tx_kesearch_filters',
'EXT:ke_search/locallang_csh.xml'
);
// show FlexForm field in plugin configuration
$TCA['tt_content']['types']['list']['subtypes_addlist'][$_EXTKEY . '_pi1'] = 'pi_flexform';
$TCA['tt_content']['types']['list']['subtypes_addlist'][$_EXTKEY . '_pi2'] = 'pi_flexform';
$TCA['tt_content']['types']['list']['subtypes_addlist'][$_EXTKEY . '_pi3'] = 'pi_flexform';
// remove the old "plugin mode" configuration field
$TCA['tt_content']['types']['list']['subtypes_excludelist'][$_EXTKEY . '_pi1'] = 'select_key';
$TCA['tt_content']['types']['list']['subtypes_excludelist'][$_EXTKEY . '_pi2'] = 'select_key';
$TCA['tt_content']['types']['list']['subtypes_excludelist'][$_EXTKEY . '_pi3'] = 'select_key';
// Configure FlexForm field
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
$_EXTKEY . '_pi1',
'FILE:EXT:ke_search/pi1/flexform_pi1.xml'
);
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
$_EXTKEY . '_pi2',
'FILE:EXT:ke_search/pi2/flexform_pi2.xml'
);
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
$_EXTKEY . '_pi3',
'FILE:EXT:ke_search/pi3/flexform_pi3.xml'
);
// add tag field to pages
$tempColumns = array(
'tx_kesearch_tags' => array(
'exclude' => 1,
'label' => 'LLL:EXT:ke_search/locallang_db.xml:pages.tx_kesearch_tags',
'config' => array(
'type' => 'select',
'renderType' => 'selectSingleBox',
'size' => 10,
'minitems' => 0,
'maxitems' => 100,
'items' => array(),
'allowNonIdValues' => true,
'itemsProcFunc' => 'user_filterlist->getListOfAvailableFiltersForTCA',
)
),
);
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('pages', $tempColumns);
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages', 'tx_kesearch_tags;;;;1-1-1');
// add module
if (TYPO3_MODE == 'BE') {
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
'TeaminmediasPluswerk.' . $_EXTKEY,
'web', // Main area
'backend_module', // Name of the module
'', // Position of the module
array( // Allowed controller action combinations
'BackendModule' =>
'startIndexing,indexedContent,indexTableInformation,'
. 'searchwordStatistics,clearSearchIndex,lastIndexingReport,alert',
),
array( // Additional configuration
'access' => 'user,group',
'icon' => 'EXT:ke_search/Resources/Public/Icons/moduleicon.svg',
'labels' => 'LLL:EXT:ke_search/Resources/Private/Language/locallang_mod.xml',
)
);
}
// add plugins
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(
array(
'LLL:EXT:ke_search/locallang_db.xml:tt_content.list_type_pi1',
$_EXTKEY . '_pi1'
),
'list_type'
);
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(
array(
'LLL:EXT:ke_search/locallang_db.xml:tt_content.list_type_pi2',
$_EXTKEY . '_pi2'
),
'list_type'
);
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(
array(
'LLL:EXT:ke_search/locallang_db.xml:tt_content.list_type_pi3',
$_EXTKEY . '_pi3'
),
'list_type'
);
if (TYPO3_MODE == 'BE') {
$TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses']['tx_kesearch_pi1_wizicon'] =
$extPath . 'pi1/class.tx_kesearch_pi1_wizicon.php';
$TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses']['tx_kesearch_pi2_wizicon'] =
$extPath . 'pi2/class.tx_kesearch_pi2_wizicon.php';
$TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses']['tx_kesearch_pi3_wizicon'] =
$extPath . 'pi3/class.tx_kesearch_pi3_wizicon.php';
}
/** @var \TYPO3\CMS\Core\Imaging\IconRegistry $iconRegistry */
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Core\Imaging\IconRegistry');
$iconRegistry->registerIcon(
'ext-kesearch-wizard-icon',
'TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider',
['source' => 'EXT:ke_search/Resources/Public/Icons/ce_wiz.gif']
);