forked from xperseguers/t3ext-file_list
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ext_localconf.php
103 lines (92 loc) · 4.65 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
<?php
defined('TYPO3_MODE') || die();
$boot = function ($_EXTKEY) {
$typo3Branch = class_exists(\TYPO3\CMS\Core\Information\Typo3Version::class)
? (new \TYPO3\CMS\Core\Information\Typo3Version())->getBranch()
: TYPO3_branch;
if (version_compare($typo3Branch, '10.0', '>=')) {
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
$_EXTKEY,
'Filelist',
// cacheable actions
[
\Causal\FileList\Controller\FileController::class => 'list',
],
// non-cacheable actions
[]
);
} else {
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Causal.' . $_EXTKEY,
'Filelist',
// cacheable actions
[
'File' => 'list',
],
// non-cacheable actions
[]
);
}
/** @var \TYPO3\CMS\Core\Imaging\IconRegistry $iconRegistry */
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
$iconRegistry->registerIcon(
'extensions-filelist-wizard',
\TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class,
[
'source' => 'EXT:file_list/Resources/Public/Icons/ce_wizard.png',
]
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
'<INCLUDE_TYPOSCRIPT: source="FILE:EXT:file_list/Configuration/TsConfig/Page/Mod/Wizards/NewContentElement.tsconfig">'
);
/* ===========================================================================
Web > Page hook
=========================================================================== */
$extensionName = \TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToUpperCamelCase($_EXTKEY);
$pluginSignature = strtolower($extensionName) . '_filelist';
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['list_type_Info'][$pluginSignature][$_EXTKEY] =
\Causal\FileList\Hooks\PageLayoutView::class . '->getExtensionSummary';
if (version_compare($typo3Branch, '10.2', '<')) {
/** @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher */
$signalSlotDispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class);
$listenSignals = [
\TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PostFileAdd,
\TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PostFileCopy,
\TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PostFileMove,
\TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PostFileRename,
\TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PostFileReplace,
\TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PostFileCreate,
\TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PostFileDelete,
\TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PostFileSetContents,
\TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PostFolderAdd,
\TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PostFolderCopy,
\TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PostFolderMove,
\TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PostFolderRename,
\TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PostFolderDelete,
];
foreach ($listenSignals as $signal) {
$signalSlotDispatcher->connect(
'TYPO3\\CMS\\Core\\Resource\\ResourceStorage',
$signal,
\Causal\FileList\Slots\ResourceStorage::class,
$signal
);
}
}
/* ===========================================================================
Register default template layouts
=========================================================================== */
$GLOBALS['TYPO3_CONF_VARS']['EXT']['file_list']['templateLayouts'][] = [
'LLL:EXT:file_list/Resources/Private/Language/locallang_flexform.xlf:filelist.templateLayout.simple',
'Simple',
];
$GLOBALS['TYPO3_CONF_VARS']['EXT']['file_list']['templateLayouts'][] = [
'LLL:EXT:file_list/Resources/Private/Language/locallang_flexform.xlf:filelist.templateLayout.thumbnailDescription',
'ThumbnailDescription',
];
if (TYPO3_MODE === 'BE') {
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][$_EXTKEY] = \Causal\FileList\Hooks\DataHandler::class;
}
};
$boot('file_list');
unset($boot);