-
Notifications
You must be signed in to change notification settings - Fork 0
/
ext_tables.php
97 lines (90 loc) · 3.61 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
<?php
call_user_func(
static function () {
$currentTypo3Version = \TYPO3\CMS\Core\Utility\VersionNumberUtility::getCurrentTypo3Version();
if (version_compare($currentTypo3Version, '13', '<')) {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages(
'tx_sgcookieoptin_domain_model_optin'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages(
'tx_sgcookieoptin_domain_model_group'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages(
'tx_sgcookieoptin_domain_model_script'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages(
'tx_sgcookieoptin_domain_model_cookie'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages(
'tx_sgcookieoptin_domain_model_service'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr(
'tx_sgcookieoptin_domain_model_optin',
'EXT:sg_cookie_optin/Resources/Private/Language/locallang_csh_tx_sgcookieoptin_domain_model_optin.xlf'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr(
'tx_sgcookieoptin_domain_model_cookie',
'EXT:sg_cookie_optin/Resources/Private/Language/locallang_csh_tx_sgcookieoptin_domain_model_cookie.xlf'
);
}
$hideModuleInProductionContext = \SGalinski\SgCookieOptin\Service\ExtensionSettingsService::getSetting(
\SGalinski\SgCookieOptin\Service\ExtensionSettingsService::SETTING_HIDE_MODULE_IN_PRODUCTION_CONTEXT
);
$showModule = TRUE;
if ($hideModuleInProductionContext) {
if (version_compare(
\TYPO3\CMS\Core\Utility\VersionNumberUtility::getCurrentTypo3Version(),
'10.2.0',
'<'
)) {
$applicationContext = \TYPO3\CMS\Core\Utility\GeneralUtility::getApplicationContext();
} else {
$applicationContext = \TYPO3\CMS\Core\Core\Environment::getContext();
}
if (isset($applicationContext)) {
$showModule = !$applicationContext->isProduction();
}
}
if ($showModule && version_compare($currentTypo3Version, '13.0.0', '<')) {
if (version_compare($currentTypo3Version, '11.0.0', '>=')) {
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
'sg_cookie_optin',
'web',
'Optin',
'',
[
\SGalinski\SgCookieOptin\Controller\LegacyOptinController::class => 'index, activateDemoMode, create, uploadJson, importJson, previewImport, exportJson',
\SGalinski\SgCookieOptin\Controller\LegacyStatisticsController::class => 'index',
\SGalinski\SgCookieOptin\Controller\LegacyConsentController::class => 'index',
],
[
'access' => 'user,group',
'icon' => 'EXT:sg_cookie_optin/Resources/Public/Icons/module-sgcookieoptin.png',
'labels' => 'LLL:EXT:sg_cookie_optin/Resources/Private/Language/locallang.xlf',
]
);
} else {
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
'SGalinski.sg_cookie_optin',
'web',
'Optin',
'',
[
'LegacyOptin' => 'index, activateDemoMode, create, uploadJson, importJson, previewImport, exportJson',
'LegacyStatistics' => 'index',
'LegacyConsent' => 'index',
],
[
'access' => 'user,group',
'icon' => 'EXT:sg_cookie_optin/Resources/Public/Icons/module-sgcookieoptin.png',
'labels' => 'LLL:EXT:sg_cookie_optin/Resources/Private/Language/locallang.xlf',
]
);
}
}
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class]['options']['tables']['tx_sgcookieoptin_domain_model_user_preference'] = [
'dateField' => 'tstamp',
'expirePeriod' => 540
];
}
);