f2f209ba1cb247c82d3955c912831be5d4d9c2b0
[TYPO3CMS/Extensions/static_info_tables.git] / ext_tables.php
1 <?php
2 if (!defined ('TYPO3_MODE')) die ('Access denied.');
3
4 t3lib_extMgm::addStaticFile('static_info_tables', 'Configuration/TypoScript/', 'Static Info tables');
5
6 $GLOBALS['TCA']['static_territories'] = array(
7 'ctrl' => array(
8 'label' => 'tr_name_en',
9 'label_alt' => 'tr_iso_nr',
10 'label_alt_force' => 1,
11 'label_userFunc' => 'EXT:static_info_tables/Classes/Hook/Backend/Form/class.tx_staticinfotables_renderElement.php:tx_staticinfotables_renderElement->addIsoCodeToLabel',
12 // This should always be true, as it prevents the static data from being altered
13 'readOnly' => 1,
14 'adminOnly' => 1,
15 'rootLevel' => 1,
16 'is_static' => 1,
17 'default_sortby' => 'ORDER BY tr_name_en',
18 'delete' => 'deleted',
19 'title' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_territories.title',
20 'dynamicConfigFile' => PATH_BE_staticinfotables . 'tca.php',
21 'iconfile' => PATH_BE_staticinfotables_rel . 'Resources/Public/Images/Icons/icon_static_territories.gif',
22 ),
23 'interface' => array(
24 'showRecordFieldList' => 'tr_name_en,tr_iso_nr'
25 )
26 );
27
28 // Country reference data from ISO 3166-1
29 $GLOBALS['TCA']['static_countries'] = array(
30 'ctrl' => array(
31 'label' => 'cn_short_en',
32 'label_alt' => 'cn_iso_2',
33 'label_alt_force' => 1,
34 'label_userFunc' => 'EXT:static_info_tables/Classes/Hook/Backend/Form/class.tx_staticinfotables_renderElement.php:tx_staticinfotables_renderElement->addIsoCodeToLabel',
35 // This should always be true, as it prevents the static data from being altered
36 'readOnly' => 1,
37 'adminOnly' => 1,
38 'rootLevel' => 1,
39 'is_static' => 1,
40 'default_sortby' => 'ORDER BY cn_short_en',
41 'delete' => 'deleted',
42 'title' => 'LLL:EXT:'.STATIC_INFO_TABLES_EXTkey.'/Resources/Private/Language/locallang_db.xlf:static_countries.title',
43 'dynamicConfigFile' => PATH_BE_staticinfotables.'tca.php',
44 'iconfile' => PATH_BE_staticinfotables_rel . 'Resources/Public/Images/Icons/icon_static_countries.gif',
45 ),
46 'interface' => array(
47 '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'
48 )
49 );
50
51 // Country subdivision reference data from ISO 3166-2
52 $GLOBALS['TCA']['static_country_zones'] = array(
53 'ctrl' => array(
54 'label' => 'zn_name_local',
55 'label_alt' => 'zn_name_local,zn_code',
56 'readOnly' => 1,
57 'adminOnly' => 1,
58 'rootLevel' => 1,
59 'is_static' => 1,
60 'default_sortby' => 'ORDER BY zn_name_local',
61 'delete' => 'deleted',
62 'title' => 'LLL:EXT:'.STATIC_INFO_TABLES_EXTkey.'/Resources/Private/Language/locallang_db.xlf:static_country_zones.title',
63 'dynamicConfigFile' => PATH_BE_staticinfotables.'tca.php',
64 'iconfile' => PATH_BE_staticinfotables_rel . 'Resources/Public/Images/Icons/icon_static_countries.gif',
65 ),
66 'interface' => array(
67 'showRecordFieldList' => 'zn_country_iso_nr,zn_country_iso_3,zn_code,zn_name_local,zn_name_en'
68 )
69 );
70
71 // Language reference data from ISO 639-1
72 $GLOBALS['TCA']['static_languages'] = array(
73 'ctrl' => array(
74 'label' => 'lg_name_en',
75 'label_alt' => 'lg_name_en,lg_iso_2',
76 'readOnly' => 1,
77 'adminOnly' => 1,
78 'rootLevel' => 1,
79 'is_static' => 1,
80 'default_sortby' => 'ORDER BY lg_name_en',
81 'delete' => 'deleted',
82 'title' => 'LLL:EXT:'.STATIC_INFO_TABLES_EXTkey.'/Resources/Private/Language/locallang_db.xlf:static_languages.title',
83 'dynamicConfigFile' => PATH_BE_staticinfotables.'tca.php',
84 'iconfile' => PATH_BE_staticinfotables_rel . 'Resources/Public/Images/Icons/icon_static_languages.gif',
85 ),
86 'interface' => array(
87 'showRecordFieldList' => 'lg_name_local,lg_name_en,lg_iso_2,lg_typo3,lg_country_iso_2,lg_collate_locale,lg_sacred,lg_constructed'
88 )
89 );
90
91 // Currency reference data from ISO 4217
92 $GLOBALS['TCA']['static_currencies'] = array(
93 'ctrl' => array(
94 'label' => 'cu_name_en',
95 'label_alt' => 'cu_iso_3',
96 'label_alt_force' => 1,
97 'label_userFunc' => 'EXT:static_info_tables/Classes/Hook/Backend/Form/class.tx_staticinfotables_renderElement.php:tx_staticinfotables_renderElement->addIsoCodeToLabel',
98 'readOnly' => 1,
99 'adminOnly' => 1,
100 'rootLevel' => 1,
101 'is_static' => 1,
102 'default_sortby' => 'ORDER BY cu_name_en',
103 'delete' => 'deleted',
104 'title' => 'LLL:EXT:'.STATIC_INFO_TABLES_EXTkey.'/Resources/Private/Language/locallang_db.xlf:static_currencies.title',
105 'dynamicConfigFile' => PATH_BE_staticinfotables.'tca.php',
106 'iconfile' => PATH_BE_staticinfotables_rel . 'Resources/Public/Images/Icons/icon_static_currencies.gif',
107 ),
108 'interface' => array(
109 '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'
110 )
111 );
112
113 $GLOBALS['TCA']['static_countries']['ctrl']['readOnly'] = 0;
114 $GLOBALS['TCA']['static_languages']['ctrl']['readOnly'] = 0;
115 $GLOBALS['TCA']['static_country_zones']['ctrl']['readOnly'] = 0;
116 $GLOBALS['TCA']['static_currencies']['ctrl']['readOnly'] = 0;
117 $GLOBALS['TCA']['static_territories']['ctrl']['readOnly'] = 0;
118
119
120 // ******************************************************************
121 // sys_language
122 // ******************************************************************
123
124 t3lib_div::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' => 'tx_staticinfotables_div->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 'size' => 1,
146 'minitems' => 0,
147 'maxitems' => 1,
148 );
149 // Add data handling hooks
150 $TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] = 'EXT:static_info_tables/Classes/Hook/Core/DataHandling/class.tx_staticinfotables_processdatamap.php:&tx_staticinfotables_processdatamap';
151 $TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] = 'EXT:static_info_tables/class.tx_staticinfotables_syslanguage.php:&tx_staticinfotables_syslanguage';
152
153 ?>