-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
ext_localconf.php
123 lines (111 loc) · 5.14 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
<?php
use OliverKlee\Seminars\Controller\EventRegistrationController;
use OliverKlee\Seminars\Controller\EventUnregistrationController;
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;
// This makes the plugin available for front-end rendering.
ExtensionUtility::configurePlugin(
'Seminars', // extension name, matching the PHP namespaces (but without the vendor)
'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',
]
);
})();
// 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]',
]
);
}