Resolves #45901: Add extbase persistence configuration and field mapping
[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
19 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptSetup('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:' . $_EXTKEY . '/Configuration/TypoScript/Extbase/setup.txt">');
20
21 // Unserializing the configuration so we can use it here
22 $_EXTCONF = unserialize($_EXTCONF);
23
24 // Possible label fields for different languages. Default as last.
25 $labelTable = array(
26 'static_territories' => array(
27 'label_fields' => array(
28 'tr_name_##', 'tr_name_en',
29 ),
30 'isocode_field' => array(
31 'tr_iso_##',
32 ),
33 ),
34 'static_countries' => array(
35 'label_fields' => array(
36 'cn_short_##', 'cn_short_en',
37 ),
38 'isocode_field' => array(
39 'cn_iso_##',
40 ),
41 ),
42 'static_country_zones' => array(
43 'label_fields' => array(
44 'zn_name_##', 'zn_name_local',
45 ),
46 'isocode_field' => array(
47 'zn_code', 'zn_country_iso_##',
48 ),
49 ),
50 'static_languages' => array(
51 'label_fields' => array(
52 'lg_name_##', 'lg_name_en',
53 ),
54 'isocode_field' => array(
55 'lg_iso_##', 'lg_country_iso_##',
56 ),
57 ),
58 'static_currencies' => array(
59 'label_fields' => array(
60 'cu_name_##', 'cu_name_en',
61 ),
62 'isocode_field' => array(
63 'cu_iso_##',
64 ),
65 ),
66 );
67
68 if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$_EXTKEY]['tables']) && is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$_EXTKEY]['tables'])) {
69 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$_EXTKEY]['tables'] = array_merge ($labelTable, $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$_EXTKEY]['tables']);
70 } else {
71 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$_EXTKEY]['tables'] = $labelTable;
72 }
73 ?>