forked from teamneusta/pw_comments
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathext_localconf.php
More file actions
128 lines (119 loc) · 4.85 KB
/
ext_localconf.php
File metadata and controls
128 lines (119 loc) · 4.85 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
<?php
declare(strict_types=1);
use T3\PwComments\Hooks\ProcessDatamap;
use T3\PwComments\UserFunc\TCA\AiModerationControl;
use TYPO3\CMS\Backend\Controller\PageLayoutController;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;
use T3\PwComments\Controller\CommentController;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
use TYPO3\CMS\Core\Imaging\IconRegistry;
use TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider;
use TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider;
use TYPO3\CMS\Core\Log\LogLevel;
use TYPO3\CMS\Core\Log\Writer\FileWriter;
use T3\PwComments\Event\Listener\PageLayoutView;
/* | 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::PLUGIN_TYPE_CONTENT_ELEMENT
);
ExtensionUtility::configurePlugin(
$extensionKey,
'new',
[
CommentController::class => 'new,create,confirmComment',
],
[
CommentController::class => 'new,create,confirmComment',
],
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
);
ExtensionUtility::configurePlugin(
$extensionKey,
'Pi2',
[
CommentController::class => 'sendAuthorMailWhenCommentHasBeenApproved',
],
[
CommentController::class => 'sendAuthorMailWhenCommentHasBeenApproved',
],
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
);
$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');