-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathext_localconf.php
48 lines (41 loc) · 2.02 KB
/
ext_localconf.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
<?php
declare(strict_types=1);
if (!defined('TYPO3')) {
die('Access denied.');
}
use JWeiland\Clubdirectory\Controller\ClubController;
use JWeiland\Clubdirectory\Controller\MapController;
use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationExtensionNotConfiguredException;
use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationPathDoesNotExistException;
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;
call_user_func(static function () {
ExtensionUtility::configurePlugin(
'Clubdirectory',
'Clubdirectory',
[
ClubController::class => 'list, listMyClubs, show, new, create, edit, update, search, activate',
MapController::class => 'new, create, edit, update',
],
// non-cacheable actions
[
ClubController::class => 'create, update, search, activate',
MapController::class => 'create, update',
]
);
try {
$extConf = GeneralUtility::makeInstance(ExtensionConfiguration::class);
$rootCategory = (int)$extConf->get('clubdirectory', 'rootCategory');
$userGroup = (int)$extConf->get('clubdirectory', 'userGroup');
$tsConfig = [
'TCEFORM.tt_content.pi_flexform.clubdirectory_clubdirectory.sDEFAULT.settings\.category.PAGE_TSCONFIG_ID = ' . $rootCategory,
'TCEFORM.tx_clubdirectory_domain_model_club.categories.config.treeConfig.startingPoints = ' . $rootCategory,
'TCEFORM.tx_clubdirectory_domain_model_club.fe_users.PAGE_TSCONFIG_ID = ' . $userGroup,
];
ExtensionManagementUtility::addPageTSConfig(implode(LF, $tsConfig));
} catch (ExtensionConfigurationExtensionNotConfiguredException | ExtensionConfigurationPathDoesNotExistException $exception) {
}
$GLOBALS['TYPO3_CONF_VARS']['MAIL']['templateRootPaths'][1000] = 'EXT:clubdirectory/Resources/Private/Templates/Email';
});