-
Notifications
You must be signed in to change notification settings - Fork 40
/
ext_tables.php
33 lines (28 loc) · 1.48 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
<?php
use WebVision\Deepltranslate\Core\Access\AccessRegistry;
defined('TYPO3') or die();
(function () {
$iconProviderConfiguration = [
\TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class => [
'actions-localize-deepl' => ['source' => 'EXT:deepltranslate_core/Resources/Public/Icons/actions-localize-deepl.svg'],
'actions-localize-google' => ['source' => 'EXT:deepltranslate_core/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);
}
}
/** @var AccessRegistry $accessRegistry */
$accessRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(AccessRegistry::class);
$GLOBALS['TYPO3_CONF_VARS']['BE']['customPermOptions']['deepltranslate'] ??= [];
$GLOBALS['TYPO3_CONF_VARS']['BE']['customPermOptions']['deepltranslate']['header'] = 'Deepl Translate Access';
foreach ($accessRegistry->getAllAccess() as $access) {
$GLOBALS['TYPO3_CONF_VARS']['BE']['customPermOptions']['deepltranslate']['items'][$access->getIdentifier()] = [
$access->getTitle(),
$access->getIconIdentifier(),
$access->getDescription(),
];
}
})();