-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathext_localconf.php
65 lines (57 loc) · 2.66 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
<?php
use Fab\Messenger\Controller\MessageDisplayController;
use Fab\Messenger\Controller\MessageLayoutController;
use Fab\Messenger\Controller\MessageQueueController;
use Fab\Messenger\Controller\MessageTemplateController;
use Fab\Messenger\Controller\SentMessageModuleController;
use Fab\Messenger\PagePath\Resolver;
use Fab\Messenger\Task\MessengerDequeueFieldProvider;
use Fab\Messenger\Task\MessengerDequeueTask;
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;
defined('TYPO3') || die('Access denied.');
call_user_func(function () {
$configuration = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('messenger');
if (!isset($configuration['autoload_typoscript']) || (bool) $configuration['autoload_typoscript']) {
ExtensionManagementUtility::addTypoScript(
'messenger',
'constants',
'<INCLUDE_TYPOSCRIPT: source="FILE:EXT:messenger/Configuration/TypoScript/constants.txt">',
);
ExtensionManagementUtility::addTypoScript(
'messenger',
'setup',
'<INCLUDE_TYPOSCRIPT: source="FILE:EXT:messenger/Configuration/TypoScript/setup.txt">',
);
}
ExtensionUtility::configurePlugin(
'messenger',
'MessageDisplay',
[
MessageDisplayController::class => 'show',
SentMessageModuleController::class => 'index',
MessageTemplateController::class => 'index',
MessageLayoutController::class => 'index',
MessageQueueController::class => 'index',
],
// non-cacheable actions
[
MessageDisplayController::class => 'show',
SentMessageModuleController::class => 'index',
MessageTemplateController::class => 'index',
MessageLayoutController::class => 'index',
MessageQueueController::class => 'index',
],
);
// eID for resolving Frontend URL in the context of the Backend.
$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['messenger'] = Resolver::class . '::resolveUrl';
// Add caching framework garbage collection task
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][MessengerDequeueTask::class] = [
'extension' => 'messenger',
'title' => 'LLL:EXT:messenger/Resources/Private/Language/locallang.xlf:scheduler.dequeue.name',
'description' => 'LLL:EXT:messenger/Resources/Private/Language/locallang.xlf:scheduler.dequeue.description',
'additionalFields' => MessengerDequeueFieldProvider::class,
];
});