@@ -3,14 +3,14 @@ discard block |
||
3 | 3 | |
4 | 4 | call_user_func(function () { |
5 | 5 | |
6 | - if (TYPO3_MODE === 'BE') { |
|
6 | + if (TYPO3_MODE === 'BE') { |
|
7 | 7 | |
8 | - $configuration = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
9 | - \TYPO3\CMS\Core\Configuration\ExtensionConfiguration::class |
|
10 | - )->get('media'); |
|
8 | + $configuration = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
9 | + \TYPO3\CMS\Core\Configuration\ExtensionConfiguration::class |
|
10 | + )->get('media'); |
|
11 | 11 | |
12 | - // Default User TSConfig to be added in any case. |
|
13 | - TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig(' |
|
12 | + // Default User TSConfig to be added in any case. |
|
13 | + TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig(' |
|
14 | 14 | |
15 | 15 | # Enable or disabled the Media File Picker in the BE |
16 | 16 | options.vidi.enableMediaFilePicker = 1 |
@@ -20,149 +20,149 @@ discard block |
||
20 | 20 | |
21 | 21 | '); |
22 | 22 | |
23 | - $moduleFileLanguage = 'LLL:EXT:media/Resources/Private/Language/locallang.xlf'; |
|
24 | - if ($configuration['hide_file_list'] == 1) { |
|
23 | + $moduleFileLanguage = 'LLL:EXT:media/Resources/Private/Language/locallang.xlf'; |
|
24 | + if ($configuration['hide_file_list'] == 1) { |
|
25 | 25 | |
26 | - $moduleFileLanguage = 'LLL:EXT:media/Resources/Private/Language/locallang_filelist.xlf'; |
|
26 | + $moduleFileLanguage = 'LLL:EXT:media/Resources/Private/Language/locallang_filelist.xlf'; |
|
27 | 27 | |
28 | - // Default User TSConfig to be added in any case. |
|
29 | - TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig(' |
|
28 | + // Default User TSConfig to be added in any case. |
|
29 | + TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig(' |
|
30 | 30 | |
31 | 31 | # Hide default File List |
32 | 32 | options.hideModules.file := addToList(FilelistList) |
33 | 33 | '); |
34 | - } |
|
35 | - |
|
36 | - \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule( |
|
37 | - 'Fab.media', |
|
38 | - 'user', // Make media module a submodule of 'user' |
|
39 | - 'm1', |
|
40 | - 'bottom', // Position |
|
41 | - [ |
|
42 | - 'Asset' => 'create, update, download, editStorage', |
|
43 | - 'ImageEditor' => 'show', |
|
44 | - 'LinkCreator' => 'show', |
|
45 | - 'ProcessedFile' => 'create', |
|
46 | - ], |
|
47 | - [ |
|
48 | - 'access' => 'user,group', |
|
49 | - 'icon' => 'EXT:media/Resources/Public/Icons/Extension.svg', |
|
50 | - 'labels' => 'LLL:EXT:media/Resources/Private/Language/locallang_module.xlf', |
|
51 | - ] |
|
52 | - ); |
|
53 | - |
|
54 | - $defaultMainModule = (bool)$configuration['has_folder_tree'] ? 'file' : 'content'; |
|
55 | - |
|
56 | - /** @var \Fab\Vidi\Module\ModuleLoader $moduleLoader */ |
|
57 | - $moduleLoader = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
58 | - \Fab\Vidi\Module\ModuleLoader::class, |
|
59 | - 'sys_file' |
|
60 | - ); |
|
61 | - $moduleLoader->setIcon('EXT:media/Resources/Public/Icons/Extension.svg') |
|
62 | - ->setModuleLanguageFile($moduleFileLanguage) |
|
63 | - ->setMainModule($defaultMainModule) |
|
64 | - ->addJavaScriptFiles([ |
|
65 | - 'EXT:media/Resources/Public/Libraries/Fineuploader/jquery.fineuploader-5.0.9.min.js', |
|
66 | - ]) |
|
67 | - ->addStyleSheetFiles([ |
|
68 | - 'EXT:media/Resources/Public/StyleSheets/media.css', |
|
69 | - 'EXT:media/Resources/Public/StyleSheets/fineuploader.css', |
|
70 | - ]) |
|
71 | - ->setDocHeaderTopLeftComponents([ |
|
72 | - \Fab\Media\View\Menu\StorageMenu::class, |
|
73 | - \Fab\Media\View\Checkbox\RecursiveCheckbox::class,] |
|
74 | - ) |
|
75 | - ->setDocHeaderBottomLeftComponents([ |
|
76 | - \Fab\Vidi\View\Button\ClipboardButton::class, |
|
77 | - \Fab\Media\View\Button\NewFolder::class, |
|
78 | - \Fab\Media\View\Button\UploadButton::class, |
|
79 | - ]) |
|
80 | - ->setGridTopComponents([ |
|
81 | - \Fab\Media\View\InlineJavaScript::class, |
|
82 | - \Fab\Media\View\Warning\ConfigurationWarning::class, |
|
83 | - \Fab\Media\View\Info\SelectedFolderInfo::class, |
|
84 | - ]) |
|
85 | - ->setGridBottomComponents([ |
|
86 | - \Fab\Media\View\Plugin\LinkCreatorPlugin::class, |
|
87 | - \Fab\Media\View\Plugin\ImageEditorPlugin::class, |
|
88 | - \Fab\Media\View\Plugin\FilePickerPlugin::class, |
|
89 | - ]) |
|
90 | - ->setGridButtonsComponents([ |
|
91 | - \Fab\Media\View\Button\LinkCreatorButton::class, |
|
92 | - \Fab\Media\View\Button\ImageEditorButton::class, |
|
93 | - \Fab\Media\View\Button\FilePickerButton::class, |
|
94 | - \Fab\Media\View\Button\EditButton::class, |
|
95 | - \Fab\Media\View\Button\DownloadButton::class, |
|
96 | - \Fab\Media\View\Button\DeleteButton::class, |
|
97 | - ]) |
|
98 | - ->setMenuMassActionComponents([ |
|
99 | - \Fab\Vidi\View\MenuItem\ExportXlsMenuItem::class, |
|
100 | - \Fab\Vidi\View\MenuItem\ExportXmlMenuItem::class, |
|
101 | - \Fab\Vidi\View\MenuItem\ExportCsvMenuItem::class, |
|
102 | - \Fab\Vidi\View\MenuItem\DividerMenuItem::class, |
|
103 | - |
|
104 | - // Media custom View Helper |
|
105 | - \Fab\Vidi\View\MenuItem\ClipboardMenuItem::class, |
|
106 | - \Fab\Media\View\MenuItem\FilePickerMenuItem::class, |
|
107 | - \Fab\Media\View\MenuItem\ChangeStorageMenuItem::class, |
|
108 | - \Fab\Vidi\View\MenuItem\MassDeleteMenuItem::class, |
|
109 | - ]) |
|
110 | - ->register(); |
|
111 | - |
|
112 | - /** @var \TYPO3\CMS\Extbase\Object\ObjectManager $objectManager */ |
|
113 | - $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class); |
|
114 | - |
|
115 | - /** @var $signalSlotDispatcher \TYPO3\CMS\Extbase\SignalSlot\Dispatcher */ |
|
116 | - $signalSlotDispatcher = $objectManager->get(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class); |
|
117 | - |
|
118 | - # Register some tool for Media. |
|
119 | - \Fab\Vidi\Tool\ToolRegistry::getInstance()->register('sys_file', \Fab\Media\Tool\ThumbnailGeneratorTool::class); |
|
120 | - \Fab\Vidi\Tool\ToolRegistry::getInstance()->register('sys_file', \Fab\Media\Tool\CacheWarmUpTool::class); |
|
121 | - \Fab\Vidi\Tool\ToolRegistry::getInstance()->register('sys_file', \Fab\Media\Tool\MissingFilesFinderTool::class); |
|
122 | - \Fab\Vidi\Tool\ToolRegistry::getInstance()->register('sys_file', \Fab\Media\Tool\DuplicateRecordsFinderTool::class); |
|
123 | - \Fab\Vidi\Tool\ToolRegistry::getInstance()->register('sys_file', \Fab\Media\Tool\DuplicateFilesFinderTool::class); |
|
124 | - |
|
125 | - // Connect some signals with slots. |
|
126 | - $signalSlotDispatcher->connect( |
|
127 | - 'Fab\Vidi\Controller\Backend\ContentController', // Small exception in naming here as the class was previously located in "Controller\Backend". |
|
128 | - 'postProcessMatcherObject', |
|
129 | - \Fab\Media\Security\FilePermissionsAspect::class, |
|
130 | - 'addFilePermissionsForFileStorages' |
|
131 | - ); |
|
132 | - |
|
133 | - $signalSlotDispatcher->connect( |
|
134 | - \Fab\Vidi\Domain\Repository\ContentRepository::class, |
|
135 | - 'postProcessConstraintsObject', |
|
136 | - \Fab\Media\Security\FilePermissionsAspect::class, |
|
137 | - 'addFilePermissionsForFileMounts' |
|
138 | - ); |
|
139 | - |
|
140 | - $signalSlotDispatcher->connect( |
|
141 | - \Fab\Vidi\Service\ContentService::class, |
|
142 | - 'afterFindContentObjects', |
|
143 | - \Fab\Media\Facet\ActionPermissionFacet::class, |
|
144 | - 'modifyResultSet' |
|
145 | - ); |
|
146 | - } |
|
147 | - |
|
148 | - // Add new sprite icon. |
|
149 | - $icons = [ |
|
150 | - 'image-edit' => 'EXT:media/Resources/Public/Icons/image_edit.png', |
|
151 | - 'image-link' => 'EXT:media/Resources/Public/Icons/image_link.png', |
|
152 | - 'image-export' => 'EXT:media/Resources/Public/Icons/image_export.png', |
|
153 | - 'storage-change' => 'EXT:media/Resources/Public/Icons/folder_go.png', |
|
154 | - ]; |
|
155 | - /** @var \TYPO3\CMS\Core\Imaging\IconRegistry $iconRegistry */ |
|
156 | - $iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class); |
|
157 | - foreach ($icons as $key => $icon) { |
|
158 | - $iconRegistry->registerIcon('extensions-media-' . $key, |
|
159 | - \TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class, |
|
160 | - [ |
|
161 | - 'source' => $icon |
|
162 | - ] |
|
163 | - ); |
|
164 | - } |
|
165 | - unset($iconRegistry); |
|
34 | + } |
|
35 | + |
|
36 | + \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule( |
|
37 | + 'Fab.media', |
|
38 | + 'user', // Make media module a submodule of 'user' |
|
39 | + 'm1', |
|
40 | + 'bottom', // Position |
|
41 | + [ |
|
42 | + 'Asset' => 'create, update, download, editStorage', |
|
43 | + 'ImageEditor' => 'show', |
|
44 | + 'LinkCreator' => 'show', |
|
45 | + 'ProcessedFile' => 'create', |
|
46 | + ], |
|
47 | + [ |
|
48 | + 'access' => 'user,group', |
|
49 | + 'icon' => 'EXT:media/Resources/Public/Icons/Extension.svg', |
|
50 | + 'labels' => 'LLL:EXT:media/Resources/Private/Language/locallang_module.xlf', |
|
51 | + ] |
|
52 | + ); |
|
53 | + |
|
54 | + $defaultMainModule = (bool)$configuration['has_folder_tree'] ? 'file' : 'content'; |
|
55 | + |
|
56 | + /** @var \Fab\Vidi\Module\ModuleLoader $moduleLoader */ |
|
57 | + $moduleLoader = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
58 | + \Fab\Vidi\Module\ModuleLoader::class, |
|
59 | + 'sys_file' |
|
60 | + ); |
|
61 | + $moduleLoader->setIcon('EXT:media/Resources/Public/Icons/Extension.svg') |
|
62 | + ->setModuleLanguageFile($moduleFileLanguage) |
|
63 | + ->setMainModule($defaultMainModule) |
|
64 | + ->addJavaScriptFiles([ |
|
65 | + 'EXT:media/Resources/Public/Libraries/Fineuploader/jquery.fineuploader-5.0.9.min.js', |
|
66 | + ]) |
|
67 | + ->addStyleSheetFiles([ |
|
68 | + 'EXT:media/Resources/Public/StyleSheets/media.css', |
|
69 | + 'EXT:media/Resources/Public/StyleSheets/fineuploader.css', |
|
70 | + ]) |
|
71 | + ->setDocHeaderTopLeftComponents([ |
|
72 | + \Fab\Media\View\Menu\StorageMenu::class, |
|
73 | + \Fab\Media\View\Checkbox\RecursiveCheckbox::class,] |
|
74 | + ) |
|
75 | + ->setDocHeaderBottomLeftComponents([ |
|
76 | + \Fab\Vidi\View\Button\ClipboardButton::class, |
|
77 | + \Fab\Media\View\Button\NewFolder::class, |
|
78 | + \Fab\Media\View\Button\UploadButton::class, |
|
79 | + ]) |
|
80 | + ->setGridTopComponents([ |
|
81 | + \Fab\Media\View\InlineJavaScript::class, |
|
82 | + \Fab\Media\View\Warning\ConfigurationWarning::class, |
|
83 | + \Fab\Media\View\Info\SelectedFolderInfo::class, |
|
84 | + ]) |
|
85 | + ->setGridBottomComponents([ |
|
86 | + \Fab\Media\View\Plugin\LinkCreatorPlugin::class, |
|
87 | + \Fab\Media\View\Plugin\ImageEditorPlugin::class, |
|
88 | + \Fab\Media\View\Plugin\FilePickerPlugin::class, |
|
89 | + ]) |
|
90 | + ->setGridButtonsComponents([ |
|
91 | + \Fab\Media\View\Button\LinkCreatorButton::class, |
|
92 | + \Fab\Media\View\Button\ImageEditorButton::class, |
|
93 | + \Fab\Media\View\Button\FilePickerButton::class, |
|
94 | + \Fab\Media\View\Button\EditButton::class, |
|
95 | + \Fab\Media\View\Button\DownloadButton::class, |
|
96 | + \Fab\Media\View\Button\DeleteButton::class, |
|
97 | + ]) |
|
98 | + ->setMenuMassActionComponents([ |
|
99 | + \Fab\Vidi\View\MenuItem\ExportXlsMenuItem::class, |
|
100 | + \Fab\Vidi\View\MenuItem\ExportXmlMenuItem::class, |
|
101 | + \Fab\Vidi\View\MenuItem\ExportCsvMenuItem::class, |
|
102 | + \Fab\Vidi\View\MenuItem\DividerMenuItem::class, |
|
103 | + |
|
104 | + // Media custom View Helper |
|
105 | + \Fab\Vidi\View\MenuItem\ClipboardMenuItem::class, |
|
106 | + \Fab\Media\View\MenuItem\FilePickerMenuItem::class, |
|
107 | + \Fab\Media\View\MenuItem\ChangeStorageMenuItem::class, |
|
108 | + \Fab\Vidi\View\MenuItem\MassDeleteMenuItem::class, |
|
109 | + ]) |
|
110 | + ->register(); |
|
111 | + |
|
112 | + /** @var \TYPO3\CMS\Extbase\Object\ObjectManager $objectManager */ |
|
113 | + $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class); |
|
114 | + |
|
115 | + /** @var $signalSlotDispatcher \TYPO3\CMS\Extbase\SignalSlot\Dispatcher */ |
|
116 | + $signalSlotDispatcher = $objectManager->get(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class); |
|
117 | + |
|
118 | + # Register some tool for Media. |
|
119 | + \Fab\Vidi\Tool\ToolRegistry::getInstance()->register('sys_file', \Fab\Media\Tool\ThumbnailGeneratorTool::class); |
|
120 | + \Fab\Vidi\Tool\ToolRegistry::getInstance()->register('sys_file', \Fab\Media\Tool\CacheWarmUpTool::class); |
|
121 | + \Fab\Vidi\Tool\ToolRegistry::getInstance()->register('sys_file', \Fab\Media\Tool\MissingFilesFinderTool::class); |
|
122 | + \Fab\Vidi\Tool\ToolRegistry::getInstance()->register('sys_file', \Fab\Media\Tool\DuplicateRecordsFinderTool::class); |
|
123 | + \Fab\Vidi\Tool\ToolRegistry::getInstance()->register('sys_file', \Fab\Media\Tool\DuplicateFilesFinderTool::class); |
|
124 | + |
|
125 | + // Connect some signals with slots. |
|
126 | + $signalSlotDispatcher->connect( |
|
127 | + 'Fab\Vidi\Controller\Backend\ContentController', // Small exception in naming here as the class was previously located in "Controller\Backend". |
|
128 | + 'postProcessMatcherObject', |
|
129 | + \Fab\Media\Security\FilePermissionsAspect::class, |
|
130 | + 'addFilePermissionsForFileStorages' |
|
131 | + ); |
|
132 | + |
|
133 | + $signalSlotDispatcher->connect( |
|
134 | + \Fab\Vidi\Domain\Repository\ContentRepository::class, |
|
135 | + 'postProcessConstraintsObject', |
|
136 | + \Fab\Media\Security\FilePermissionsAspect::class, |
|
137 | + 'addFilePermissionsForFileMounts' |
|
138 | + ); |
|
139 | + |
|
140 | + $signalSlotDispatcher->connect( |
|
141 | + \Fab\Vidi\Service\ContentService::class, |
|
142 | + 'afterFindContentObjects', |
|
143 | + \Fab\Media\Facet\ActionPermissionFacet::class, |
|
144 | + 'modifyResultSet' |
|
145 | + ); |
|
146 | + } |
|
147 | + |
|
148 | + // Add new sprite icon. |
|
149 | + $icons = [ |
|
150 | + 'image-edit' => 'EXT:media/Resources/Public/Icons/image_edit.png', |
|
151 | + 'image-link' => 'EXT:media/Resources/Public/Icons/image_link.png', |
|
152 | + 'image-export' => 'EXT:media/Resources/Public/Icons/image_export.png', |
|
153 | + 'storage-change' => 'EXT:media/Resources/Public/Icons/folder_go.png', |
|
154 | + ]; |
|
155 | + /** @var \TYPO3\CMS\Core\Imaging\IconRegistry $iconRegistry */ |
|
156 | + $iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class); |
|
157 | + foreach ($icons as $key => $icon) { |
|
158 | + $iconRegistry->registerIcon('extensions-media-' . $key, |
|
159 | + \TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class, |
|
160 | + [ |
|
161 | + 'source' => $icon |
|
162 | + ] |
|
163 | + ); |
|
164 | + } |
|
165 | + unset($iconRegistry); |
|
166 | 166 | |
167 | 167 | }); |
168 | 168 |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | defined('TYPO3_MODE') or die(); |
3 | 3 | |
4 | -call_user_func(function () { |
|
4 | +call_user_func(function() { |
|
5 | 5 | |
6 | 6 | if (TYPO3_MODE === 'BE') { |
7 | 7 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | ]) |
71 | 71 | ->setDocHeaderTopLeftComponents([ |
72 | 72 | \Fab\Media\View\Menu\StorageMenu::class, |
73 | - \Fab\Media\View\Checkbox\RecursiveCheckbox::class,] |
|
73 | + \Fab\Media\View\Checkbox\RecursiveCheckbox::class, ] |
|
74 | 74 | ) |
75 | 75 | ->setDocHeaderBottomLeftComponents([ |
76 | 76 | \Fab\Vidi\View\Button\ClipboardButton::class, |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | /** @var \TYPO3\CMS\Core\Imaging\IconRegistry $iconRegistry */ |
156 | 156 | $iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class); |
157 | 157 | foreach ($icons as $key => $icon) { |
158 | - $iconRegistry->registerIcon('extensions-media-' . $key, |
|
158 | + $iconRegistry->registerIcon('extensions-media-'.$key, |
|
159 | 159 | \TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class, |
160 | 160 | [ |
161 | 161 | 'source' => $icon |
@@ -21,59 +21,59 @@ |
||
21 | 21 | class SelectedFolderInfo extends AbstractComponentView |
22 | 22 | { |
23 | 23 | |
24 | - /** |
|
25 | - * @var array |
|
26 | - */ |
|
27 | - public $notAllowedMountPoints = []; |
|
24 | + /** |
|
25 | + * @var array |
|
26 | + */ |
|
27 | + public $notAllowedMountPoints = []; |
|
28 | 28 | |
29 | - /** |
|
30 | - * Renders a button for uploading assets. |
|
31 | - * |
|
32 | - * @return string |
|
33 | - */ |
|
34 | - public function render() |
|
35 | - { |
|
29 | + /** |
|
30 | + * Renders a button for uploading assets. |
|
31 | + * |
|
32 | + * @return string |
|
33 | + */ |
|
34 | + public function render() |
|
35 | + { |
|
36 | 36 | |
37 | - $result = ''; |
|
38 | - if ($this->getMediaModule()->hasFolderTree()) { |
|
37 | + $result = ''; |
|
38 | + if ($this->getMediaModule()->hasFolderTree()) { |
|
39 | 39 | |
40 | - $folder = $this->getMediaModule()->getCurrentFolder(); |
|
41 | - $result = sprintf('<h1>%s</h1>', $this->getFolderName($folder)); |
|
42 | - } |
|
40 | + $folder = $this->getMediaModule()->getCurrentFolder(); |
|
41 | + $result = sprintf('<h1>%s</h1>', $this->getFolderName($folder)); |
|
42 | + } |
|
43 | 43 | |
44 | - return $result; |
|
45 | - } |
|
44 | + return $result; |
|
45 | + } |
|
46 | 46 | |
47 | - /** |
|
48 | - * Get main headline based on active folder or storage for backend module |
|
49 | - * |
|
50 | - * Folder names are resolved to their special names like done in the tree view. |
|
51 | - * |
|
52 | - * @param Folder $folder |
|
53 | - * @return string |
|
54 | - */ |
|
55 | - protected function getFolderName(Folder $folder) |
|
56 | - { |
|
57 | - $name = $folder->getName(); |
|
58 | - if ($name === '') { |
|
59 | - // Show storage name on storage root |
|
60 | - if ($folder->getIdentifier() === '/') { |
|
61 | - $name = $folder->getStorage()->getName(); |
|
62 | - } |
|
63 | - } else { |
|
64 | - $name = key(ListUtility::resolveSpecialFolderNames( |
|
65 | - array($name => $folder) |
|
66 | - )); |
|
67 | - } |
|
68 | - return $name; |
|
69 | - } |
|
47 | + /** |
|
48 | + * Get main headline based on active folder or storage for backend module |
|
49 | + * |
|
50 | + * Folder names are resolved to their special names like done in the tree view. |
|
51 | + * |
|
52 | + * @param Folder $folder |
|
53 | + * @return string |
|
54 | + */ |
|
55 | + protected function getFolderName(Folder $folder) |
|
56 | + { |
|
57 | + $name = $folder->getName(); |
|
58 | + if ($name === '') { |
|
59 | + // Show storage name on storage root |
|
60 | + if ($folder->getIdentifier() === '/') { |
|
61 | + $name = $folder->getStorage()->getName(); |
|
62 | + } |
|
63 | + } else { |
|
64 | + $name = key(ListUtility::resolveSpecialFolderNames( |
|
65 | + array($name => $folder) |
|
66 | + )); |
|
67 | + } |
|
68 | + return $name; |
|
69 | + } |
|
70 | 70 | |
71 | - /** |
|
72 | - * @return MediaModule|object |
|
73 | - */ |
|
74 | - protected function getMediaModule() |
|
75 | - { |
|
76 | - return GeneralUtility::makeInstance(\Fab\Media\Module\MediaModule::class); |
|
77 | - } |
|
71 | + /** |
|
72 | + * @return MediaModule|object |
|
73 | + */ |
|
74 | + protected function getMediaModule() |
|
75 | + { |
|
76 | + return GeneralUtility::makeInstance(\Fab\Media\Module\MediaModule::class); |
|
77 | + } |
|
78 | 78 | |
79 | 79 | } |
@@ -22,80 +22,80 @@ |
||
22 | 22 | class EditButton extends AbstractComponentView |
23 | 23 | { |
24 | 24 | |
25 | - /** |
|
26 | - * Renders a "edit" button to be placed in the grid. |
|
27 | - * |
|
28 | - * @param Content $object |
|
29 | - * @return string |
|
30 | - */ |
|
31 | - public function render(Content $object = null) |
|
32 | - { |
|
33 | - $file = $this->getFileConverter()->convert($object); |
|
34 | - $metadataProperties = $file->_getMetaData(); |
|
25 | + /** |
|
26 | + * Renders a "edit" button to be placed in the grid. |
|
27 | + * |
|
28 | + * @param Content $object |
|
29 | + * @return string |
|
30 | + */ |
|
31 | + public function render(Content $object = null) |
|
32 | + { |
|
33 | + $file = $this->getFileConverter()->convert($object); |
|
34 | + $metadataProperties = $file->_getMetaData(); |
|
35 | 35 | |
36 | - $button = ''; |
|
37 | - if ($file->checkActionPermission('write')) { |
|
38 | - $button = $this->makeLinkButton() |
|
39 | - ->setHref($this->getUri($file)) |
|
40 | - ->setDataAttributes([ |
|
41 | - 'uid' => $metadataProperties['uid'], |
|
42 | - 'toggle' => 'tooltip', |
|
43 | - ]) |
|
44 | - ->setClasses('btn-edit') |
|
45 | - ->setTitle($this->getLanguageService()->sL('LLL:EXT:media/Resources/Private/Language/locallang.xlf:edit_metadata')) |
|
46 | - ->setIcon($this->getIconFactory()->getIcon('actions-document-open', Icon::SIZE_SMALL)) |
|
47 | - ->render(); |
|
48 | - } |
|
36 | + $button = ''; |
|
37 | + if ($file->checkActionPermission('write')) { |
|
38 | + $button = $this->makeLinkButton() |
|
39 | + ->setHref($this->getUri($file)) |
|
40 | + ->setDataAttributes([ |
|
41 | + 'uid' => $metadataProperties['uid'], |
|
42 | + 'toggle' => 'tooltip', |
|
43 | + ]) |
|
44 | + ->setClasses('btn-edit') |
|
45 | + ->setTitle($this->getLanguageService()->sL('LLL:EXT:media/Resources/Private/Language/locallang.xlf:edit_metadata')) |
|
46 | + ->setIcon($this->getIconFactory()->getIcon('actions-document-open', Icon::SIZE_SMALL)) |
|
47 | + ->render(); |
|
48 | + } |
|
49 | 49 | |
50 | - return $button; |
|
51 | - } |
|
50 | + return $button; |
|
51 | + } |
|
52 | 52 | |
53 | - /** |
|
54 | - * @param File $file |
|
55 | - * @return string |
|
56 | - */ |
|
57 | - protected function getUri(File $file) |
|
58 | - { |
|
59 | - $metadataProperties = $file->_getMetaData(); |
|
53 | + /** |
|
54 | + * @param File $file |
|
55 | + * @return string |
|
56 | + */ |
|
57 | + protected function getUri(File $file) |
|
58 | + { |
|
59 | + $metadataProperties = $file->_getMetaData(); |
|
60 | 60 | |
61 | - $parameterName = sprintf('edit[sys_file_metadata][%s]', $metadataProperties['uid']); |
|
62 | - $uri = BackendUtility::getModuleUrl( |
|
63 | - 'record_edit', |
|
64 | - array( |
|
65 | - $parameterName => 'edit', |
|
66 | - 'returnUrl' => BackendUtility::getModuleUrl(GeneralUtility::_GP('route'), $this->getAdditionalParameters()) |
|
67 | - ) |
|
68 | - ); |
|
69 | - return $uri; |
|
70 | - } |
|
61 | + $parameterName = sprintf('edit[sys_file_metadata][%s]', $metadataProperties['uid']); |
|
62 | + $uri = BackendUtility::getModuleUrl( |
|
63 | + 'record_edit', |
|
64 | + array( |
|
65 | + $parameterName => 'edit', |
|
66 | + 'returnUrl' => BackendUtility::getModuleUrl(GeneralUtility::_GP('route'), $this->getAdditionalParameters()) |
|
67 | + ) |
|
68 | + ); |
|
69 | + return $uri; |
|
70 | + } |
|
71 | 71 | |
72 | - /** |
|
73 | - * @return array |
|
74 | - */ |
|
75 | - protected function getAdditionalParameters() |
|
76 | - { |
|
77 | - $additionalParameters = []; |
|
78 | - if (GeneralUtility::_GP('id')) { |
|
79 | - $additionalParameters['id'] = urldecode(GeneralUtility::_GP('id')); |
|
80 | - } |
|
72 | + /** |
|
73 | + * @return array |
|
74 | + */ |
|
75 | + protected function getAdditionalParameters() |
|
76 | + { |
|
77 | + $additionalParameters = []; |
|
78 | + if (GeneralUtility::_GP('id')) { |
|
79 | + $additionalParameters['id'] = urldecode(GeneralUtility::_GP('id')); |
|
80 | + } |
|
81 | 81 | |
82 | - $vidiParameters = GeneralUtility::_GP(VidiModule::PARAMETER_PREFIX); |
|
83 | - if (is_array($vidiParameters)) { |
|
84 | - $whitelistedParameters = array_intersect_key($vidiParameters, ['plugins' => true, 'matches' => true]); |
|
85 | - if (count($whitelistedParameters) === 2) { |
|
86 | - $additionalParameters[VidiModule::PARAMETER_PREFIX] = $whitelistedParameters; |
|
87 | - } |
|
88 | - } |
|
82 | + $vidiParameters = GeneralUtility::_GP(VidiModule::PARAMETER_PREFIX); |
|
83 | + if (is_array($vidiParameters)) { |
|
84 | + $whitelistedParameters = array_intersect_key($vidiParameters, ['plugins' => true, 'matches' => true]); |
|
85 | + if (count($whitelistedParameters) === 2) { |
|
86 | + $additionalParameters[VidiModule::PARAMETER_PREFIX] = $whitelistedParameters; |
|
87 | + } |
|
88 | + } |
|
89 | 89 | |
90 | - return $additionalParameters; |
|
91 | - } |
|
90 | + return $additionalParameters; |
|
91 | + } |
|
92 | 92 | |
93 | - /** |
|
94 | - * @return \Fab\Media\TypeConverter\ContentToFileConverter|object |
|
95 | - */ |
|
96 | - protected function getFileConverter() |
|
97 | - { |
|
98 | - return GeneralUtility::makeInstance(\Fab\Media\TypeConverter\ContentToFileConverter::class); |
|
99 | - } |
|
93 | + /** |
|
94 | + * @return \Fab\Media\TypeConverter\ContentToFileConverter|object |
|
95 | + */ |
|
96 | + protected function getFileConverter() |
|
97 | + { |
|
98 | + return GeneralUtility::makeInstance(\Fab\Media\TypeConverter\ContentToFileConverter::class); |
|
99 | + } |
|
100 | 100 | |
101 | 101 | } |
@@ -19,75 +19,75 @@ |
||
19 | 19 | class DeleteButton extends AbstractComponentView |
20 | 20 | { |
21 | 21 | |
22 | - /** |
|
23 | - * Renders a "delete" button to be placed in the grid. |
|
24 | - * |
|
25 | - * @param \Fab\Vidi\Domain\Model\Content $object |
|
26 | - * @return string |
|
27 | - * @throws \RuntimeException |
|
28 | - * @throws \InvalidArgumentException |
|
29 | - */ |
|
30 | - public function render(Content $object = null) |
|
31 | - { |
|
22 | + /** |
|
23 | + * Renders a "delete" button to be placed in the grid. |
|
24 | + * |
|
25 | + * @param \Fab\Vidi\Domain\Model\Content $object |
|
26 | + * @return string |
|
27 | + * @throws \RuntimeException |
|
28 | + * @throws \InvalidArgumentException |
|
29 | + */ |
|
30 | + public function render(Content $object = null) |
|
31 | + { |
|
32 | 32 | |
33 | - $button = ''; |
|
34 | - $file = $this->getFileConverter()->convert($object); |
|
33 | + $button = ''; |
|
34 | + $file = $this->getFileConverter()->convert($object); |
|
35 | 35 | |
36 | - // Only display the delete icon if the file has no reference. |
|
37 | - if ($this->getFileReferenceService()->countTotalReferences($object->getUid()) === 0 && $file->checkActionPermission('write')) { |
|
36 | + // Only display the delete icon if the file has no reference. |
|
37 | + if ($this->getFileReferenceService()->countTotalReferences($object->getUid()) === 0 && $file->checkActionPermission('write')) { |
|
38 | 38 | |
39 | - $button = $this->makeLinkButton() |
|
40 | - ->setHref($this->getDeleteUri($object)) |
|
41 | - ->setDataAttributes([ |
|
42 | - 'uid' => $object->getUid(), |
|
43 | - 'toggle' => 'tooltip', |
|
44 | - 'label' => $file->getProperty('title'), |
|
45 | - ]) |
|
46 | - ->setClasses('btn-delete') |
|
47 | - ->setTitle($this->getLanguageService()->sL('LLL:EXT:lang/locallang_mod_web_list.xlf:delete')) |
|
48 | - ->setIcon($this->getIconFactory()->getIcon('actions-edit-delete', Icon::SIZE_SMALL)) |
|
49 | - ->render(); |
|
50 | - } |
|
39 | + $button = $this->makeLinkButton() |
|
40 | + ->setHref($this->getDeleteUri($object)) |
|
41 | + ->setDataAttributes([ |
|
42 | + 'uid' => $object->getUid(), |
|
43 | + 'toggle' => 'tooltip', |
|
44 | + 'label' => $file->getProperty('title'), |
|
45 | + ]) |
|
46 | + ->setClasses('btn-delete') |
|
47 | + ->setTitle($this->getLanguageService()->sL('LLL:EXT:lang/locallang_mod_web_list.xlf:delete')) |
|
48 | + ->setIcon($this->getIconFactory()->getIcon('actions-edit-delete', Icon::SIZE_SMALL)) |
|
49 | + ->render(); |
|
50 | + } |
|
51 | 51 | |
52 | - return $button; |
|
53 | - } |
|
52 | + return $button; |
|
53 | + } |
|
54 | 54 | |
55 | - /** |
|
56 | - * @param Content $object |
|
57 | - * @return string |
|
58 | - * @throws \InvalidArgumentException |
|
59 | - */ |
|
60 | - protected function getDeleteUri(Content $object) |
|
61 | - { |
|
62 | - $additionalParameters = array( |
|
63 | - $this->getModuleLoader()->getParameterPrefix() => array( |
|
64 | - 'controller' => 'Content', |
|
65 | - 'action' => 'delete', |
|
66 | - 'format' => 'json', |
|
67 | - 'matches' => array( |
|
68 | - 'uid' => $object->getUid(), |
|
69 | - ), |
|
70 | - ), |
|
71 | - ); |
|
72 | - return $this->getModuleLoader()->getModuleUrl($additionalParameters); |
|
73 | - } |
|
55 | + /** |
|
56 | + * @param Content $object |
|
57 | + * @return string |
|
58 | + * @throws \InvalidArgumentException |
|
59 | + */ |
|
60 | + protected function getDeleteUri(Content $object) |
|
61 | + { |
|
62 | + $additionalParameters = array( |
|
63 | + $this->getModuleLoader()->getParameterPrefix() => array( |
|
64 | + 'controller' => 'Content', |
|
65 | + 'action' => 'delete', |
|
66 | + 'format' => 'json', |
|
67 | + 'matches' => array( |
|
68 | + 'uid' => $object->getUid(), |
|
69 | + ), |
|
70 | + ), |
|
71 | + ); |
|
72 | + return $this->getModuleLoader()->getModuleUrl($additionalParameters); |
|
73 | + } |
|
74 | 74 | |
75 | - /** |
|
76 | - * @return \Fab\Media\Resource\FileReferenceService|object |
|
77 | - * @throws \InvalidArgumentException |
|
78 | - */ |
|
79 | - protected function getFileReferenceService() |
|
80 | - { |
|
81 | - return GeneralUtility::makeInstance(\Fab\Media\Resource\FileReferenceService::class); |
|
82 | - } |
|
75 | + /** |
|
76 | + * @return \Fab\Media\Resource\FileReferenceService|object |
|
77 | + * @throws \InvalidArgumentException |
|
78 | + */ |
|
79 | + protected function getFileReferenceService() |
|
80 | + { |
|
81 | + return GeneralUtility::makeInstance(\Fab\Media\Resource\FileReferenceService::class); |
|
82 | + } |
|
83 | 83 | |
84 | - /** |
|
85 | - * @return \Fab\Media\TypeConverter\ContentToFileConverter|object |
|
86 | - * @throws \InvalidArgumentException |
|
87 | - */ |
|
88 | - protected function getFileConverter() |
|
89 | - { |
|
90 | - return GeneralUtility::makeInstance(\Fab\Media\TypeConverter\ContentToFileConverter::class); |
|
91 | - } |
|
84 | + /** |
|
85 | + * @return \Fab\Media\TypeConverter\ContentToFileConverter|object |
|
86 | + * @throws \InvalidArgumentException |
|
87 | + */ |
|
88 | + protected function getFileConverter() |
|
89 | + { |
|
90 | + return GeneralUtility::makeInstance(\Fab\Media\TypeConverter\ContentToFileConverter::class); |
|
91 | + } |
|
92 | 92 | |
93 | 93 | } |
@@ -18,16 +18,16 @@ |
||
18 | 18 | class UploadButton extends AbstractComponentView |
19 | 19 | { |
20 | 20 | |
21 | - /** |
|
22 | - * Renders a button for uploading assets. |
|
23 | - * |
|
24 | - * @return string |
|
25 | - */ |
|
26 | - public function render() |
|
27 | - { |
|
21 | + /** |
|
22 | + * Renders a button for uploading assets. |
|
23 | + * |
|
24 | + * @return string |
|
25 | + */ |
|
26 | + public function render() |
|
27 | + { |
|
28 | 28 | |
29 | - /** @var $fileUpload \Fab\Media\Form\FileUpload */ |
|
30 | - $fileUpload = GeneralUtility::makeInstance(\Fab\Media\Form\FileUpload::class); |
|
31 | - return $fileUpload->setPrefix(MediaModule::getParameterPrefix())->render(); |
|
32 | - } |
|
29 | + /** @var $fileUpload \Fab\Media\Form\FileUpload */ |
|
30 | + $fileUpload = GeneralUtility::makeInstance(\Fab\Media\Form\FileUpload::class); |
|
31 | + return $fileUpload->setPrefix(MediaModule::getParameterPrefix())->render(); |
|
32 | + } |
|
33 | 33 | } |
@@ -16,28 +16,28 @@ |
||
16 | 16 | class ClientValidation implements SingletonInterface |
17 | 17 | { |
18 | 18 | |
19 | - /** |
|
20 | - * Returns a class instance |
|
21 | - * |
|
22 | - * @return \Fab\Media\Utility\ClientValidation|object |
|
23 | - */ |
|
24 | - static public function getInstance() |
|
25 | - { |
|
26 | - return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\Fab\Media\Utility\ClientValidation::class); |
|
27 | - } |
|
19 | + /** |
|
20 | + * Returns a class instance |
|
21 | + * |
|
22 | + * @return \Fab\Media\Utility\ClientValidation|object |
|
23 | + */ |
|
24 | + static public function getInstance() |
|
25 | + { |
|
26 | + return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\Fab\Media\Utility\ClientValidation::class); |
|
27 | + } |
|
28 | 28 | |
29 | - /** |
|
30 | - * Get the validation class name given a field. |
|
31 | - * |
|
32 | - * @param string $fieldName |
|
33 | - * @return string |
|
34 | - */ |
|
35 | - public function get($fieldName) |
|
36 | - { |
|
37 | - $result = ''; |
|
38 | - if (\Fab\Media\Utility\TcaField::getService()->isRequired($fieldName)) { |
|
39 | - $result = ' validate[required]'; |
|
40 | - } |
|
41 | - return $result; |
|
42 | - } |
|
29 | + /** |
|
30 | + * Get the validation class name given a field. |
|
31 | + * |
|
32 | + * @param string $fieldName |
|
33 | + * @return string |
|
34 | + */ |
|
35 | + public function get($fieldName) |
|
36 | + { |
|
37 | + $result = ''; |
|
38 | + if (\Fab\Media\Utility\TcaField::getService()->isRequired($fieldName)) { |
|
39 | + $result = ' validate[required]'; |
|
40 | + } |
|
41 | + return $result; |
|
42 | + } |
|
43 | 43 | } |
@@ -16,18 +16,18 @@ |
||
16 | 16 | class Logger implements SingletonInterface |
17 | 17 | { |
18 | 18 | |
19 | - /** |
|
20 | - * Returns a logger class instance. |
|
21 | - * |
|
22 | - * @param mixed $instance |
|
23 | - * @return \TYPO3\CMS\Core\Log\Logger |
|
24 | - */ |
|
25 | - static public function getInstance($instance) |
|
26 | - { |
|
27 | - /** @var $loggerManager \TYPO3\CMS\Core\Log\LogManager */ |
|
28 | - $loggerManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Log\LogManager::class); |
|
19 | + /** |
|
20 | + * Returns a logger class instance. |
|
21 | + * |
|
22 | + * @param mixed $instance |
|
23 | + * @return \TYPO3\CMS\Core\Log\Logger |
|
24 | + */ |
|
25 | + static public function getInstance($instance) |
|
26 | + { |
|
27 | + /** @var $loggerManager \TYPO3\CMS\Core\Log\LogManager */ |
|
28 | + $loggerManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Log\LogManager::class); |
|
29 | 29 | |
30 | - /** @var $logger \TYPO3\CMS\Core\Log\Logger */ |
|
31 | - return $loggerManager->getLogger(get_class($instance)); |
|
32 | - } |
|
30 | + /** @var $logger \TYPO3\CMS\Core\Log\Logger */ |
|
31 | + return $loggerManager->getLogger(get_class($instance)); |
|
32 | + } |
|
33 | 33 | } |
@@ -20,72 +20,72 @@ |
||
20 | 20 | class PermissionUtility implements SingletonInterface |
21 | 21 | { |
22 | 22 | |
23 | - /** |
|
24 | - * Returns a class instance. |
|
25 | - * |
|
26 | - * @return PermissionUtility |
|
27 | - * @throws \InvalidArgumentException |
|
28 | - */ |
|
29 | - static public function getInstance() |
|
30 | - { |
|
31 | - return GeneralUtility::makeInstance(PermissionUtility::class); |
|
32 | - } |
|
23 | + /** |
|
24 | + * Returns a class instance. |
|
25 | + * |
|
26 | + * @return PermissionUtility |
|
27 | + * @throws \InvalidArgumentException |
|
28 | + */ |
|
29 | + static public function getInstance() |
|
30 | + { |
|
31 | + return GeneralUtility::makeInstance(PermissionUtility::class); |
|
32 | + } |
|
33 | 33 | |
34 | - /** |
|
35 | - * Returns allowed extensions given a possible storage. |
|
36 | - * |
|
37 | - * @param null|int|ResourceStorage $storage |
|
38 | - * @return array |
|
39 | - * @throws \InvalidArgumentException |
|
40 | - */ |
|
41 | - public function getAllowedExtensions($storage = null) |
|
42 | - { |
|
34 | + /** |
|
35 | + * Returns allowed extensions given a possible storage. |
|
36 | + * |
|
37 | + * @param null|int|ResourceStorage $storage |
|
38 | + * @return array |
|
39 | + * @throws \InvalidArgumentException |
|
40 | + */ |
|
41 | + public function getAllowedExtensions($storage = null) |
|
42 | + { |
|
43 | 43 | |
44 | - $fieldNames = array( |
|
45 | - 'extension_allowed_file_type_1', |
|
46 | - 'extension_allowed_file_type_2', |
|
47 | - 'extension_allowed_file_type_3', |
|
48 | - 'extension_allowed_file_type_4', |
|
49 | - 'extension_allowed_file_type_5', |
|
50 | - ); |
|
44 | + $fieldNames = array( |
|
45 | + 'extension_allowed_file_type_1', |
|
46 | + 'extension_allowed_file_type_2', |
|
47 | + 'extension_allowed_file_type_3', |
|
48 | + 'extension_allowed_file_type_4', |
|
49 | + 'extension_allowed_file_type_5', |
|
50 | + ); |
|
51 | 51 | |
52 | - if (!is_null($storage)) { |
|
53 | - if (!$storage instanceof ResourceStorage) { |
|
54 | - $storage = ResourceFactory::getInstance()->getStorageObject((int)$storage); |
|
55 | - } |
|
56 | - } else { |
|
57 | - $storage = $this->getMediaModule()->getCurrentStorage(); |
|
58 | - } |
|
52 | + if (!is_null($storage)) { |
|
53 | + if (!$storage instanceof ResourceStorage) { |
|
54 | + $storage = ResourceFactory::getInstance()->getStorageObject((int)$storage); |
|
55 | + } |
|
56 | + } else { |
|
57 | + $storage = $this->getMediaModule()->getCurrentStorage(); |
|
58 | + } |
|
59 | 59 | |
60 | - $storageRecord = $storage->getStorageRecord(); |
|
61 | - $allowedExtensions = []; |
|
62 | - foreach ($fieldNames as $fieldName) { |
|
63 | - $_allowedExtensions = GeneralUtility::trimExplode(',', $storageRecord[$fieldName], true); |
|
64 | - $allowedExtensions = array_merge($allowedExtensions, $_allowedExtensions); |
|
65 | - } |
|
60 | + $storageRecord = $storage->getStorageRecord(); |
|
61 | + $allowedExtensions = []; |
|
62 | + foreach ($fieldNames as $fieldName) { |
|
63 | + $_allowedExtensions = GeneralUtility::trimExplode(',', $storageRecord[$fieldName], true); |
|
64 | + $allowedExtensions = array_merge($allowedExtensions, $_allowedExtensions); |
|
65 | + } |
|
66 | 66 | |
67 | - $uniqueAllowedExtensions = array_unique($allowedExtensions); |
|
68 | - return array_filter($uniqueAllowedExtensions, 'strlen'); |
|
69 | - } |
|
67 | + $uniqueAllowedExtensions = array_unique($allowedExtensions); |
|
68 | + return array_filter($uniqueAllowedExtensions, 'strlen'); |
|
69 | + } |
|
70 | 70 | |
71 | - /** |
|
72 | - * Returns allowed extensions list. |
|
73 | - * |
|
74 | - * @return string |
|
75 | - * @throws \InvalidArgumentException |
|
76 | - */ |
|
77 | - public function getAllowedExtensionList() |
|
78 | - { |
|
79 | - return implode(',', $this->getAllowedExtensions()); |
|
80 | - } |
|
71 | + /** |
|
72 | + * Returns allowed extensions list. |
|
73 | + * |
|
74 | + * @return string |
|
75 | + * @throws \InvalidArgumentException |
|
76 | + */ |
|
77 | + public function getAllowedExtensionList() |
|
78 | + { |
|
79 | + return implode(',', $this->getAllowedExtensions()); |
|
80 | + } |
|
81 | 81 | |
82 | - /** |
|
83 | - * @return MediaModule|object |
|
84 | - * @throws \InvalidArgumentException |
|
85 | - */ |
|
86 | - protected function getMediaModule() |
|
87 | - { |
|
88 | - return GeneralUtility::makeInstance(MediaModule::class); |
|
89 | - } |
|
82 | + /** |
|
83 | + * @return MediaModule|object |
|
84 | + * @throws \InvalidArgumentException |
|
85 | + */ |
|
86 | + protected function getMediaModule() |
|
87 | + { |
|
88 | + return GeneralUtility::makeInstance(MediaModule::class); |
|
89 | + } |
|
90 | 90 | |
91 | 91 | } |
@@ -16,57 +16,57 @@ |
||
16 | 16 | class DomElement implements SingletonInterface |
17 | 17 | { |
18 | 18 | |
19 | - /** |
|
20 | - * Returns a class instance |
|
21 | - * |
|
22 | - * @return \Fab\Media\Utility\DomElement|object |
|
23 | - */ |
|
24 | - static public function getInstance() |
|
25 | - { |
|
26 | - return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\Fab\Media\Utility\DomElement::class); |
|
27 | - } |
|
19 | + /** |
|
20 | + * Returns a class instance |
|
21 | + * |
|
22 | + * @return \Fab\Media\Utility\DomElement|object |
|
23 | + */ |
|
24 | + static public function getInstance() |
|
25 | + { |
|
26 | + return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\Fab\Media\Utility\DomElement::class); |
|
27 | + } |
|
28 | 28 | |
29 | - /** |
|
30 | - * Format an id given an input string |
|
31 | - * |
|
32 | - * @param string $input |
|
33 | - * @return string |
|
34 | - */ |
|
35 | - public function formatId($input) |
|
36 | - { |
|
29 | + /** |
|
30 | + * Format an id given an input string |
|
31 | + * |
|
32 | + * @param string $input |
|
33 | + * @return string |
|
34 | + */ |
|
35 | + public function formatId($input) |
|
36 | + { |
|
37 | 37 | |
38 | - // remove the capital letter from the id |
|
39 | - $segments = preg_split('/(?=[A-Z])/', $input); |
|
40 | - $segments = array_map('strtolower', $segments); |
|
41 | - if ($segments[0] == '') { |
|
42 | - array_shift($segments); |
|
43 | - } |
|
44 | - $result = implode('-', $segments); |
|
38 | + // remove the capital letter from the id |
|
39 | + $segments = preg_split('/(?=[A-Z])/', $input); |
|
40 | + $segments = array_map('strtolower', $segments); |
|
41 | + if ($segments[0] == '') { |
|
42 | + array_shift($segments); |
|
43 | + } |
|
44 | + $result = implode('-', $segments); |
|
45 | 45 | |
46 | - return $this->sanitizeId($result); |
|
47 | - } |
|
46 | + return $this->sanitizeId($result); |
|
47 | + } |
|
48 | 48 | |
49 | - /** |
|
50 | - * Sanitize an id |
|
51 | - * |
|
52 | - * @param string $input |
|
53 | - * @return mixed |
|
54 | - */ |
|
55 | - protected function sanitizeId($input) |
|
56 | - { |
|
49 | + /** |
|
50 | + * Sanitize an id |
|
51 | + * |
|
52 | + * @param string $input |
|
53 | + * @return mixed |
|
54 | + */ |
|
55 | + protected function sanitizeId($input) |
|
56 | + { |
|
57 | 57 | |
58 | - // remove the track of possible namespace |
|
59 | - $searches[] = ' '; |
|
60 | - $searches[] = '_'; |
|
61 | - $searches[] = '--'; |
|
62 | - $searches[] = '['; |
|
63 | - $searches[] = ']'; |
|
64 | - $replaces[] = '-'; |
|
65 | - $replaces[] = '-'; |
|
66 | - $replaces[] = '-'; |
|
67 | - $replaces[] = '-'; |
|
68 | - $replaces[] = ''; |
|
69 | - return str_replace($searches, $replaces, strtolower($input)); |
|
70 | - } |
|
58 | + // remove the track of possible namespace |
|
59 | + $searches[] = ' '; |
|
60 | + $searches[] = '_'; |
|
61 | + $searches[] = '--'; |
|
62 | + $searches[] = '['; |
|
63 | + $searches[] = ']'; |
|
64 | + $replaces[] = '-'; |
|
65 | + $replaces[] = '-'; |
|
66 | + $replaces[] = '-'; |
|
67 | + $replaces[] = '-'; |
|
68 | + $replaces[] = ''; |
|
69 | + return str_replace($searches, $replaces, strtolower($input)); |
|
70 | + } |
|
71 | 71 | |
72 | 72 | } |