forked from mindshape-GmbH/mindshape_cookie_consent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ext_tables.php
83 lines (69 loc) · 3.85 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
<?php
use Mindshape\MindshapeCookieConsent\Controller\Backend\StatisticController;
use Mindshape\MindshapeCookieConsent\Utility\SettingsUtility;
use TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider;
use TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider;
use TYPO3\CMS\Core\Imaging\IconRegistry;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;
defined('TYPO3') or die();
call_user_func(
function () {
ExtensionManagementUtility::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:' . SettingsUtility::EXTENSION_KEY . '/Configuration/TSconfig/ContentElementWizard.typoscript">');
ExtensionManagementUtility::allowTableOnStandardPages('tx_mindshapecookieconsent_domain_model_configuration');
ExtensionManagementUtility::allowTableOnStandardPages('tx_mindshapecookieconsent_domain_model_cookiecategory');
ExtensionManagementUtility::allowTableOnStandardPages('tx_mindshapecookieconsent_domain_model_cookieoption');
/** @var \TYPO3\CMS\Core\Imaging\IconRegistry $iconRegistry */
$iconRegistry = GeneralUtility::makeInstance(IconRegistry::class);
$iconRegistry->registerIcon(
SettingsUtility::EXTENSION_KEY . '-plugin-consent-icon',
SvgIconProvider::class,
['source' => 'EXT:' . SettingsUtility::EXTENSION_KEY . '/Resources/Public/Icons/plugin-consent.svg']
);
$iconRegistry->registerIcon(
SettingsUtility::EXTENSION_KEY . '-plugin-cookielist-icon',
SvgIconProvider::class,
['source' => 'EXT:' . SettingsUtility::EXTENSION_KEY . '/Resources/Public/Icons/plugin-cookielist.svg']
);
$iconRegistry->registerIcon(
'module-' . SettingsUtility::EXTENSION_NAME,
SvgIconProvider::class,
['source' => 'EXT:' . SettingsUtility::EXTENSION_KEY . '/Resources/Public/Icons/Extension.svg']
);
$iconRegistry->registerIcon(
'module-' . SettingsUtility::EXTENSION_NAME . '-statistic',
BitmapIconProvider::class,
['source' => 'EXT:' . SettingsUtility::EXTENSION_KEY . '/Resources/Public/Icons/module_statistic.png']
);
if ((new Typo3Version())->getMajorVersion() < 12) {
$webModuleIndex = array_search('web', array_keys($GLOBALS['TBE_MODULES'])) + 1;
$modulesStart = array_slice($GLOBALS['TBE_MODULES'], 0, $webModuleIndex, true);
$modulesEnd = array_slice($GLOBALS['TBE_MODULES'], $webModuleIndex, null, true);
$GLOBALS['TBE_MODULES'] = $modulesStart;
$GLOBALS['TBE_MODULES'] += [SettingsUtility::EXTENSION_NAME => ''];
$GLOBALS['TBE_MODULES'] += $modulesEnd;
$GLOBALS['TBE_MODULES']['_configuration'][SettingsUtility::EXTENSION_NAME] = [
'labels' => 'LLL:EXT:' . SettingsUtility::EXTENSION_KEY . '/Resources/Private/Language/module_locallang.xlf',
'name' => SettingsUtility::EXTENSION_NAME,
'workspaces' => 'online',
'iconIdentifier' => 'module-' . SettingsUtility::EXTENSION_NAME,
];
ExtensionUtility::registerModule(
'MindshapeCookieConsent',
SettingsUtility::EXTENSION_NAME,
'statistic',
'',
[
StatisticController::class => 'statisticButtons,statisticCategories,statisticOptions',
],
[
'access' => 'user,group',
'iconIdentifier' => 'module-' . SettingsUtility::EXTENSION_NAME . '-statistic',
'labels' => 'LLL:EXT:' . SettingsUtility::EXTENSION_KEY . '/Resources/Private/Language/module_statistic_locallang.xlf',
]
);
}
}
);