-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathext_localconf.php
78 lines (67 loc) · 2.77 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
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
<?php
/**
* This file is part of the package netresearch/universal-messenger.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
use Netresearch\UniversalMessenger\Configuration;
use Netresearch\UniversalMessenger\Controller\NewsletterPreviewController;
use Netresearch\UniversalMessenger\Service\UniversalMessengerService;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;
defined('TYPO3') || exit('Access denied.');
call_user_func(static function (): void {
// Add TypoScript automatically (to use it in backend modules)
ExtensionManagementUtility::addTypoScript(
'universal_messenger',
'setup',
'@import "EXT:universal_messenger/Configuration/TypoScript/Default/setup.typoscript"'
);
// We need to add the following user typoscript config to all users, so that the new
// page type is displayed in the wizard
ExtensionManagementUtility::addUserTSConfig(
'options.pageTree.doktypesToShowInNewPageDragArea := addToList(' . Configuration::getNewsletterPageDokType() . ')'
);
// Service
ExtensionManagementUtility::addService(
'universal_messenger',
'universal_messenger',
UniversalMessengerService::class,
[
'title' => 'Universal Messenger API service',
'description' => 'Universal Messenger API service',
'subtype' => '',
'available' => true,
'priority' => 50,
'quality' => 50,
'os' => '',
'exec' => '',
'className' => UniversalMessengerService::class,
]
);
ExtensionUtility::configurePlugin(
'UniversalMessenger',
'NewsletterPreview',
[
NewsletterPreviewController::class => 'preview',
],
[
NewsletterPreviewController::class => 'preview',
],
);
// Hide the "new" button on the record detail view in backend
ExtensionManagementUtility::addUserTSConfig(
<<<TYPOSCRIPT
options.saveDocNew.tx_universalmessenger_domain_model_newsletterchannel = 0
TYPOSCRIPT
);
// Ignore the following parameters in cHash calculation
$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'][] = 'tx_universalmessenger_newsletterpreview[pageId]';
$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'][] = 'type';
$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'][] = 'preview';
// Add our custom style sheet
$GLOBALS['TYPO3_CONF_VARS']['BE']['stylesheets']['universal_messenger']
= 'EXT:universal_messenger/Resources/Public/Css/Module.css';
});