Resolves #45809: Refactor code and introduce namespacing
[TYPO3CMS/Extensions/static_info_tables.git] / ext_localconf.php
1 <?php
2 if (!defined ('TYPO3_MODE')) {
3 die ('Access denied.');
4 }
5
6 if (!defined ('STATIC_INFO_TABLES_EXTkey')) {
7 define('STATIC_INFO_TABLES_EXTkey', $_EXTKEY);
8 }
9
10 if (!defined ('PATH_BE_staticinfotables')) {
11 define('PATH_BE_staticinfotables', \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY));
12 }
13
14 if (!defined ('PATH_BE_staticinfotables_rel')) {
15 define('PATH_BE_staticinfotables_rel', \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($_EXTKEY));
16 }
17
18 // Unserializing the configuration so we can use it here
19 $_EXTCONF = unserialize($_EXTCONF);
20
21 // Possible label fields for different languages. Default as last.
22 $labelTable = array(
23 'static_territories' => array(
24 'label_fields' => array(
25 'tr_name_##', 'tr_name_en',
26 ),
27 'isocode_field' => array(
28 'tr_iso_##',
29 ),
30 ),
31 'static_countries' => array(
32 'label_fields' => array(
33 'cn_short_##', 'cn_short_en',
34 ),
35 'isocode_field' => array(
36 'cn_iso_##',
37 ),
38 ),
39 'static_country_zones' => array(
40 'label_fields' => array(
41 'zn_name_##', 'zn_name_local',
42 ),
43 'isocode_field' => array(
44 'zn_code', 'zn_country_iso_##',
45 ),
46 ),
47 'static_languages' => array(
48 'label_fields' => array(
49 'lg_name_##', 'lg_name_en',
50 ),
51 'isocode_field' => array(
52 'lg_iso_##', 'lg_country_iso_##',
53 ),
54 ),
55 'static_currencies' => array(
56 'label_fields' => array(
57 'cu_name_##', 'cu_name_en',
58 ),
59 'isocode_field' => array(
60 'cu_iso_##',
61 ),
62 ),
63 );
64
65 if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$_EXTKEY]['tables']) && is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$_EXTKEY]['tables'])) {
66 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$_EXTKEY]['tables'] = array_merge ($labelTable, $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$_EXTKEY]['tables']);
67 } else {
68 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$_EXTKEY]['tables'] = $labelTable;
69 }
70 ?>