Repository navigation
Expand file tree
/
Copy pathext_localconf.php
More file actions
119 lines (108 loc) · 4.29 KB
/
Copy pathext_localconf.php
File metadata and controls
119 lines (108 loc) · 4.29 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
<?php
declare(strict_types=1);
use T3\PwComments\Controller\CommentController;
use T3\PwComments\Hooks\ProcessDatamap;
use T3\PwComments\UserFunc\TCA\AiModerationControl;
use TYPO3\CMS\Core\Log\LogLevel;
use TYPO3\CMS\Core\Log\Writer\FileWriter;
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;
/* | This extension is made for TYPO3 CMS and is licensed
* | under GNU General Public License.
* |
* | (c) 2011-2022 Armin Vieweg <armin@v.ieweg.de>
* | 2015 Dennis Roemmich <dennis@roemmich.eu>
* | 2016-2017 Christian Wolfram <c.wolfram@chriwo.de>
* | 2023 Malek Olabi <m.olabi@neusta.de>
*/
if (!defined('TYPO3')) {
die('Access denied.');
}
(static function ($extensionKey): void {
ExtensionUtility::configurePlugin(
$extensionKey,
'show',
[
CommentController::class => 'index,upvote,downvote',
],
[
CommentController::class => 'index,upvote,downvote',
],
);
ExtensionUtility::configurePlugin(
$extensionKey,
'new',
[
CommentController::class => 'new,create,confirmComment',
],
[
CommentController::class => 'new,create,confirmComment',
],
);
ExtensionUtility::configurePlugin(
$extensionKey,
'Pi2',
[
CommentController::class => 'sendAuthorMailWhenCommentHasBeenApproved',
],
[
CommentController::class => 'sendAuthorMailWhenCommentHasBeenApproved',
],
);
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions']['PwComments']['modules']
= $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions']['PwComments']['plugins'];
$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'] = array_merge(
$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'],
[
'tx_pwcomments_show',
'tx_pwcomments_show[controller]',
'tx_pwcomments_show[action]',
'tx_pwcomments_show[comment]',
'tx_pwcomments_show[commentToReplyTo]',
'tx_pwcomments_show[hash]',
'tx_pwcomments_show[__referrer][@extension]',
'tx_pwcomments_show[__referrer][@vendor]',
'tx_pwcomments_show[__referrer][@controller]',
'tx_pwcomments_show[__referrer][@action]',
'tx_pwcomments_show[__referrer][arguments]',
'tx_pwcomments_show[__referrer][@request]',
'tx_pwcomments_show[__trustedProperties]',
'tx_pwcomments_show[newComment][authorName]',
'tx_pwcomments_show[newComment][authorMail]',
'tx_pwcomments_show[authorWebsite]',
'tx_pwcomments_show[newComment][message]',
'tx_pwcomments_show[newComment][parentComment][__identity]',
'tx_pwcomments_new',
'tx_pwcomments_new[controller]',
'tx_pwcomments_new[action]',
'tx_pwcomments_new[comment]',
'tx_pwcomments_new[commentToReplyTo]',
'tx_pwcomments_new[hash]',
'tx_pwcomments_new[__referrer][@extension]',
'tx_pwcomments_new[__referrer][@vendor]',
'tx_pwcomments_new[__referrer][@controller]',
'tx_pwcomments_new[__referrer][@action]',
'tx_pwcomments_new[__referrer][arguments]',
'tx_pwcomments_new[__referrer][@request]',
'tx_pwcomments_new[__trustedProperties]',
'tx_pwcomments_new[newComment][authorName]',
'tx_pwcomments_new[newComment][authorMail]',
'tx_pwcomments_new[authorWebsite]',
'tx_pwcomments_new[newComment][message]',
'tx_pwcomments_new[newComment][parentComment][__identity]',
],
);
// After save hook
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][]
= ProcessDatamap::class;
$GLOBALS['TYPO3_CONF_VARS']['LOG']['pw_comments']['writerConfiguration'] = [
LogLevel::INFO => [
FileWriter::class => [],
],
];
// Register AI Moderation TCA control
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1671899200] = [
'nodeName' => 'aiModerationControl',
'priority' => 40,
'class' => AiModerationControl::class,
];
})('pw_comments');