forked from web-vision/wv_deepltranslate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ext_tables.php
81 lines (71 loc) · 3.83 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
<?php
if (!defined('TYPO3_MODE')) {
die('Access denied.');
}
(function () {
$iconProviderConfiguration = [
\TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class => [
'actions-localize-deepl' => ['source' => 'EXT:wv_deepltranslate/Resources/Public/Icons/actions-localize-deepl.svg'],
'actions-localize-google' => ['source' => 'EXT:wv_deepltranslate/Resources/Public/Icons/actions-localize-google.svg'],
],
];
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
foreach ($iconProviderConfiguration as $provider => $iconConfiguration) {
foreach ($iconConfiguration as $identifier => $option) {
$iconRegistry->registerIcon($identifier, $provider, $option);
}
}
$typo3VersionArray = \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionStringToArray(
\TYPO3\CMS\Core\Utility\VersionNumberUtility::getCurrentTypo3Version()
);
// Backend Module is deprecated with v11, and we disable this.
// With the Extension Configuration you can activate this Backend Module to find out the mapping
if (
version_compare((string)$typo3VersionArray['version_main'], '11', '<')
|| (
version_compare((string)$typo3VersionArray['version_main'], '11', '=')
&& isset($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['wv_deepltranslate']['activateBackendModule'])
&& (bool)$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['wv_deepltranslate']['activateBackendModule'] === true
)
) {
//register backend module
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
'WebVision.WvDeepltranslate',
'Deepl',
'',
'',
[],
[
'icon' => 'EXT:wv_deepltranslate/Resources/Public/Icons/deepl.svg',
'access' => 'user,group',
'labels' => 'LLL:EXT:wv_deepltranslate/Resources/Private/Language/locallang.xlf',
]
);
if (version_compare((string)$typo3VersionArray['version_main'], '10', '<')) {
$actionsControllerArray = [
'Settings' => 'index,saveSettings',
];
} else {
$actionsControllerArray = [
\WebVision\WvDeepltranslate\Controller\SettingsController::class => 'index,saveSettings',
];
}
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
'WebVision.WvDeepltranslate',
'Deepl',
'Settings',
'',
$actionsControllerArray,
[
'icon' => 'EXT:install/Resources/Public/Icons/module-install-settings.svg',
'access' => 'user,group',
'labels' => 'LLL:EXT:wv_deepltranslate/Resources/Private/Language/locallang_module_settings.xlf',
]
);
}
$GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride']['EXT:backend/Resources/Private/Language/locallang_layout.xlf'][] = 'EXT:wv_deepltranslate/Resources/Private/Language/locallang.xlf';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_wvdeepltranslate_domain_model_glossaries', 'EXT:wv_deepltranslate/Resources/Private/Language/locallang_csh_tx_wvdeepltranslate_domain_model_glossaries.xlf');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_wvdeepltranslate_domain_model_glossaries');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_wvdeepltranslate_domain_model_glossariessync', 'EXT:wv_deepltranslate/Resources/Private/Language/locallang_csh_tx_wvdeepltranslate_domain_model_glossariessync.xlf');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_wvdeepltranslate_domain_model_glossariessync');
})();