-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
ext_localconf.php
158 lines (142 loc) · 6.25 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<?php
use OliverKlee\Seminars\Controller\EventController;
use OliverKlee\Seminars\Controller\EventRegistrationController;
use OliverKlee\Seminars\Controller\EventUnregistrationController;
use OliverKlee\Seminars\Controller\FrontEndEditorController;
use OliverKlee\Seminars\FrontEnd\DefaultController;
use OliverKlee\Seminars\Hooks\DataHandlerHook;
use OliverKlee\Seminars\SchedulerTasks\MailNotifier;
use OliverKlee\Seminars\SchedulerTasks\MailNotifierConfiguration;
use OliverKlee\Seminars\UpgradeWizards\GenerateEventSlugsUpgradeWizard;
use OliverKlee\Seminars\UpgradeWizards\RemoveDuplicateEventVenueRelationsUpgradeWizard;
use TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider;
use TYPO3\CMS\Core\Imaging\IconRegistry;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;
defined('TYPO3') or die('Access denied.');
(static function (): void {
// Adds our custom function to a hook in \TYPO3\CMS\Core\DataHandling\DataHandler
// Used for post-validation of fields in back-end forms.
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']['seminars']
= DataHandlerHook::class;
// Used for keeping registrations from getting duplicated when copying event records.
// @deprecated #1324 will be removed in seminars 6.0
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass']['seminars']
= DataHandlerHook::class;
ExtensionManagementUtility::addPItoST43(
'seminars',
'Classes/FrontEnd/DefaultController.php',
'_pi1'
);
ExtensionManagementUtility::addTypoScript(
'seminars',
'setup',
'
plugin.' . ExtensionManagementUtility::getCN('seminars')
. '_pi1.userFunc = ' . DefaultController::class . '->main
',
43
);
ExtensionManagementUtility::addTypoScript(
'seminars',
'setup',
'
tt_content.shortcut.20.conf.tx_seminars_seminars = < plugin.'
. ExtensionManagementUtility::getCN('seminars') . '_pi1
tt_content.shortcut.20.conf.tx_seminars_seminars.CMD = singleView
',
43
);
$languagePrefix = 'LLL:EXT:seminars/Resources/Private/Language/locallang.xlf:schedulerTasks.';
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']
[MailNotifier::class] = [
'extension' => 'seminars',
'title' => $languagePrefix . 'mailNotifier.name',
'description' => $languagePrefix . 'mailNotifier.description',
'additionalFields' => MailNotifierConfiguration::class,
];
$icons = [
'tx-seminars-canceled' => 'Canceled.png',
'tx-seminars-category' => 'Category.gif',
'tx-seminars-registration' => 'Registration.gif',
'tx-seminars-event-complete' => 'EventComplete.gif',
'tx-seminars-event-topic' => 'EventTopic.gif',
'tx-seminars-event-date' => 'EventDate.gif',
'tcarecords-tx_seminars_speakers-default' => 'Speaker.gif',
'tcarecords-tx_seminars_organizers-default' => 'Organizer.gif',
'tcarecords-tx_seminars_registrations-default' => 'Registration.gif',
'ext-seminars-wizard-icon' => 'Extension.svg',
];
/** @var IconRegistry $iconRegistry */
$iconRegistry = GeneralUtility::makeInstance(IconRegistry::class);
foreach ($icons as $key => $fileName) {
$iconRegistry->registerIcon(
$key,
BitmapIconProvider::class,
['source' => 'EXT:seminars/Resources/Public/Icons/' . $fileName]
);
}
ExtensionManagementUtility::addPageTSConfig(
'
<INCLUDE_TYPOSCRIPT: source="FILE:EXT:seminars/Configuration/TsConfig/ContentElementWizard.txt">
'
);
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['seminars_generateEventSlugs']
= GenerateEventSlugsUpgradeWizard::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['seminars_removeDuplicateEventVenueRelations']
= RemoveDuplicateEventVenueRelationsUpgradeWizard::class;
ExtensionUtility::configurePlugin(
'Seminars',
'EventArchive', // arbitrary, but unique plugin name (not visible in the BE)
// all actions
[EventController::class => 'archive'],
// no non-cacheable actions
[]
);
ExtensionUtility::configurePlugin(
'Seminars',
'EventOutlook', // arbitrary, but unique plugin name (not visible in the BE)
// all actions
[EventController::class => 'outlook'],
// no non-cacheable actions
[]
);
ExtensionUtility::configurePlugin(
'Seminars',
'EventSingleView', // arbitrary, but unique plugin name (not visible in the BE)
// all actions
[EventController::class => 'show'],
// no non-cacheable actions
[]
);
ExtensionUtility::configurePlugin(
'Seminars',
'EventRegistration', // arbitrary, but unique plugin name (not visible in the BE)
// all actions
[
EventRegistrationController::class => 'checkPrerequisites, deny, new, confirm, create, thankYou',
EventUnregistrationController::class => 'checkPrerequisites, deny, confirm, unregister, thankYou',
],
// non-cacheable actions
[
EventRegistrationController::class => 'checkPrerequisites, new, confirm, create, thankYou',
EventUnregistrationController::class => 'checkPrerequisites, confirm, unregister',
]
);
ExtensionUtility::configurePlugin(
'Seminars',
'FrontEndEditor', // arbitrary, but unique plugin name (not visible in the BE)
// all actions
[FrontEndEditorController::class => 'index, edit, update, new, create'],
// non-cacheable actions
[FrontEndEditorController::class => 'index, edit, update, new, create']
);
})();
// Ensure human-readable URLs as canonicals even if the original page does not have them.
if (ExtensionManagementUtility::isLoaded('seo')) {
$GLOBALS['TYPO3_CONF_VARS']['FE']['additionalCanonicalizedUrlParameters'] = \array_merge(
$GLOBALS['TYPO3_CONF_VARS']['FE']['additionalCanonicalizedUrlParameters'] ?? [],
['tx_seminars_pi1[showUid]']
);
}