forked from georgringer/news
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ext_localconf.php
173 lines (150 loc) · 8.78 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
<?php
defined('TYPO3_MODE') or die();
$boot = function () {
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'GeorgRinger.news',
'Pi1',
[
'News' => 'list,detail,selectedList,dateMenu,searchForm,searchResult',
'Category' => 'list',
'Tag' => 'list',
],
[
'News' => 'searchForm,searchResult',
]
);
// Page module hook
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['list_type_Info']['news' . '_pi1']['news'] =
\GeorgRinger\News\Hooks\PageLayoutView::class . '->getExtensionSummary';
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc']['news_clearcache'] =
\GeorgRinger\News\Hooks\DataHandler::class . '->clearCachePostProc';
// Edit restriction for news records
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass']['news'] =
\GeorgRinger\News\Hooks\DataHandler::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']['news'] =
\GeorgRinger\News\Hooks\DataHandler::class;
// Modify flexform values
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['getFlexFormDSClass']['news'] =
\GeorgRinger\News\Hooks\BackendUtility::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::class]['flexParsing']['news']
= \GeorgRinger\News\Hooks\BackendUtility::class;
// Modify flexform fields since core 8.5 via formEngine: Inject a data provider between TcaFlexPrepare and TcaFlexProcess
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['formDataGroup']['tcaDatabaseRecord'][\GeorgRinger\News\Backend\FormDataProvider\NewsFlexFormManipulation::class] = [
'depends' => [
\TYPO3\CMS\Backend\Form\FormDataProvider\TcaFlexPrepare::class,
],
'before' => [
\TYPO3\CMS\Backend\Form\FormDataProvider\TcaFlexProcess::class,
],
];
// Hide content elements in page module & filter in administration module
if (\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) >= 9002000) {
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList::class]['modifyQuery'][]
= \GeorgRinger\News\Hooks\Backend\RecordListQueryHook::class;
} else {
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList::class]['buildQueryParameters'][]
= \GeorgRinger\News\Hooks\Backend\RecordListQueryHook::class;
}
// Inline records hook
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tceforms_inline.php']['tceformsInlineHook']['news'] =
\GeorgRinger\News\Hooks\InlineElementHook::class;
// Xclass InlineRecordContainer
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Backend\Form\Container\InlineRecordContainer::class] = [
'className' => \GeorgRinger\News\Xclass\InlineRecordContainerForNews::class,
];
/* ===========================================================================
Custom cache, done with the caching framework
=========================================================================== */
if (empty($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_news_category'])) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_news_category'] = [];
}
// Define string frontend as default frontend, this must be set with TYPO3 4.5 and below
// and overrides the default variable frontend of 4.6
if (!isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_news_category']['frontend'])) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_news_category']['frontend'] = \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class;
}
/* ===========================================================================
Add TSconfig
=========================================================================== */
// For linkvalidator
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('linkvalidator')) {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:news/Configuration/TSconfig/Page/mod.linkvalidator.txt">');
}
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('guide')) {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(' <INCLUDE_TYPOSCRIPT: source="DIR:EXT:news/Configuration/TSconfig/Tours" extensions="ts">');
}
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('
<INCLUDE_TYPOSCRIPT: source="FILE:EXT:news/Configuration/TSconfig/ContentElementWizard.txt">
<INCLUDE_TYPOSCRIPT: source="FILE:EXT:news/Configuration/TSconfig/Administration.txt">
');
/* ===========================================================================
Hooks
=========================================================================== */
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('realurl')) {
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/realurl/class.tx_realurl_autoconfgen.php']['extensionConfiguration']['news'] =
\GeorgRinger\News\Hooks\RealUrlAutoConfiguration::class . '->addNewsConfig';
}
// Register cache frontend for proxy class generation
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['news'] = [
'frontend' => \TYPO3\CMS\Core\Cache\Frontend\PhpFrontend::class,
'backend' => \TYPO3\CMS\Core\Cache\Backend\FileBackend::class,
'groups' => [
'all',
'system',
],
'options' => [
'defaultLifetime' => 0,
]
];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['formDataGroup']['tcaDatabaseRecord'][\GeorgRinger\News\Backend\FormDataProvider\NewsRowInitializeNew::class] = [
'depends' => [
\TYPO3\CMS\Backend\Form\FormDataProvider\DatabaseRowInitializeNew::class,
]
];
\GeorgRinger\News\Utility\ClassLoader::registerAutoloader();
if (TYPO3_MODE === 'BE') {
$icons = [
'apps-pagetree-folder-contains-news' => 'ext-news-folder-tree.svg',
'ext-news-wizard-icon' => 'plugin_wizard.svg',
'ext-news-type-default' => 'news_domain_model_news.svg',
'ext-news-type-internal' => 'news_domain_model_news_internal.svg',
'ext-news-type-external' => 'news_domain_model_news_external.svg',
'ext-news-tag' => 'news_domain_model_tag.svg',
'ext-news-link' => 'news_domain_model_link.svg',
'ext-news-donation' => 'donation.svg',
'ext-news-paypal' => 'donation_paypal.svg',
'ext-news-patreon' => 'donation_patreon.svg',
'ext-news-amazon' => 'donation_amazon.svg',
];
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
foreach ($icons as $identifier => $path) {
$iconRegistry->registerIcon(
$identifier,
\TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
['source' => 'EXT:news/Resources/Public/Icons/' . $path]
);
}
}
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('dd_googlesitemap')) {
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['dd_googlesitemap']['sitemap']['txnews']
= \GeorgRinger\News\Hooks\TxNewsSitemapGenerator::class . '->main';
}
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['extbase']['commandControllers'][] = \GeorgRinger\News\Command\NewsImportCommandController::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['realurlAliasNewsSlug']
= \GeorgRinger\News\Updates\RealurlAliasNewsSlugUpdater::class; // Recommended before 'newsSlug'
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['newsSlug']
= \GeorgRinger\News\Updates\NewsSlugUpdater::class;
if (version_compare(TYPO3_branch, '9.5', '>=')) {
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['sysCategorySlugs']
= \GeorgRinger\News\Updates\PopulateCategorySlugs::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['txNewsTagSlugs']
= \GeorgRinger\News\Updates\PopulateTagSlugs::class;
}
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1552726986] = [
'nodeName' => 'NewsStaticText',
'priority' => 70,
'class' => \GeorgRinger\News\Backend\FieldInformation\StaticText::class
];
};
$boot();
unset($boot);