forked from beechit/fal_securedownload
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ext_localconf.php
122 lines (109 loc) · 5.47 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
<?php
defined('TYPO3_MODE') or die();
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'BeechIt.FalSecuredownload',
'Filetree',
[
'FileTree' => 'tree',
],
// non-cacheable actions
[
'FileTree' => 'tree',
]
);
// FE FileTree leaf open/close state dispatcher
$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['FalSecuredownloadFileTreeState'] =
'EXT:fal_securedownload/Resources/Public/Php/FileTreeState.php';
// FileDumpEID hook
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['FileDumpEID.php']['checkFileAccess']['FalSecuredownload'] =
\BeechIt\FalSecuredownload\Hooks\FileDumpHook::class;
if (TYPO3_MODE === 'BE') {
/** @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher */
$signalSlotDispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class);
// Public url rendering in BE context
if (!(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI)) {
$signalSlotDispatcher->connect(
\TYPO3\CMS\Core\Resource\ResourceStorage::class,
\TYPO3\CMS\Core\Resource\ResourceStorage::SIGNAL_PreGeneratePublicUrl,
\BeechIt\FalSecuredownload\Aspects\PublicUrlAspect::class,
'generatePublicUrl'
);
}
// Page module hook
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['list_type_Info']['falsecuredownload_filetree']['fal_securedownload'] =
\BeechIt\FalSecuredownload\Hooks\CmsLayout::class . '->getExtensionSummary';
// Add FolderPermission button to docheader of filelist
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['Backend\Template\Components\ButtonBar']['getButtonsHook']['FalSecuredownload'] =
\BeechIt\FalSecuredownload\Hooks\DocHeaderButtonsHook::class . '->getButtons';
// Context menu
$GLOBALS['TYPO3_CONF_VARS']['BE']['ContextMenu']['ItemProviders'][1547242135]
= \BeechIt\FalSecuredownload\ContextMenu\ItemProvider::class;
// refresh file tree after change in tx_falsecuredownload_folder record
$GLOBALS ['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] =
\BeechIt\FalSecuredownload\Hooks\ProcessDatamapHook::class;
$GLOBALS ['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'][] =
\BeechIt\FalSecuredownload\Hooks\ProcessDatamapHook::class;
$signalSlotDispatcher->connect(
\TYPO3\CMS\Core\Resource\ResourceStorage::class,
\TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PreFolderMove,
\BeechIt\FalSecuredownload\Hooks\FolderChangedSlot::class,
'preFolderMove'
);
$signalSlotDispatcher->connect(
\TYPO3\CMS\Core\Resource\ResourceStorage::class,
\TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PostFolderMove,
\BeechIt\FalSecuredownload\Hooks\FolderChangedSlot::class,
'postFolderMove'
);
$signalSlotDispatcher->connect(
\TYPO3\CMS\Core\Resource\ResourceStorage::class,
\TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PreFolderDelete,
\BeechIt\FalSecuredownload\Hooks\FolderChangedSlot::class,
'preFolderDelete'
);
$signalSlotDispatcher->connect(
\TYPO3\CMS\Core\Resource\ResourceStorage::class,
\TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PostFolderDelete,
\BeechIt\FalSecuredownload\Hooks\FolderChangedSlot::class,
'postFolderDelete'
);
$signalSlotDispatcher->connect(
\TYPO3\CMS\Core\Resource\ResourceStorage::class,
\TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PreFolderRename,
\BeechIt\FalSecuredownload\Hooks\FolderChangedSlot::class,
'preFolderRename'
);
$signalSlotDispatcher->connect(
\TYPO3\CMS\Core\Resource\ResourceStorage::class,
\TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PostFolderRename,
\BeechIt\FalSecuredownload\Hooks\FolderChangedSlot::class,
'postFolderRename'
);
// File tree icon adjustments for TYPO3 => 7.5
$signalSlotDispatcher->connect(
\TYPO3\CMS\Core\Imaging\IconFactory::class,
'buildIconForResourceSignal',
\BeechIt\FalSecuredownload\Aspects\IconFactoryAspect::class,
'buildIconForResource'
);
// ext:ke_search custom indexer hook
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyFileIndexEntryFromContentIndexer'][] = \BeechIt\FalSecuredownload\Hooks\KeSearchFilesHook::class;
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyFileIndexEntry'][] = \BeechIt\FalSecuredownload\Hooks\KeSearchFilesHook::class;
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('solrfal')) {
// ext:solrfal enrich metadata and generate correct public url slot
$signalSlotDispatcher->connect(
\ApacheSolrForTypo3\Solrfal\Indexing\DocumentFactory::class,
'fileMetaDataRetrieved',
\BeechIt\FalSecuredownload\Aspects\SolrFalAspect::class,
'fileMetaDataRetrieved'
);
}
if (\BeechIt\FalSecuredownload\Configuration\ExtensionConfiguration::trackDownloads()) {
// register FormEngine node for rendering download statistics in fe_users
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1470920616] = [
'nodeName' => 'falSecureDownloadStats',
'priority' => 40,
'class' => \BeechIt\FalSecuredownload\FormEngine\DownloadStatistics::class,
];
}
}