forked from kpurrmann/typo3-kesearch-categories
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathext_tables.php
69 lines (63 loc) · 2.4 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
<?php
if (!defined('TYPO3_MODE')) {
die('Access denied.');
}
$tempColumns = array(
'use_categories_for_filter_options' => array(
'exclude' => 1,
'label' => 'LLL:EXT:kesearch_categories/Resources/Private/Language/locallang_db.xlf:tx_kesearch_filters.use_categories_for_filter_options',
'config' => array(
'type' => 'check',
)
),
'categories' => array(
'exclude' => 1,
'l10n_mode' => 'mergeIfNotBlank',
'displayCond' => 'FIELD:use_categories_for_filter_options:=:1',
'label' => 'LLL:EXT:kesearch_categories/Resources/Private/Language/locallang_db.xlf:tx_kesearch_filters.categories',
'config' => array(
'type' => 'select',
'renderMode' => 'tree',
'renderType' => 'selectTree',
'treeConfig' => array(
'parentField' => 'parent',
'appearance' => array(
'showHeader' => true,
'allowRecursiveMode' => true,
'expandAll' => true,
'maxLevels' => 99,
),
),
'MM' => 'sys_category_record_mm',
'MM_match_fields' => array(
'fieldname' => 'categories',
'tablenames' => 'tx_kesearch_filters',
),
'MM_opposite_field' => 'items',
'foreign_table' => 'sys_category',
'foreign_table_where' => ' AND (sys_category.sys_language_uid = 0 OR sys_category.l10n_parent = 0) ' .
'ORDER BY sys_category.sorting',
'size' => 10,
'autoSizeMax' => 20,
'minitems' => 1,
'maxitems' => 99,
)
),
'use_subcategories' => array(
'exclude' => 1,
'displayCond' => 'FIELD:use_categories_for_filter_options:=:1',
'label' => 'LLL:EXT:kesearch_categories/Resources/Private/Language/locallang_db.xlf:tx_kesearch_filters.use_subcategories',
'config' => array(
'type' => 'check',
)
),
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns(
'tx_kesearch_filters',
$tempColumns
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
'tx_kesearch_filters',
'use_categories_for_filter_options, categories, use_subcategories'
);
$GLOBALS['TCA']['tx_kesearch_filters']['ctrl']['requestUpdate'] .= ',use_categories_for_filter_options';