Resolves #45809: Refactor code and introduce namespacing
[TYPO3CMS/Extensions/static_info_tables.git] / ext_tables.php
1 <?php
2 if (!defined ('TYPO3_MODE')) {
3 die ('Access denied.');
4 }
5
6 // Configure extension static template
7 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile('static_info_tables', 'Configuration/TypoScript/', 'Static Info Tables');
8
9 $GLOBALS['TCA']['static_territories'] = array(
10 'ctrl' => array(
11 'label' => 'tr_name_en',
12 'label_alt' => 'tr_iso_nr',
13 'label_alt_force' => 1,
14 'label_userFunc' => 'SJBR\StaticInfoTables\Hook\Backend\Form\ElementRenderingHelper->addIsoCodeToLabel',
15 'readOnly' => 1,
16 'adminOnly' => 1,
17 'rootLevel' => 1,
18 'is_static' => 1,
19 'default_sortby' => 'ORDER BY tr_name_en',
20 'delete' => 'deleted',
21 'title' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_territories.title',
22 'dynamicConfigFile' => PATH_BE_staticinfotables . 'tca.php',
23 'iconfile' => PATH_BE_staticinfotables_rel . 'Resources/Public/Images/Icons/icon_static_territories.gif',
24 ),
25 'interface' => array(
26 'showRecordFieldList' => 'tr_name_en,tr_iso_nr'
27 )
28 );
29
30 // Country reference data from ISO 3166-1
31 $GLOBALS['TCA']['static_countries'] = array(
32 'ctrl' => array(
33 'label' => 'cn_short_en',
34 'label_alt' => 'cn_iso_2',
35 'label_alt_force' => 1,
36 'label_userFunc' => 'SJBR\StaticInfoTables\Hook\Backend\Form\ElementRenderingHelper->addIsoCodeToLabel',
37 'readOnly' => 1,
38 'adminOnly' => 1,
39 'rootLevel' => 1,
40 'is_static' => 1,
41 'default_sortby' => 'ORDER BY cn_short_en',
42 'delete' => 'deleted',
43 'title' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_countries.title',
44 'dynamicConfigFile' => PATH_BE_staticinfotables . 'tca.php',
45 'iconfile' => PATH_BE_staticinfotables_rel . 'Resources/Public/Images/Icons/icon_static_countries.gif',
46 ),
47 'interface' => array(
48 'showRecordFieldList' => 'cn_iso_2,cn_iso_3,cn_iso_nr,cn_official_name_local,cn_official_name_en,cn_capital,cn_tldomain,cn_currency_iso_3,cn_currency_iso_nr,cn_phone,cn_uno_member,cn_eu_member,cn_address_format,cn_short_en'
49 )
50 );
51
52 // Country subdivision reference data from ISO 3166-2
53 $GLOBALS['TCA']['static_country_zones'] = array(
54 'ctrl' => array(
55 'label' => 'zn_name_local',
56 'label_alt' => 'zn_name_local,zn_code',
57 'readOnly' => 1,
58 'adminOnly' => 1,
59 'rootLevel' => 1,
60 'is_static' => 1,
61 'default_sortby' => 'ORDER BY zn_name_local',
62 'delete' => 'deleted',
63 'title' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_country_zones.title',
64 'dynamicConfigFile' => PATH_BE_staticinfotables . 'tca.php',
65 'iconfile' => PATH_BE_staticinfotables_rel . 'Resources/Public/Images/Icons/icon_static_countries.gif',
66 ),
67 'interface' => array(
68 'showRecordFieldList' => 'zn_country_iso_nr,zn_country_iso_3,zn_code,zn_name_local,zn_name_en'
69 )
70 );
71
72 // Language reference data from ISO 639-1
73 $GLOBALS['TCA']['static_languages'] = array(
74 'ctrl' => array(
75 'label' => 'lg_name_en',
76 'label_alt' => 'lg_iso_2',
77 'label_alt_force' => 1,
78 'label_userFunc' => 'SJBR\StaticInfoTables\Hook\Backend\Form\ElementRenderingHelper->addIsoCodeToLabel',
79 'readOnly' => 1,
80 'adminOnly' => 1,
81 'rootLevel' => 1,
82 'is_static' => 1,
83 'default_sortby' => 'ORDER BY lg_name_en',
84 'delete' => 'deleted',
85 'title' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_languages.title',
86 'dynamicConfigFile' => PATH_BE_staticinfotables . 'tca.php',
87 'iconfile' => PATH_BE_staticinfotables_rel . 'Resources/Public/Images/Icons/icon_static_languages.gif',
88 ),
89 'interface' => array(
90 'showRecordFieldList' => 'lg_name_local,lg_name_en,lg_iso_2,lg_typo3,lg_country_iso_2,lg_collate_locale,lg_sacred,lg_constructed'
91 )
92 );
93
94 // Currency reference data from ISO 4217
95 $GLOBALS['TCA']['static_currencies'] = array(
96 'ctrl' => array(
97 'label' => 'cu_name_en',
98 'label_alt' => 'cu_iso_3',
99 'label_alt_force' => 1,
100 'label_userFunc' => 'SJBR\StaticInfoTables\Hook\Backend\Form\ElementRenderingHelper->addIsoCodeToLabel',
101 'readOnly' => 1,
102 'adminOnly' => 1,
103 'rootLevel' => 1,
104 'is_static' => 1,
105 'default_sortby' => 'ORDER BY cu_name_en',
106 'delete' => 'deleted',
107 'title' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_currencies.title',
108 'dynamicConfigFile' => PATH_BE_staticinfotables . 'tca.php',
109 'iconfile' => PATH_BE_staticinfotables_rel . 'Resources/Public/Images/Icons/icon_static_currencies.gif',
110 ),
111 'interface' => array(
112 'showRecordFieldList' => 'cu_iso_3,cu_iso_nr,cu_name_en,cu_symbol_left,cu_symbol_right,cu_thousands_point,cu_decimal_point,cu_decimal_digits,cu_sub_name_en,cu_sub_divisor,cu_sub_symbol_left,cu_sub_symbol_right'
113 )
114 );
115
116 $GLOBALS['TCA']['static_countries']['ctrl']['readOnly'] = 0;
117 $GLOBALS['TCA']['static_languages']['ctrl']['readOnly'] = 0;
118 $GLOBALS['TCA']['static_country_zones']['ctrl']['readOnly'] = 0;
119 $GLOBALS['TCA']['static_currencies']['ctrl']['readOnly'] = 0;
120 $GLOBALS['TCA']['static_territories']['ctrl']['readOnly'] = 0;
121
122
123 // Configure static language field of sys_language table
124 \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('sys_language');
125 $GLOBALS['TCA']['sys_language']['columns']['static_lang_isocode']['config'] = array(
126 'type' => 'select',
127 'items' => array(
128 array('',0),
129 ),
130 #'foreign_table' => 'static_languages',
131 #'foreign_table_where' => 'AND static_languages.pid=0 ORDER BY static_languages.lg_name_en',
132 'itemsProcFunc' => 'SJBR\StaticInfoTables\Utility\EntityLabelUtility->selectItemsTCA',
133 'itemsProcFunc_config' => array(
134 'table' => 'static_languages',
135 'indexField' => 'uid',
136 // I think that will make more sense in the future
137 // 'indexField' => 'lg_iso_2',
138 'prependHotlist' => 1,
139 // defaults:
140 //'hotlistLimit' => 8,
141 //'hotlistSort' => 1,
142 //'hotlistOnly' => 0,
143 //'hotlistApp' => TYPO3_MODE,
144 ),
145 /*'foreign_table' => 'static_languages',
146 'foreign_table_where' => 'AND static_languages.pid=0 ORDER BY static_languages.lg_name_en',
147 'itemsProcFunc' => 'SJBR\StaticInfoTables\Hook\Backend\Form\ElementRenderingHelper->translateLanguagesSelector',*/
148 'size' => 1,
149 'minitems' => 0,
150 'maxitems' => 1
151 );
152 // Add data handling hooks
153 $GLOBSALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] = '&SJBR\StaticInfoTables\Hook\Core\DataHandling\ProcessDataMap';
154 $GLOBSALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] = 'EXT:static_info_tables/class.tx_staticinfotables_syslanguage.php:&tx_staticinfotables_syslanguage';
155
156 ?>