-
Notifications
You must be signed in to change notification settings - Fork 0
/
ext_tables.php
106 lines (90 loc) · 5.25 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?php
if (!defined ('TYPO3_MODE')) die ('Access denied.');
$extensionConfiguration = Tx_AdGoogleMaps_Utility_BackEnd::getExtensionConfiguration('ad_google_maps_plugin_address');
// l10n_mode for property fields.
$excludeProperties = Tx_AdGoogleMaps_Utility_BackEnd::getExtensionConfigurationValue('excludeProperties');
// TCA configuration for tx_adgooglemaps_domain_model_layer
t3lib_div::loadTCA('tx_adgooglemaps_domain_model_layer');
$tempColumns = array(
'tx_adgooglemapspluginaddress_addresses' => array(
'label' => 'LLL:EXT:ad_google_maps_plugin_address/Resources/Private/Language/locallang_tca.xml:tx_adgooglemaps_domain_model_layer.addresses',
'exclude' => true,
'l10n_mode' => $excludeProperties,
'displayCond' => 'FIELD:coordinates_provider:=:Tx_AdGoogleMapsPluginAddress_MapBuilder_CoordinatesProvider_Addresses',
'config' => array(
'type' => 'select',
'size' => '5',
'autoSizeMax' => 15,
'minitems' => 0,
'maxitems' => 99,
'foreign_table' => 'tt_address',
'foreign_table_where' => 'AND NOT tt_address.hidden AND ' . (
$extensionConfiguration['useRecordStorage']
? 'tt_address.pid = ###STORAGE_PID###'
: '( NOT GREATEST( ###PAGE_TSCONFIG_ID###, ###PAGE_TSCONFIG_IDLIST### ) OR tt_address.pid IN( ###PAGE_TSCONFIG_ID###, ###PAGE_TSCONFIG_IDLIST### ) )'
),
'MM' => 'tx_adgooglemapspluginaddress_layer_ttaddress_mm',
),
),
'tx_adgooglemapspluginaddress_address_groups' => array(
'label' => 'LLL:EXT:ad_google_maps_plugin_address/Resources/Private/Language/locallang_tca.xml:tx_adgooglemaps_domain_model_layer.addressGroups',
'exclude' => true,
'l10n_mode' => $excludeProperties,
'displayCond' => 'FIELD:coordinates_provider:=:Tx_AdGoogleMapsPluginAddress_MapBuilder_CoordinatesProvider_AddressGroup',
'config' => array(
'type' => 'select',
'size' => '5',
'autoSizeMax' => 15,
'minitems' => 0,
'maxitems' => 99,
'foreign_table' => 'tt_address_group',
'foreign_table_where' => 'AND NOT tt_address_group.hidden AND ' . (
$extensionConfiguration['useRecordStorage']
? 'tt_address_group.pid = ###STORAGE_PID###'
: '( NOT GREATEST( ###PAGE_TSCONFIG_ID###, ###PAGE_TSCONFIG_IDLIST### ) OR tt_address_group.pid IN( ###PAGE_TSCONFIG_ID###, ###PAGE_TSCONFIG_IDLIST### ) )'
),
'MM' => 'tx_adgooglemapspluginaddress_layer_ttaddressgroup_mm',
),
),
);
t3lib_extMgm::addTCAcolumns('tx_adgooglemaps_domain_model_layer', $tempColumns, 1);
t3lib_extMgm::addLLrefForTCAdescr('tx_adgooglemaps_domain_model_layer', 'EXT:ad_google_maps_plugin_address/Resources/Private/Language/locallang_tca_csh_layer.xml');
// Add layer type icon.
$TCA['tx_adgooglemaps_domain_model_layer']['columns']['coordinates_provider']['config']['items'][] = array('LLL:EXT:ad_google_maps_plugin_address/Resources/Private/Language/locallang_tca.xml:tx_adgooglemaps_domain_model_layer.coordinatesProvider.addresses', 'Tx_AdGoogleMapsPluginAddress_MapBuilder_CoordinatesProvider_Addresses');
$TCA['tx_adgooglemaps_domain_model_layer']['columns']['coordinates_provider']['config']['items'][] = array('LLL:EXT:ad_google_maps_plugin_address/Resources/Private/Language/locallang_tca.xml:tx_adgooglemaps_domain_model_layer.coordinatesProvider.addressGroups', 'Tx_AdGoogleMapsPluginAddress_MapBuilder_CoordinatesProvider_AddressGroup');
t3lib_extMgm::addToAllTCAtypes(
'tx_adgooglemaps_domain_model_layer',
'tx_adgooglemapspluginaddress_addresses, tx_adgooglemapspluginaddress_address_groups',
$extensionConfiguration['addToLayerType'],
'after:coordinates_provider'
);
// Add static TypoScript
t3lib_extMgm::addStaticFile($_EXTKEY, 'Configuration/TypoScript/', 'ad: Google Maps Plugin Address Coordinates Provider');
// Add tt_address support.
if (t3lib_extMgm::isLoaded('tt_address') === TRUE) {
t3lib_div::loadTCA('tt_address');
if ((boolean) $extensionConfiguration['useMapDrawerForAddress'] === TRUE) {
$tempColumns = array(
'tx_adgooglemapspluginaddress_coordinates' => array(
'exclude' => true,
'label' => 'LLL:EXT:ad_google_maps/Resources/Private/Language/MapDrawer/locallang.xml:tx_adgooglemaps_mapdrawer.coordinates',
'config' => array(
'type' => 'user',
'size' => 20,
'eval' => 'required,nospace,trim',
'userFunc' => 'EXT:ad_google_maps/Classes/MapDrawer/MapDrawerApi.php:tx_AdGoogleMaps_MapDrawer_MapDrawerApi->tx_draw',
),
),
);
t3lib_extMgm::addTCAcolumns('tt_address', $tempColumns, 1);
t3lib_extMgm::addLLrefForTCAdescr('tt_address', 'EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_tca_csh_layer.xml');
t3lib_extMgm::addToAllTCAtypes('tt_address', '--div--;LLL:EXT:ad_google_maps/Resources/Private/Language/MapDrawer/locallang.xml:tx_adgooglemaps_mapdrawer.sheetMapDrawer, tx_adgooglemapspluginaddress_coordinates;;;;1-1-1');
$GLOBALS['TCA']['tt_address']['ctrl']['dividers2tabs'] = 2;
}
if ((boolean) $extensionConfiguration['useSorting'] === TRUE && !isset($GLOBALS['TCA']['tt_address']['ctrl']['sortby'])) {
$GLOBALS['TCA']['tt_address']['ctrl']['sortby'] = 'sorting';
}
// Set post process function for tt_address on change.
$TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']['processDatamap_postProcessFieldArray'] = 'EXT:ad_google_maps_plugin_address/Classes/Service/AddressPostProcess.php:tx_AdGoogleMapsPluginAddress_Service_AddressPostProcess';
}
?>