forked from jweiland-net/events2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathext_localconf.php
More file actions
179 lines (161 loc) · 6.58 KB
/
Copy pathext_localconf.php
File metadata and controls
179 lines (161 loc) · 6.58 KB
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
179
<?php
/*
* This file is part of the package jweiland/events2.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
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\Hook\Events2DataHandler;
use JWeiland\Events2\Hook\Form\PrefillCategoriesHook;
use JWeiland\Events2\Hook\Form\PrefillForEditUsageHook;
use JWeiland\Events2\Hook\Solr\IndexerHook;
use JWeiland\Events2\Hook\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 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;
ExtensionUtility::configurePlugin(
'Events2',
'List',
[
DayController::class => 'list, show',
LocationController::class => 'show',
VideoController::class => 'show',
ICalController::class => 'download',
],
[],
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT,
);
ExtensionUtility::configurePlugin(
'Events2',
'Show',
[
DayController::class => 'show',
LocationController::class => 'show',
VideoController::class => 'show',
ICalController::class => 'download',
],
[],
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT,
);
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::PLUGIN_TYPE_CONTENT_ELEMENT,
);
ExtensionUtility::configurePlugin(
'Events2',
'Calendar',
[
CalendarController::class => 'show',
],
[],
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT,
);
ExtensionUtility::configurePlugin(
'Events2',
'SearchForm',
[
SearchController::class => 'show',
],
// Needs to be uncached, to show dynamic search values again after reload.
[
SearchController::class => 'show',
],
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT,
);
ExtensionUtility::configurePlugin(
'Events2',
'SearchResults',
[
SearchController::class => 'listSearchResults',
],
// needs to be uncached to show fresh search results
[
SearchController::class => 'listSearchResults',
],
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT,
);
// 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'] = Events2DataHandler::class;
// Clear the cache of pages with events if the event was edited/created/deleted in BE
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc']['events2_clearcache'] = Events2DataHandler::class . '->clearCachePostProc';
// Prefill EXT:form element of type Checkboxes with categories from a 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 the 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',
],
],
];