-
Notifications
You must be signed in to change notification settings - Fork 17
/
ext_localconf.php
165 lines (150 loc) · 6.1 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
<?php
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
use T3docs\Examples\Controller\ErrorController;
use T3docs\Examples\Controller\FalExampleController;
use T3docs\Examples\Controller\HtmlParserController;
use T3docs\Examples\Form\Element\SpecialFieldElement;
use T3docs\Examples\LinkHandler\GithubLinkBuilder;
use T3docs\Examples\LinkHandler\GitHubLinkHandling;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Log\LogLevel;
use TYPO3\CMS\Core\Log\Processor\MemoryUsageProcessor;
use TYPO3\CMS\Core\Log\Writer\DatabaseWriter;
use TYPO3\CMS\Core\Log\Writer\FileWriter;
use TYPO3\CMS\Core\Log\Writer\SyslogWriter;
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
defined('TYPO3') or die();
// encapsulate all locally defined variables
(function () {
// Load XCLASSing of db_new
// USAGE: Core APIs > TYPO3 API overview > PHP Class Extension > Which classes? > Example - Adding a small feature in the interface
/*
// Disabled, @see #60
// @TODO: 1) find new case for an xclass, 2) remove old xclass, 3) add new xclass
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Backend\Controller\NewRecordController::class] = [
'className' => \T3docs\Examples\Xclass\NewRecordController::class,
];
*/
// Define custom permission options
// USAGE: Core APIs > TYPO3 API overview > Various examples > Custom permission
$GLOBALS['TYPO3_CONF_VARS']['BE']['customPermOptions'] = [
'tx_examples_cat1' => [
'header' => 'LLL:EXT:examples/Resources/Private/Language/locallang.xlf:permissions_header',
'items' => [
'key1' => [
'LLL:EXT:examples/Resources/Private/Language/locallang.xlf:permissions_option1',
'actions-system-typoscript-documentation-open',
'LLL:EXT:examples/Resources/Private/Language/locallang.xlf:permissions_option1_description',
],
'key2' => ['LLL:EXT:examples/Resources/Private/Language/locallang.xlf:permissions_option2'],
'key3' => ['LLL:EXT:examples/Resources/Private/Language/locallang.xlf:permissions_option3'],
],
],
];
// Register a node in ext_localconf.php
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1609888016] = [
'nodeName' => 'specialField',
'priority' => 40,
'class' => SpecialFieldElement::class,
];
$GLOBALS['TYPO3_CONF_VARS']['FE']['typolinkBuilder']['github'] =
GithubLinkBuilder::class;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['linkHandler']['github'] =
GitHubLinkHandling::class;
// Add example configuration for the logging API
$GLOBALS['TYPO3_CONF_VARS']['LOG']['T3docs']['Examples']['Controller']['writerConfiguration'] = [
// configuration for ERROR level log entries
LogLevel::ERROR => [
// add a FileWriter
FileWriter::class => [
// configuration for the writer
'logFile' => Environment::getVarPath() . '/log/typo3_examples.log',
],
],
];
$GLOBALS['TYPO3_CONF_VARS']['LOG']['T3docs']['Examples']['Controller']['writerConfiguration'][LogLevel::DEBUG] = [
DatabaseWriter::class => [
'logTable' => 'tx_examples_log',
],
];
$GLOBALS['TYPO3_CONF_VARS']['LOG']['T3docs']['Examples']['Controller']['writerConfiguration'][LogLevel::WARNING] = [
// configuration for WARNING severity, including all
// levels with higher severity (ERROR, CRITICAL, EMERGENCY)
// add a SyslogWriter
SyslogWriter::class => [],
];
$GLOBALS['TYPO3_CONF_VARS']['LOG']['T3docs']['Examples']['Controller']['processorConfiguration'] = [
// configuration for ERROR level log entries
LogLevel::ERROR => [
// add a MemoryUsageProcessor
MemoryUsageProcessor::class => [
'formatSize' => true,
],
],
];
// Register the "error " plugin
ExtensionUtility::configurePlugin(
'Examples',
'Error',
[
ErrorController::class => 'index',
],
[
ErrorController::class => 'index',
],
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT,
);
// Configure the HTML parser plugin
ExtensionUtility::configurePlugin(
'Examples',
'HtmlParser',
[
HtmlParserController::class => 'index',
],
[],
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT,
);
// Register the FAL examples plugin
ExtensionUtility::configurePlugin(
'Examples',
'FalExamples',
[
FalExampleController::class => 'index,listFiles,collection',
],
// non-cacheable actions
[
FalExampleController::class => 'index,listFiles,collection',
],
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT,
);
// Add custom translations overriding default labels
$GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride']
['EXT:frontend/Resources/Private/Language/locallang_tca.xlf'][] =
'EXT:examples/Resources/Private/Language/custom.xlf';
$GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride']['de']
['EXT:frontend/Resources/Private/Language/locallang_tca.xlf'][] =
'EXT:examples/Resources/Private/Language/de.custom.xlf';
})();