-
Notifications
You must be signed in to change notification settings - Fork 16
/
ext_localconf.php
178 lines (160 loc) · 7.33 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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<?php
if (!defined('TYPO3')) {
die('Access denied.');
}
use JWeiland\Events2\Backend\FormDataProvider\InitializeNewEventRecord;
use JWeiland\Events2\Backend\FormDataProvider\ModifyRootUidOfTreeSelectElements;
use JWeiland\Events2\Controller\CalendarController;
use JWeiland\Events2\Controller\DayController;
use JWeiland\Events2\Controller\ICalController;
use JWeiland\Events2\Controller\LocationController;
use JWeiland\Events2\Controller\ManagementController;
use JWeiland\Events2\Controller\SearchController;
use JWeiland\Events2\Controller\VideoController;
use JWeiland\Events2\Hooks\DataHandler;
use JWeiland\Events2\Hooks\Form\PrefillCategoriesHook;
use JWeiland\Events2\Hooks\Form\PrefillForEditUsageHook;
use JWeiland\Events2\Hooks\Solr\IndexerHook;
use JWeiland\Events2\Hooks\Solr\ResultsCommandHook;
use JWeiland\Events2\Routing\Aspect\PersistedHiddenAliasMapper;
use JWeiland\Events2\Routing\Aspect\TimestampMapper;
use JWeiland\Events2\Task\AdditionalFieldsForImport;
use JWeiland\Events2\Task\Import;
use JWeiland\Events2\Task\ReGenerateDays;
use JWeiland\Events2\Tca\Type\Time;
use JWeiland\Events2\Upgrade\EventsSlugUpgrade;
use JWeiland\Events2\Upgrade\MigrateDetailInformationsUpgrade;
use JWeiland\Events2\Upgrade\MigrateOrganizerToMMUpgrade;
use JWeiland\Events2\Upgrade\MoveOldFlexFormSettingsUpgrade;
use Psr\Log\LogLevel;
use TYPO3\CMS\Backend\Form\FormDataProvider\DatabaseRowInitializeNew;
use TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems;
use TYPO3\CMS\Core\Log\Writer\FileWriter;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;
call_user_func(static function (): void {
ExtensionUtility::configurePlugin(
'Events2',
'List',
[
DayController::class => 'list, show',
LocationController::class => 'show',
VideoController::class => 'show',
ICalController::class => 'download',
],
);
ExtensionUtility::configurePlugin(
'Events2',
'Show',
[
DayController::class => 'show',
LocationController::class => 'show',
VideoController::class => 'show',
ICalController::class => 'download',
],
);
ExtensionUtility::configurePlugin(
'Events2',
'Management',
[
ManagementController::class => 'listMyEvents, new, create, edit, update, perform, delete, activate',
],
// non-cacheable actions
[
ManagementController::class => 'listMyEvents, create, edit, update, perform, delete, activate',
],
);
ExtensionUtility::configurePlugin(
'Events2',
'Calendar',
[
CalendarController::class => 'show',
],
);
ExtensionUtility::configurePlugin(
'Events2',
'SearchForm',
[
SearchController::class => 'show',
],
// Needs to be uncached, to show dynamic search values again after reload.
[
SearchController::class => 'show',
],
);
ExtensionUtility::configurePlugin(
'Events2',
'SearchResults',
[
SearchController::class => 'listSearchResults',
],
// needs to be uncached to show fresh search results
[
SearchController::class => 'listSearchResults',
],
);
// register an eval function to check for time
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tce']['formevals'][Time::class] = '';
// delete and recreate day relations for an event while saving
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']['events2_createDayRelations'] = DataHandler::class;
// Clear cache of pages with events, if event was edited/created/deleted in BE
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc']['events2_clearcache'] = DataHandler::class . '->clearCachePostProc';
// Prefill EXT:form element of type Checkboxes with categories from database
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['initializeFormElement'][1660727041]
= PrefillCategoriesHook::class;
// Set values from request as default values for edit usage
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['afterBuildingFinished'][1662039121]
= PrefillForEditUsageHook::class;
// create scheduler to create/update days with recurrency
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][ReGenerateDays::class] = [
'extension' => 'events2',
'title' => 'LLL:EXT:events2/Resources/Private/Language/locallang_db.xlf:task.reCreateDays.title',
'description' => 'LLL:EXT:events2/Resources/Private/Language/locallang_db.xlf:task.reCreateDays.description',
'additionalFields' => ReGenerateDays::class,
];
// create scheduler to import events from different sources
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][Import::class] = [
'extension' => 'events2',
'title' => 'Import events',
'description' => 'Import events over a XML interface or by mail into events2.',
'additionalFields' => AdditionalFieldsForImport::class,
];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['routing']['aspects']['TimestampMapper'] = TimestampMapper::class;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['routing']['aspects']['PersistedHiddenAliasMapper'] = PersistedHiddenAliasMapper::class;
if (ExtensionManagementUtility::isLoaded('solr')) {
// Remove non-current events from resultSet
// Add nextDay field to SearchResult object
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['afterSearch']['events2_addNextDay']
= ResultsCommandHook::class;
// As we can't create a SQL Query with JOIN in Solr configuration, we have to remove invalid documents on our own
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['IndexQueueIndexer']['preAddModifyDocuments']['events2_removeInvalidDocs']
= IndexerHook::class;
}
// Prefill event_begin with current Timestamp
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['formDataGroup']['tcaDatabaseRecord'][InitializeNewEventRecord::class] = [
'depends' => [
DatabaseRowInitializeNew::class,
],
];
// Set rootUid of category trees in FlexForms to values of extension configuration
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['formDataGroup']['flexFormSegment'][ModifyRootUidOfTreeSelectElements::class] = [
'depends' => [
TcaSelectItems::class,
],
];
$GLOBALS['TYPO3_CONF_VARS']['LOG']['JWeiland']['Events2']['writerConfiguration'] = [
LogLevel::WARNING => [
FileWriter::class => [
'logFileInfix' => 'events2',
],
],
];
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['events2UpdateSlug']
= EventsSlugUpgrade::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['events2MigrateOrganizer']
= MigrateOrganizerToMMUpgrade::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['events2MigrateDetailInformations']
= MigrateDetailInformationsUpgrade::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['events2MoveFlexFormFields']
= MoveOldFlexFormSettingsUpgrade::class;
});