-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathext_localconf.php
172 lines (146 loc) · 7.53 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
<?php
defined('TYPO3_MODE') || die();
$boot = function ($packageKey) {
$conf = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
\TYPO3\CMS\Core\Configuration\ExtensionConfiguration::class
)->get($packageKey);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'MiniFranske.' . $packageKey,
'Mediagallery',
[
'MediaAlbum' => 'index,nestedList,flatList,showAlbum,showAlbumByConfig,showAsset,random',
],
// non-cacheable actions
[
'MediaAlbum' => 'random',
]
);
// Page TSConfig
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:' . $packageKey . '/Configuration/TSConfig/Page.ts">');
// Module header bar buttons
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['Backend\Template\Components\ButtonBar']['getButtonsHook']['FsMediaGallery'] =
'MiniFranske\\FsMediaGallery\\Hooks\\DocHeaderButtonsHook->moduleTemplateDocHeaderGetButtons';
// refresh file tree after changen in media album recored (sys_file_collection)
$GLOBALS ['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] =
\MiniFranske\FsMediaGallery\Hooks\ProcessDatamapHook::class;
$GLOBALS ['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'][] =
\MiniFranske\FsMediaGallery\Hooks\ProcessDatamapHook::class;
// EXT:news >= 3.2.0 support
$GLOBALS['TYPO3_CONF_VARS']['EXT']['news']['classes']['Domain/Model/News'][] = $packageKey;
// Page module hook
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['list_type_Info']['fsmediagallery_mediagallery']['fs_media_gallery'] =
'MiniFranske\\FsMediaGallery\\Hooks\\PageLayoutView->getExtensionSummary';
$signalSlotDispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class);
$signalSlotDispatcher->connect(
\TYPO3\CMS\Core\Resource\ResourceStorage::class,
\TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PreFolderMove,
\MiniFranske\FsMediaGallery\Hooks\FolderChangedSlot::class,
'preFolderMove'
);
$signalSlotDispatcher->connect(
\TYPO3\CMS\Core\Resource\ResourceStorage::class,
\TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PostFolderMove,
\MiniFranske\FsMediaGallery\Hooks\FolderChangedSlot::class,
'postFolderMove'
);
$signalSlotDispatcher->connect(
\TYPO3\CMS\Core\Resource\ResourceStorage::class,
\TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PreFolderDelete,
\MiniFranske\FsMediaGallery\Hooks\FolderChangedSlot::class,
'preFolderDelete'
);
$signalSlotDispatcher->connect(
\TYPO3\CMS\Core\Resource\ResourceStorage::class,
\TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PostFolderDelete,
\MiniFranske\FsMediaGallery\Hooks\FolderChangedSlot::class,
'postFolderDelete'
);
$signalSlotDispatcher->connect(
\TYPO3\CMS\Core\Resource\ResourceStorage::class,
\TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PreFolderRename,
\MiniFranske\FsMediaGallery\Hooks\FolderChangedSlot::class,
'preFolderRename'
);
$signalSlotDispatcher->connect(
\TYPO3\CMS\Core\Resource\ResourceStorage::class,
\TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PostFolderRename,
\MiniFranske\FsMediaGallery\Hooks\FolderChangedSlot::class,
'postFolderRename'
);
// *** Register file signals to clear the cache when enabled in extension setteings ***
if (!empty($conf['clearCacheAfterFileChange']) && $conf['clearCacheAfterFileChange']) {
$signalSlotDispatcher->connect(
\TYPO3\CMS\Core\Resource\ResourceStorage::class,
\TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PostFileAdd,
\MiniFranske\FsMediaGallery\Hooks\FileChangedSlot::class,
'postFileAdd'
);
$signalSlotDispatcher->connect(
\TYPO3\CMS\Core\Resource\ResourceStorage::class,
\TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PostFileCreate,
\MiniFranske\FsMediaGallery\Hooks\FileChangedSlot::class,
'postFileCreate'
);
$signalSlotDispatcher->connect(
\TYPO3\CMS\Core\Resource\ResourceStorage::class,
\TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PostFileCopy,
\MiniFranske\FsMediaGallery\Hooks\FileChangedSlot::class,
'postFileCopy'
);
$signalSlotDispatcher->connect(
\TYPO3\CMS\Core\Resource\ResourceStorage::class,
\TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PostFileMove,
\MiniFranske\FsMediaGallery\Hooks\FileChangedSlot::class,
'postFileMove'
);
$signalSlotDispatcher->connect(
\TYPO3\CMS\Core\Resource\ResourceStorage::class,
\TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PostFileDelete,
\MiniFranske\FsMediaGallery\Hooks\FileChangedSlot::class,
'postFileDelete'
);
$signalSlotDispatcher->connect(
\TYPO3\CMS\Core\Resource\ResourceStorage::class,
\TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PostFileRename,
\MiniFranske\FsMediaGallery\Hooks\FileChangedSlot::class,
'postFileRename'
);
$signalSlotDispatcher->connect(
\TYPO3\CMS\Core\Resource\ResourceStorage::class,
\TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PostFileReplace,
\MiniFranske\FsMediaGallery\Hooks\FileChangedSlot::class,
'postFileReplace'
);
}
if (!empty($conf['enableAutoCreateFileCollection']) && $conf['enableAutoCreateFileCollection']) {
$signalSlotDispatcher->connect(
\TYPO3\CMS\Core\Resource\ResourceStorage::class,
\TYPO3\CMS\Core\Resource\ResourceStorageInterface::SIGNAL_PostFolderAdd,
\MiniFranske\FsMediaGallery\Hooks\FolderChangedSlot::class,
'postFolderAdd'
);
}
// File tree icon adjustments
$signalSlotDispatcher->connect(
\TYPO3\CMS\Core\Imaging\IconFactory::class,
'buildIconForResourceSignal',
\MiniFranske\FsMediaGallery\Hooks\IconFactory::class,
'buildIconForResource'
);
if (TYPO3_MODE === 'BE') {
$GLOBALS['TYPO3_CONF_VARS']['BE']['ContextMenu']['ItemProviders'][1547740001] = \MiniFranske\FsMediaGallery\ContextMenu\ItemProviders\FsMediaGalleryProvider::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/backend.php']['constructPostProcess'][] = \MiniFranske\FsMediaGallery\Hooks\BackendControllerHook::class . '->addJavaScript';
$signalSlotDispatcher->connect(
'TYPO3\\CMS\\Install\\Service\\SqlExpectedSchemaService',
'tablesDefinitionIsBeingBuilt',
\MiniFranske\FsMediaGallery\Hooks\Install::class,
'tablesDefinitionIsBeingBuiltSlot'
);
}
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['realurlAliasMediaAlbumsSlug']
= \MiniFranske\FsMediaGallery\Updates\RealurlAliasMediaAlbumsSlug::class; // Recommended before 'populateMedialAlbumsSlug'
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['populateMedialAlbumsSlug']
= \MiniFranske\FsMediaGallery\Updates\PopulateMedialAlbumsSlug::class;
};
$boot('fs_media_gallery');
unset($boot);