@@ -20,39 +20,39 @@ |
||
| 20 | 20 | */ |
| 21 | 21 | class FileUploadHook implements ExtendedFileUtilityProcessDataHookInterface |
| 22 | 22 | { |
| 23 | - /** |
|
| 24 | - * @param string $action The action |
|
| 25 | - * @param array $cmdArr The parameter sent to the action handler |
|
| 26 | - * @param array $result The results of all calls to the action handler |
|
| 27 | - * @param ExtendedFileUtility $pObj The parent object |
|
| 28 | - * @return void |
|
| 29 | - */ |
|
| 30 | - public function processData_postProcessAction($action, array $cmdArr, array $result, ExtendedFileUtility $pObj) |
|
| 31 | - { |
|
| 32 | - if ($action === 'upload') { |
|
| 33 | - /** @var File[] $files */ |
|
| 34 | - $files = array_pop($result); |
|
| 35 | - if (!is_array($files)) { |
|
| 36 | - return; |
|
| 37 | - } |
|
| 23 | + /** |
|
| 24 | + * @param string $action The action |
|
| 25 | + * @param array $cmdArr The parameter sent to the action handler |
|
| 26 | + * @param array $result The results of all calls to the action handler |
|
| 27 | + * @param ExtendedFileUtility $pObj The parent object |
|
| 28 | + * @return void |
|
| 29 | + */ |
|
| 30 | + public function processData_postProcessAction($action, array $cmdArr, array $result, ExtendedFileUtility $pObj) |
|
| 31 | + { |
|
| 32 | + if ($action === 'upload') { |
|
| 33 | + /** @var File[] $files */ |
|
| 34 | + $files = array_pop($result); |
|
| 35 | + if (!is_array($files)) { |
|
| 36 | + return; |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | - foreach ($files as $file) { |
|
| 40 | - // Run the indexer for extracting metadata. |
|
| 41 | - $this->getMediaIndexer($file->getStorage()) |
|
| 42 | - ->extractMetadata($file) |
|
| 43 | - ->applyDefaultCategories($file); |
|
| 44 | - } |
|
| 45 | - } |
|
| 46 | - } |
|
| 39 | + foreach ($files as $file) { |
|
| 40 | + // Run the indexer for extracting metadata. |
|
| 41 | + $this->getMediaIndexer($file->getStorage()) |
|
| 42 | + ->extractMetadata($file) |
|
| 43 | + ->applyDefaultCategories($file); |
|
| 44 | + } |
|
| 45 | + } |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | - /** |
|
| 49 | - * Get the instance of the Indexer service to update the metadata of the file. |
|
| 50 | - * |
|
| 51 | - * @param ResourceStorage $storage |
|
| 52 | - * @return MediaIndexer|object |
|
| 53 | - */ |
|
| 54 | - protected function getMediaIndexer($storage) |
|
| 55 | - { |
|
| 56 | - return GeneralUtility::makeInstance(MediaIndexer::class, $storage); |
|
| 57 | - } |
|
| 48 | + /** |
|
| 49 | + * Get the instance of the Indexer service to update the metadata of the file. |
|
| 50 | + * |
|
| 51 | + * @param ResourceStorage $storage |
|
| 52 | + * @return MediaIndexer|object |
|
| 53 | + */ |
|
| 54 | + protected function getMediaIndexer($storage) |
|
| 55 | + { |
|
| 56 | + return GeneralUtility::makeInstance(MediaIndexer::class, $storage); |
|
| 57 | + } |
|
| 58 | 58 | } |
@@ -9,35 +9,35 @@ |
||
| 9 | 9 | defined('TYPO3') or die(); |
| 10 | 10 | |
| 11 | 11 | call_user_func(function () { |
| 12 | - $configuration = GeneralUtility::makeInstance( |
|
| 13 | - ExtensionConfiguration::class |
|
| 14 | - )->get('media'); |
|
| 15 | - |
|
| 16 | - $GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1547054767] = [ |
|
| 17 | - 'nodeName' => 'findUploader', |
|
| 18 | - 'priority' => 40, |
|
| 19 | - 'class' => TceForms::class, |
|
| 20 | - ]; |
|
| 21 | - |
|
| 22 | - $disableTitleMetadataExtractor = isset($configuration['disable_title_metadata_extractor']) ? $configuration['disable_title_metadata_extractor'] : false; |
|
| 23 | - if (!$disableTitleMetadataExtractor) { |
|
| 24 | - // Register basic metadata extractor. Will feed the file with a "title" when indexing, e.g. upload, through scheduler |
|
| 25 | - GeneralUtility::makeInstance(ExtractorRegistry::class)->registerExtractionService(TitleMetadataExtractor::class); |
|
| 26 | - } |
|
| 27 | - |
|
| 28 | - // Hook for traditional file upload, trigger metadata indexing as well. |
|
| 29 | - // Could be done at the Core level in the future... |
|
| 30 | - $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_extfilefunc.php']['processData'][] = 'Fab\Media\Hook\FileUploadHook'; |
|
| 31 | - |
|
| 32 | - |
|
| 33 | - // Special process to fill column "usage" which indicates the total number of file reference including soft references. |
|
| 34 | - $GLOBALS ['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] = 'Fab\Media\Hook\DataHandlerHook'; |
|
| 35 | - |
|
| 36 | - $hasMediaFilePicker = isset($configuration['has_media_file_picker']) ? $configuration['has_media_file_picker'] : false; |
|
| 37 | - if ($hasMediaFilePicker) { |
|
| 38 | - // Override classes for the Object Manager. |
|
| 39 | - $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][FormResultCompiler::class] = array( |
|
| 40 | - 'className' => \Fab\Media\Override\Backend\Form\FormResultCompiler::class |
|
| 41 | - ); |
|
| 42 | - } |
|
| 12 | + $configuration = GeneralUtility::makeInstance( |
|
| 13 | + ExtensionConfiguration::class |
|
| 14 | + )->get('media'); |
|
| 15 | + |
|
| 16 | + $GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1547054767] = [ |
|
| 17 | + 'nodeName' => 'findUploader', |
|
| 18 | + 'priority' => 40, |
|
| 19 | + 'class' => TceForms::class, |
|
| 20 | + ]; |
|
| 21 | + |
|
| 22 | + $disableTitleMetadataExtractor = isset($configuration['disable_title_metadata_extractor']) ? $configuration['disable_title_metadata_extractor'] : false; |
|
| 23 | + if (!$disableTitleMetadataExtractor) { |
|
| 24 | + // Register basic metadata extractor. Will feed the file with a "title" when indexing, e.g. upload, through scheduler |
|
| 25 | + GeneralUtility::makeInstance(ExtractorRegistry::class)->registerExtractionService(TitleMetadataExtractor::class); |
|
| 26 | + } |
|
| 27 | + |
|
| 28 | + // Hook for traditional file upload, trigger metadata indexing as well. |
|
| 29 | + // Could be done at the Core level in the future... |
|
| 30 | + $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_extfilefunc.php']['processData'][] = 'Fab\Media\Hook\FileUploadHook'; |
|
| 31 | + |
|
| 32 | + |
|
| 33 | + // Special process to fill column "usage" which indicates the total number of file reference including soft references. |
|
| 34 | + $GLOBALS ['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] = 'Fab\Media\Hook\DataHandlerHook'; |
|
| 35 | + |
|
| 36 | + $hasMediaFilePicker = isset($configuration['has_media_file_picker']) ? $configuration['has_media_file_picker'] : false; |
|
| 37 | + if ($hasMediaFilePicker) { |
|
| 38 | + // Override classes for the Object Manager. |
|
| 39 | + $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][FormResultCompiler::class] = array( |
|
| 40 | + 'className' => \Fab\Media\Override\Backend\Form\FormResultCompiler::class |
|
| 41 | + ); |
|
| 42 | + } |
|
| 43 | 43 | }); |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | use TYPO3\CMS\Backend\Form\FormResultCompiler; |
| 9 | 9 | defined('TYPO3') or die(); |
| 10 | 10 | |
| 11 | -call_user_func(function () { |
|
| 11 | +call_user_func(function() { |
|
| 12 | 12 | $configuration = GeneralUtility::makeInstance( |
| 13 | 13 | ExtensionConfiguration::class |
| 14 | 14 | )->get('media'); |
@@ -5,86 +5,86 @@ discard block |
||
| 5 | 5 | use TYPO3\CMS\Core\Utility\ArrayUtility; |
| 6 | 6 | |
| 7 | 7 | if (!defined('TYPO3')) { |
| 8 | - die('Access denied.'); |
|
| 8 | + die('Access denied.'); |
|
| 9 | 9 | } |
| 10 | 10 | |
| 11 | 11 | $configuration = GeneralUtility::makeInstance( |
| 12 | - ExtensionConfiguration::class |
|
| 12 | + ExtensionConfiguration::class |
|
| 13 | 13 | )->get('media'); |
| 14 | 14 | |
| 15 | 15 | $tca = [ |
| 16 | - 'types' => [ |
|
| 17 | - 0 => ['showitem' => $GLOBALS['TCA']['sys_file_storage']['types'][0]['showitem'] . ', |
|
| 16 | + 'types' => [ |
|
| 17 | + 0 => ['showitem' => $GLOBALS['TCA']['sys_file_storage']['types'][0]['showitem'] . ', |
|
| 18 | 18 | |
| 19 | 19 | --div--;LLL:EXT:media/Resources/Private/Language/locallang_db.xlf:tab.upload_settings, |
| 20 | 20 | maximum_dimension_original_image, extension_allowed_file_type_1, extension_allowed_file_type_2, extension_allowed_file_type_3, extension_allowed_file_type_4, extension_allowed_file_type_5, |
| 21 | 21 | ', |
| 22 | - ], |
|
| 23 | - ], |
|
| 24 | - 'columns' => [ |
|
| 25 | - 'maximum_dimension_original_image' => [ |
|
| 26 | - 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang_db.xlf:sys_file_storage.maximum_dimension_original_image', |
|
| 27 | - 'config' => [ |
|
| 28 | - 'type' => 'input', |
|
| 29 | - 'size' => 24, |
|
| 30 | - 'default' => '1920x1920', |
|
| 31 | - 'eval' => 'trim', |
|
| 32 | - ], |
|
| 33 | - ], |
|
| 34 | - 'extension_allowed_file_type_1' => [ |
|
| 35 | - 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang_db.xlf:sys_file_storage.extension_allowed_file_type_1', |
|
| 36 | - 'config' => [ |
|
| 37 | - 'type' => 'input', |
|
| 38 | - 'size' => 255, |
|
| 39 | - 'default' => 'txt, html', |
|
| 40 | - 'eval' => 'trim', |
|
| 41 | - ], |
|
| 42 | - ], |
|
| 43 | - 'extension_allowed_file_type_2' => [ |
|
| 44 | - 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang_db.xlf:sys_file_storage.extension_allowed_file_type_2', |
|
| 45 | - 'config' => [ |
|
| 46 | - 'type' => 'input', |
|
| 47 | - 'size' => 255, |
|
| 48 | - 'default' => 'jpg, jpeg, bmp, png, tiff, tif, gif, eps', |
|
| 49 | - 'eval' => 'trim', |
|
| 50 | - ], |
|
| 51 | - ], |
|
| 52 | - 'extension_allowed_file_type_3' => [ |
|
| 53 | - 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang_db.xlf:sys_file_storage.extension_allowed_file_type_3', |
|
| 54 | - 'config' => [ |
|
| 55 | - 'type' => 'input', |
|
| 56 | - 'size' => 255, |
|
| 57 | - 'default' => 'mp3, mp4, m4a, wma, f4a', |
|
| 58 | - 'eval' => 'trim', |
|
| 59 | - ], |
|
| 60 | - ], |
|
| 61 | - 'extension_allowed_file_type_4' => [ |
|
| 62 | - 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang_db.xlf:sys_file_storage.extension_allowed_file_type_4', |
|
| 63 | - 'config' => [ |
|
| 64 | - 'type' => 'input', |
|
| 65 | - 'size' => 255, |
|
| 66 | - 'default' => 'mov, avi, mpeg, mpg, mp4, m4v, flv, f4v, webm, wmv, ogv, 3gp', |
|
| 67 | - 'eval' => 'trim', |
|
| 68 | - ], |
|
| 69 | - ], |
|
| 70 | - 'extension_allowed_file_type_5' => [ |
|
| 71 | - 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang_db.xlf:sys_file_storage.extension_allowed_file_type_5', |
|
| 72 | - 'config' => [ |
|
| 73 | - 'type' => 'input', |
|
| 74 | - 'size' => 255, |
|
| 75 | - 'default' => 'pdf, zip, doc, docx, dotx, ppt, pptx, pps, ppsx, odt, xls, xlsx, xltx, rtf, xlt', |
|
| 76 | - 'eval' => 'trim', |
|
| 77 | - ], |
|
| 78 | - ], |
|
| 79 | - ], |
|
| 22 | + ], |
|
| 23 | + ], |
|
| 24 | + 'columns' => [ |
|
| 25 | + 'maximum_dimension_original_image' => [ |
|
| 26 | + 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang_db.xlf:sys_file_storage.maximum_dimension_original_image', |
|
| 27 | + 'config' => [ |
|
| 28 | + 'type' => 'input', |
|
| 29 | + 'size' => 24, |
|
| 30 | + 'default' => '1920x1920', |
|
| 31 | + 'eval' => 'trim', |
|
| 32 | + ], |
|
| 33 | + ], |
|
| 34 | + 'extension_allowed_file_type_1' => [ |
|
| 35 | + 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang_db.xlf:sys_file_storage.extension_allowed_file_type_1', |
|
| 36 | + 'config' => [ |
|
| 37 | + 'type' => 'input', |
|
| 38 | + 'size' => 255, |
|
| 39 | + 'default' => 'txt, html', |
|
| 40 | + 'eval' => 'trim', |
|
| 41 | + ], |
|
| 42 | + ], |
|
| 43 | + 'extension_allowed_file_type_2' => [ |
|
| 44 | + 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang_db.xlf:sys_file_storage.extension_allowed_file_type_2', |
|
| 45 | + 'config' => [ |
|
| 46 | + 'type' => 'input', |
|
| 47 | + 'size' => 255, |
|
| 48 | + 'default' => 'jpg, jpeg, bmp, png, tiff, tif, gif, eps', |
|
| 49 | + 'eval' => 'trim', |
|
| 50 | + ], |
|
| 51 | + ], |
|
| 52 | + 'extension_allowed_file_type_3' => [ |
|
| 53 | + 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang_db.xlf:sys_file_storage.extension_allowed_file_type_3', |
|
| 54 | + 'config' => [ |
|
| 55 | + 'type' => 'input', |
|
| 56 | + 'size' => 255, |
|
| 57 | + 'default' => 'mp3, mp4, m4a, wma, f4a', |
|
| 58 | + 'eval' => 'trim', |
|
| 59 | + ], |
|
| 60 | + ], |
|
| 61 | + 'extension_allowed_file_type_4' => [ |
|
| 62 | + 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang_db.xlf:sys_file_storage.extension_allowed_file_type_4', |
|
| 63 | + 'config' => [ |
|
| 64 | + 'type' => 'input', |
|
| 65 | + 'size' => 255, |
|
| 66 | + 'default' => 'mov, avi, mpeg, mpg, mp4, m4v, flv, f4v, webm, wmv, ogv, 3gp', |
|
| 67 | + 'eval' => 'trim', |
|
| 68 | + ], |
|
| 69 | + ], |
|
| 70 | + 'extension_allowed_file_type_5' => [ |
|
| 71 | + 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang_db.xlf:sys_file_storage.extension_allowed_file_type_5', |
|
| 72 | + 'config' => [ |
|
| 73 | + 'type' => 'input', |
|
| 74 | + 'size' => 255, |
|
| 75 | + 'default' => 'pdf, zip, doc, docx, dotx, ppt, pptx, pps, ppsx, odt, xls, xlsx, xltx, rtf, xlt', |
|
| 76 | + 'eval' => 'trim', |
|
| 77 | + ], |
|
| 78 | + ], |
|
| 79 | + ], |
|
| 80 | 80 | ]; |
| 81 | 81 | |
| 82 | 82 | $tcaForHiddenFolderTree = []; |
| 83 | 83 | if (!$configuration['has_folder_tree']) { |
| 84 | - $tcaForHiddenFolderTree = [ |
|
| 84 | + $tcaForHiddenFolderTree = [ |
|
| 85 | 85 | |
| 86 | - 'types' => [ |
|
| 87 | - 0 => ['showitem' => $GLOBALS['TCA']['sys_file_storage']['types'][0]['showitem'] . ', |
|
| 86 | + 'types' => [ |
|
| 87 | + 0 => ['showitem' => $GLOBALS['TCA']['sys_file_storage']['types'][0]['showitem'] . ', |
|
| 88 | 88 | |
| 89 | 89 | --div--;LLL:EXT:media/Resources/Private/Language/locallang_db.xlf:tab.media_mount_point, |
| 90 | 90 | mount_point_file_type_1, mount_point_file_type_2, mount_point_file_type_3, mount_point_file_type_4, mount_point_file_type_5, |
@@ -93,121 +93,121 @@ discard block |
||
| 93 | 93 | maximum_dimension_original_image, extension_allowed_file_type_1, extension_allowed_file_type_2, extension_allowed_file_type_3, extension_allowed_file_type_4, extension_allowed_file_type_5, |
| 94 | 94 | ', |
| 95 | 95 | |
| 96 | - ], |
|
| 97 | - ], |
|
| 98 | - 'columns' => [ |
|
| 99 | - 'mount_point_file_type_1' => [ |
|
| 100 | - 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang_db.xlf:sys_file_storage.mount_point_file_type_1', |
|
| 101 | - 'config' => [ |
|
| 102 | - 'type' => 'group', |
|
| 103 | - 'allowed' => 'sys_filemounts', |
|
| 104 | - 'size' => 1, |
|
| 105 | - 'minitems' => 0, |
|
| 106 | - 'maxitems' => 1, |
|
| 107 | - 'wizards' => [ |
|
| 108 | - 'edit' => [ |
|
| 109 | - 'type' => 'popup', |
|
| 110 | - 'module' => [ |
|
| 111 | - 'name' => 'wizard_edit', |
|
| 112 | - ], |
|
| 113 | - 'icon' => 'edit2.gif', |
|
| 114 | - 'popup_onlyOpenIfSelected' => 1, |
|
| 115 | - 'notNewRecords' => 1, |
|
| 116 | - 'JSopenParams' => 'height=500,width=800,status=0,menubar=0,scrollbars=1,resizable=yes' |
|
| 117 | - ], |
|
| 118 | - ], |
|
| 119 | - ], |
|
| 120 | - ], |
|
| 121 | - 'mount_point_file_type_2' => [ |
|
| 122 | - 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang_db.xlf:sys_file_storage.mount_point_file_type_2', |
|
| 123 | - 'config' => [ |
|
| 124 | - 'type' => 'group', |
|
| 125 | - 'allowed' => 'sys_filemounts', |
|
| 126 | - 'size' => 1, |
|
| 127 | - 'minitems' => 0, |
|
| 128 | - 'maxitems' => 1, |
|
| 129 | - 'wizards' => [ |
|
| 130 | - 'edit' => [ |
|
| 131 | - 'type' => 'popup', |
|
| 132 | - 'module' => [ |
|
| 133 | - 'name' => 'wizard_edit', |
|
| 134 | - ], |
|
| 135 | - 'icon' => 'edit2.gif', |
|
| 136 | - 'popup_onlyOpenIfSelected' => 1, |
|
| 137 | - 'notNewRecords' => 1, |
|
| 138 | - 'JSopenParams' => 'height=500,width=800,status=0,menubar=0,scrollbars=1,resizable=yes' |
|
| 139 | - ], |
|
| 140 | - ], |
|
| 141 | - ], |
|
| 142 | - ], |
|
| 143 | - 'mount_point_file_type_3' => [ |
|
| 144 | - 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang_db.xlf:sys_file_storage.mount_point_file_type_3', |
|
| 145 | - 'config' => [ |
|
| 146 | - 'type' => 'group', |
|
| 147 | - 'allowed' => 'sys_filemounts', |
|
| 148 | - 'size' => 1, |
|
| 149 | - 'minitems' => 0, |
|
| 150 | - 'maxitems' => 1, |
|
| 151 | - 'wizards' => [ |
|
| 152 | - 'edit' => [ |
|
| 153 | - 'type' => 'popup', |
|
| 154 | - 'module' => [ |
|
| 155 | - 'name' => 'wizard_edit', |
|
| 156 | - ], |
|
| 157 | - 'icon' => 'edit2.gif', |
|
| 158 | - 'popup_onlyOpenIfSelected' => 1, |
|
| 159 | - 'notNewRecords' => 1, |
|
| 160 | - 'JSopenParams' => 'height=500,width=800,status=0,menubar=0,scrollbars=1,resizable=yes' |
|
| 161 | - ], |
|
| 162 | - ], |
|
| 163 | - ], |
|
| 164 | - ], |
|
| 165 | - 'mount_point_file_type_4' => [ |
|
| 166 | - 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang_db.xlf:sys_file_storage.mount_point_file_type_4', |
|
| 167 | - 'config' => [ |
|
| 168 | - 'type' => 'group', |
|
| 169 | - 'allowed' => 'sys_filemounts', |
|
| 170 | - 'size' => 1, |
|
| 171 | - 'minitems' => 0, |
|
| 172 | - 'maxitems' => 1, |
|
| 173 | - 'wizards' => [ |
|
| 174 | - 'edit' => [ |
|
| 175 | - 'type' => 'popup', |
|
| 176 | - 'module' => [ |
|
| 177 | - 'name' => 'wizard_edit', |
|
| 178 | - ], |
|
| 179 | - 'icon' => 'edit2.gif', |
|
| 180 | - 'popup_onlyOpenIfSelected' => 1, |
|
| 181 | - 'notNewRecords' => 1, |
|
| 182 | - 'JSopenParams' => 'height=500,width=800,status=0,menubar=0,scrollbars=1,resizable=yes' |
|
| 183 | - ], |
|
| 184 | - ], |
|
| 185 | - ], |
|
| 186 | - ], |
|
| 187 | - 'mount_point_file_type_5' => [ |
|
| 188 | - 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang_db.xlf:sys_file_storage.mount_point_file_type_5', |
|
| 189 | - 'config' => [ |
|
| 190 | - 'type' => 'group', |
|
| 191 | - 'allowed' => 'sys_filemounts', |
|
| 192 | - 'size' => 1, |
|
| 193 | - 'minitems' => 0, |
|
| 194 | - 'maxitems' => 1, |
|
| 195 | - 'wizards' => [ |
|
| 196 | - 'edit' => [ |
|
| 197 | - 'type' => 'popup', |
|
| 198 | - 'module' => [ |
|
| 199 | - 'name' => 'wizard_edit', |
|
| 200 | - ], |
|
| 201 | - 'icon' => 'edit2.gif', |
|
| 202 | - 'popup_onlyOpenIfSelected' => 1, |
|
| 203 | - 'notNewRecords' => 1, |
|
| 204 | - 'JSopenParams' => 'height=500,width=800,status=0,menubar=0,scrollbars=1,resizable=yes' |
|
| 205 | - ], |
|
| 206 | - ], |
|
| 207 | - ], |
|
| 208 | - ], |
|
| 209 | - ], |
|
| 210 | - ]; |
|
| 96 | + ], |
|
| 97 | + ], |
|
| 98 | + 'columns' => [ |
|
| 99 | + 'mount_point_file_type_1' => [ |
|
| 100 | + 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang_db.xlf:sys_file_storage.mount_point_file_type_1', |
|
| 101 | + 'config' => [ |
|
| 102 | + 'type' => 'group', |
|
| 103 | + 'allowed' => 'sys_filemounts', |
|
| 104 | + 'size' => 1, |
|
| 105 | + 'minitems' => 0, |
|
| 106 | + 'maxitems' => 1, |
|
| 107 | + 'wizards' => [ |
|
| 108 | + 'edit' => [ |
|
| 109 | + 'type' => 'popup', |
|
| 110 | + 'module' => [ |
|
| 111 | + 'name' => 'wizard_edit', |
|
| 112 | + ], |
|
| 113 | + 'icon' => 'edit2.gif', |
|
| 114 | + 'popup_onlyOpenIfSelected' => 1, |
|
| 115 | + 'notNewRecords' => 1, |
|
| 116 | + 'JSopenParams' => 'height=500,width=800,status=0,menubar=0,scrollbars=1,resizable=yes' |
|
| 117 | + ], |
|
| 118 | + ], |
|
| 119 | + ], |
|
| 120 | + ], |
|
| 121 | + 'mount_point_file_type_2' => [ |
|
| 122 | + 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang_db.xlf:sys_file_storage.mount_point_file_type_2', |
|
| 123 | + 'config' => [ |
|
| 124 | + 'type' => 'group', |
|
| 125 | + 'allowed' => 'sys_filemounts', |
|
| 126 | + 'size' => 1, |
|
| 127 | + 'minitems' => 0, |
|
| 128 | + 'maxitems' => 1, |
|
| 129 | + 'wizards' => [ |
|
| 130 | + 'edit' => [ |
|
| 131 | + 'type' => 'popup', |
|
| 132 | + 'module' => [ |
|
| 133 | + 'name' => 'wizard_edit', |
|
| 134 | + ], |
|
| 135 | + 'icon' => 'edit2.gif', |
|
| 136 | + 'popup_onlyOpenIfSelected' => 1, |
|
| 137 | + 'notNewRecords' => 1, |
|
| 138 | + 'JSopenParams' => 'height=500,width=800,status=0,menubar=0,scrollbars=1,resizable=yes' |
|
| 139 | + ], |
|
| 140 | + ], |
|
| 141 | + ], |
|
| 142 | + ], |
|
| 143 | + 'mount_point_file_type_3' => [ |
|
| 144 | + 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang_db.xlf:sys_file_storage.mount_point_file_type_3', |
|
| 145 | + 'config' => [ |
|
| 146 | + 'type' => 'group', |
|
| 147 | + 'allowed' => 'sys_filemounts', |
|
| 148 | + 'size' => 1, |
|
| 149 | + 'minitems' => 0, |
|
| 150 | + 'maxitems' => 1, |
|
| 151 | + 'wizards' => [ |
|
| 152 | + 'edit' => [ |
|
| 153 | + 'type' => 'popup', |
|
| 154 | + 'module' => [ |
|
| 155 | + 'name' => 'wizard_edit', |
|
| 156 | + ], |
|
| 157 | + 'icon' => 'edit2.gif', |
|
| 158 | + 'popup_onlyOpenIfSelected' => 1, |
|
| 159 | + 'notNewRecords' => 1, |
|
| 160 | + 'JSopenParams' => 'height=500,width=800,status=0,menubar=0,scrollbars=1,resizable=yes' |
|
| 161 | + ], |
|
| 162 | + ], |
|
| 163 | + ], |
|
| 164 | + ], |
|
| 165 | + 'mount_point_file_type_4' => [ |
|
| 166 | + 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang_db.xlf:sys_file_storage.mount_point_file_type_4', |
|
| 167 | + 'config' => [ |
|
| 168 | + 'type' => 'group', |
|
| 169 | + 'allowed' => 'sys_filemounts', |
|
| 170 | + 'size' => 1, |
|
| 171 | + 'minitems' => 0, |
|
| 172 | + 'maxitems' => 1, |
|
| 173 | + 'wizards' => [ |
|
| 174 | + 'edit' => [ |
|
| 175 | + 'type' => 'popup', |
|
| 176 | + 'module' => [ |
|
| 177 | + 'name' => 'wizard_edit', |
|
| 178 | + ], |
|
| 179 | + 'icon' => 'edit2.gif', |
|
| 180 | + 'popup_onlyOpenIfSelected' => 1, |
|
| 181 | + 'notNewRecords' => 1, |
|
| 182 | + 'JSopenParams' => 'height=500,width=800,status=0,menubar=0,scrollbars=1,resizable=yes' |
|
| 183 | + ], |
|
| 184 | + ], |
|
| 185 | + ], |
|
| 186 | + ], |
|
| 187 | + 'mount_point_file_type_5' => [ |
|
| 188 | + 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang_db.xlf:sys_file_storage.mount_point_file_type_5', |
|
| 189 | + 'config' => [ |
|
| 190 | + 'type' => 'group', |
|
| 191 | + 'allowed' => 'sys_filemounts', |
|
| 192 | + 'size' => 1, |
|
| 193 | + 'minitems' => 0, |
|
| 194 | + 'maxitems' => 1, |
|
| 195 | + 'wizards' => [ |
|
| 196 | + 'edit' => [ |
|
| 197 | + 'type' => 'popup', |
|
| 198 | + 'module' => [ |
|
| 199 | + 'name' => 'wizard_edit', |
|
| 200 | + ], |
|
| 201 | + 'icon' => 'edit2.gif', |
|
| 202 | + 'popup_onlyOpenIfSelected' => 1, |
|
| 203 | + 'notNewRecords' => 1, |
|
| 204 | + 'JSopenParams' => 'height=500,width=800,status=0,menubar=0,scrollbars=1,resizable=yes' |
|
| 205 | + ], |
|
| 206 | + ], |
|
| 207 | + ], |
|
| 208 | + ], |
|
| 209 | + ], |
|
| 210 | + ]; |
|
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | // Merge first two possible TCA whether the folder tree is displayed or not. |
@@ -4,36 +4,36 @@ |
||
| 4 | 4 | use TYPO3\CMS\Core\Utility\ArrayUtility; |
| 5 | 5 | |
| 6 | 6 | if (!defined('TYPO3')) { |
| 7 | - die('Access denied.'); |
|
| 7 | + die('Access denied.'); |
|
| 8 | 8 | } |
| 9 | 9 | |
| 10 | 10 | // We only want to have file relations if extension File advanced metadata is loaded. |
| 11 | 11 | if (ExtensionManagementUtility::isLoaded('filemetadata')) { |
| 12 | - $configuration = '--div--;LLL:EXT:media/Resources/Private/Language/locallang_db.xlf:tab.relations, related_files'; |
|
| 13 | - ExtensionManagementUtility::addToAllTCAtypes('sys_file_metadata', $configuration); |
|
| 12 | + $configuration = '--div--;LLL:EXT:media/Resources/Private/Language/locallang_db.xlf:tab.relations, related_files'; |
|
| 13 | + ExtensionManagementUtility::addToAllTCAtypes('sys_file_metadata', $configuration); |
|
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | $tca = [ |
| 17 | - 'ctrl' => [ |
|
| 18 | - 'default_sortby' => 'ORDER BY uid DESC', |
|
| 19 | - 'searchFields' => 'uid,extension,name', // sys_file_metadata.title,sys_file_metadata.keywords, |
|
| 20 | - ], |
|
| 21 | - 'columns' => [ |
|
| 22 | - 'fileinfo' => [ |
|
| 23 | - 'config' => [ |
|
| 24 | - 'type' => 'user', |
|
| 25 | - 'renderType' => 'findUploader', |
|
| 26 | - ], |
|
| 27 | - ], |
|
| 28 | - 'related_files' => [ |
|
| 29 | - 'displayCond' => 'FIELD:sys_language_uid:<=:0', |
|
| 30 | - 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang_db.xlf:sys_file_metadata.relations', |
|
| 31 | - 'config' => ExtensionManagementUtility::getFileFieldTCAConfig( |
|
| 32 | - 'related_files', |
|
| 33 | - [], |
|
| 34 | - '' |
|
| 35 | - ), |
|
| 36 | - ], |
|
| 37 | - ], |
|
| 17 | + 'ctrl' => [ |
|
| 18 | + 'default_sortby' => 'ORDER BY uid DESC', |
|
| 19 | + 'searchFields' => 'uid,extension,name', // sys_file_metadata.title,sys_file_metadata.keywords, |
|
| 20 | + ], |
|
| 21 | + 'columns' => [ |
|
| 22 | + 'fileinfo' => [ |
|
| 23 | + 'config' => [ |
|
| 24 | + 'type' => 'user', |
|
| 25 | + 'renderType' => 'findUploader', |
|
| 26 | + ], |
|
| 27 | + ], |
|
| 28 | + 'related_files' => [ |
|
| 29 | + 'displayCond' => 'FIELD:sys_language_uid:<=:0', |
|
| 30 | + 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang_db.xlf:sys_file_metadata.relations', |
|
| 31 | + 'config' => ExtensionManagementUtility::getFileFieldTCAConfig( |
|
| 32 | + 'related_files', |
|
| 33 | + [], |
|
| 34 | + '' |
|
| 35 | + ), |
|
| 36 | + ], |
|
| 37 | + ], |
|
| 38 | 38 | ]; |
| 39 | 39 | ArrayUtility::mergeRecursiveWithOverrule($GLOBALS['TCA']['sys_file_metadata'], $tca); |
@@ -3,13 +3,13 @@ |
||
| 3 | 3 | use TYPO3\CMS\Core\Utility\ArrayUtility; |
| 4 | 4 | |
| 5 | 5 | if (!defined('TYPO3')) { |
| 6 | - die('Access denied.'); |
|
| 6 | + die('Access denied.'); |
|
| 7 | 7 | } |
| 8 | 8 | |
| 9 | 9 | $tca = [ |
| 10 | - 'ctrl' => [ |
|
| 11 | - 'rootLevel' => -1, // Otherwise File Reference will not work between files. |
|
| 12 | - ], |
|
| 10 | + 'ctrl' => [ |
|
| 11 | + 'rootLevel' => -1, // Otherwise File Reference will not work between files. |
|
| 12 | + ], |
|
| 13 | 13 | ]; |
| 14 | 14 | |
| 15 | 15 | // Disable the File Upload in IRRE since it can not be configured the target storage. |
@@ -14,229 +14,229 @@ |
||
| 14 | 14 | use Fab\Vidi\Grid\ButtonGroupRenderer; |
| 15 | 15 | |
| 16 | 16 | if (!defined('TYPO3')) { |
| 17 | - die('Access denied.'); |
|
| 17 | + die('Access denied.'); |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | $tca = [ |
| 21 | - 'ctrl' => [ |
|
| 22 | - 'default_sortby' => 'uid DESC', |
|
| 23 | - // Beware that "metadata.categories" is quite expansive performance wise. |
|
| 24 | - 'searchFields' => 'uid, extension, name, metadata.title, metadata.description, metadata.categories', |
|
| 25 | - ], |
|
| 26 | - 'columns' => [ |
|
| 27 | - 'extension' => [ |
|
| 28 | - 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:sys_file.extension', |
|
| 29 | - 'config' => [ |
|
| 30 | - 'type' => 'input', |
|
| 31 | - 'size' => 255, |
|
| 32 | - 'eval' => 'trim', |
|
| 33 | - ], |
|
| 34 | - ], |
|
| 35 | - 'number_of_references' => [ |
|
| 36 | - 'config' => [ |
|
| 37 | - 'type' => 'input', |
|
| 38 | - 'size' => 255, |
|
| 39 | - 'readOnly' => true, |
|
| 40 | - ], |
|
| 41 | - ], |
|
| 42 | - ], |
|
| 43 | - 'vidi' => [ |
|
| 44 | - // For actions such as update, remove, copy, move, the DataHandler of the Core is configured to be used by default. |
|
| 45 | - // It will work fine in most cases. However, there is the chance to set your own Data Handler if there are special needs (@see FileDataHandler in EXT:media) |
|
| 46 | - // Another reasons, would be for speed. You will notice a performance cost when mass editing data using the Core DataHandler. |
|
| 47 | - // Using your own DataHandler would make the mass processing much faster. |
|
| 48 | - 'data_handler' => [ |
|
| 49 | - // For all actions |
|
| 50 | - '*' => 'Fab\Media\DataHandler\FileDataHandler' |
|
| 51 | - ], |
|
| 52 | - ], |
|
| 53 | - 'grid' => [ |
|
| 54 | - 'excluded_fields' => 'number_of_references, missing', |
|
| 55 | - 'facets' => [ |
|
| 56 | - 'metadata.title', |
|
| 57 | - 'metadata.categories', |
|
| 58 | - 'name', |
|
| 59 | - StandardFacet::class => [ |
|
| 60 | - 'name' => 'extension', |
|
| 61 | - 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:sys_file.extension' |
|
| 62 | - ], |
|
| 63 | - 'metadata.description', |
|
| 64 | - 'identifier', |
|
| 65 | - StandardFacet::class => [ |
|
| 66 | - 'name' => 'number_of_references', |
|
| 67 | - 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:usage', |
|
| 68 | - 'suggestions' => ['0', '1', '2', '3', 'etc...'] // auto-suggestions |
|
| 69 | - ], |
|
| 21 | + 'ctrl' => [ |
|
| 22 | + 'default_sortby' => 'uid DESC', |
|
| 23 | + // Beware that "metadata.categories" is quite expansive performance wise. |
|
| 24 | + 'searchFields' => 'uid, extension, name, metadata.title, metadata.description, metadata.categories', |
|
| 25 | + ], |
|
| 26 | + 'columns' => [ |
|
| 27 | + 'extension' => [ |
|
| 28 | + 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:sys_file.extension', |
|
| 29 | + 'config' => [ |
|
| 30 | + 'type' => 'input', |
|
| 31 | + 'size' => 255, |
|
| 32 | + 'eval' => 'trim', |
|
| 33 | + ], |
|
| 34 | + ], |
|
| 35 | + 'number_of_references' => [ |
|
| 36 | + 'config' => [ |
|
| 37 | + 'type' => 'input', |
|
| 38 | + 'size' => 255, |
|
| 39 | + 'readOnly' => true, |
|
| 40 | + ], |
|
| 41 | + ], |
|
| 42 | + ], |
|
| 43 | + 'vidi' => [ |
|
| 44 | + // For actions such as update, remove, copy, move, the DataHandler of the Core is configured to be used by default. |
|
| 45 | + // It will work fine in most cases. However, there is the chance to set your own Data Handler if there are special needs (@see FileDataHandler in EXT:media) |
|
| 46 | + // Another reasons, would be for speed. You will notice a performance cost when mass editing data using the Core DataHandler. |
|
| 47 | + // Using your own DataHandler would make the mass processing much faster. |
|
| 48 | + 'data_handler' => [ |
|
| 49 | + // For all actions |
|
| 50 | + '*' => 'Fab\Media\DataHandler\FileDataHandler' |
|
| 51 | + ], |
|
| 52 | + ], |
|
| 53 | + 'grid' => [ |
|
| 54 | + 'excluded_fields' => 'number_of_references, missing', |
|
| 55 | + 'facets' => [ |
|
| 56 | + 'metadata.title', |
|
| 57 | + 'metadata.categories', |
|
| 58 | + 'name', |
|
| 59 | + StandardFacet::class => [ |
|
| 60 | + 'name' => 'extension', |
|
| 61 | + 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:sys_file.extension' |
|
| 62 | + ], |
|
| 63 | + 'metadata.description', |
|
| 64 | + 'identifier', |
|
| 65 | + StandardFacet::class => [ |
|
| 66 | + 'name' => 'number_of_references', |
|
| 67 | + 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:usage', |
|
| 68 | + 'suggestions' => ['0', '1', '2', '3', 'etc...'] // auto-suggestions |
|
| 69 | + ], |
|
| 70 | 70 | |
| 71 | - StandardFacet::class => [ |
|
| 72 | - 'name' => 'type', |
|
| 73 | - 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:type', |
|
| 74 | - 'suggestions' => [ |
|
| 75 | - File::FILETYPE_TEXT => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:type_1', |
|
| 76 | - File::FILETYPE_IMAGE => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:type_2', |
|
| 77 | - File::FILETYPE_AUDIO => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:type_3', |
|
| 78 | - File::FILETYPE_VIDEO => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:type_4', |
|
| 79 | - File::FILETYPE_APPLICATION => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:type_5', |
|
| 80 | - ] |
|
| 81 | - ], |
|
| 82 | - ActionPermissionFacet::class => [], |
|
| 83 | - 'uid', |
|
| 84 | - ], |
|
| 85 | - 'columns' => [ |
|
| 86 | - '__checkbox' => [ |
|
| 87 | - 'renderer' => CheckBoxRenderer::class, |
|
| 88 | - ], |
|
| 89 | - 'uid' => [ |
|
| 90 | - 'visible' => false, |
|
| 91 | - 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:uid', |
|
| 92 | - 'width' => '5px', |
|
| 93 | - ], |
|
| 94 | - 'identifier' => [ |
|
| 95 | - 'visible' => false, |
|
| 96 | - ], |
|
| 97 | - 'fileinfo' => [ |
|
| 98 | - 'renderer' => PreviewRenderer::class, |
|
| 99 | - 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:preview', |
|
| 100 | - 'wrap' => '<div class="center preview">|</div>', |
|
| 101 | - 'width' => '150px', |
|
| 102 | - 'sortable' => false, |
|
| 103 | - ], |
|
| 104 | - 'metadata.title' => [ |
|
| 105 | - 'renderer' => MetadataRenderer::class, |
|
| 106 | - 'rendererConfiguration' => [ |
|
| 107 | - 'property' => 'title', |
|
| 108 | - ], |
|
| 109 | - 'width' => '400px', |
|
| 110 | - 'editable' => true, |
|
| 111 | - 'sortable' => true, |
|
| 112 | - ], |
|
| 113 | - 'metadata.description' => [ |
|
| 114 | - 'renderer' => MetadataRenderer::class, |
|
| 115 | - 'rendererConfiguration' => [ |
|
| 116 | - 'property' => 'description', |
|
| 117 | - ], |
|
| 118 | - 'visible' => false, |
|
| 119 | - 'sortable' => false, |
|
| 120 | - ], |
|
| 121 | - 'tstamp' => [ |
|
| 122 | - 'visible' => false, |
|
| 123 | - 'format' => 'Fab\Vidi\Formatter\Date', |
|
| 124 | - 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:sys_file.tstamp', |
|
| 125 | - ], |
|
| 126 | - 'metadata.categories' => [ |
|
| 127 | - 'renderers' => [ |
|
| 128 | - RelationEditRenderer::class, |
|
| 129 | - CategoryRenderer::class, |
|
| 130 | - ], |
|
| 131 | - 'editable' => true, |
|
| 132 | - 'visible' => true, |
|
| 133 | - 'sortable' => false, |
|
| 134 | - ], |
|
| 135 | - 'usage' => [ |
|
| 136 | - 'renderer' => 'Fab\Media\Grid\UsageRenderer', |
|
| 137 | - 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:usage', |
|
| 138 | - 'visible' => true, |
|
| 139 | - 'sortable' => false, |
|
| 140 | - ], |
|
| 141 | - 'metadata' => [ |
|
| 142 | - 'label' => 'Metadata File Identifier', |
|
| 143 | - 'renderer' => MetadataRenderer::class, |
|
| 144 | - 'rendererConfiguration' => [ |
|
| 145 | - 'property' => 'uid', |
|
| 146 | - ], |
|
| 147 | - 'visible' => false, |
|
| 148 | - 'sortable' => false, |
|
| 149 | - ], |
|
| 150 | - '__action_permission' => [ |
|
| 151 | - 'renderer' => 'Fab\Media\Grid\ActionPermissionColumn', |
|
| 152 | - 'visible' => false, |
|
| 153 | - 'sortable' => false, |
|
| 154 | - 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:permission', |
|
| 155 | - ], |
|
| 156 | - ] |
|
| 157 | - ] |
|
| 71 | + StandardFacet::class => [ |
|
| 72 | + 'name' => 'type', |
|
| 73 | + 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:type', |
|
| 74 | + 'suggestions' => [ |
|
| 75 | + File::FILETYPE_TEXT => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:type_1', |
|
| 76 | + File::FILETYPE_IMAGE => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:type_2', |
|
| 77 | + File::FILETYPE_AUDIO => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:type_3', |
|
| 78 | + File::FILETYPE_VIDEO => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:type_4', |
|
| 79 | + File::FILETYPE_APPLICATION => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:type_5', |
|
| 80 | + ] |
|
| 81 | + ], |
|
| 82 | + ActionPermissionFacet::class => [], |
|
| 83 | + 'uid', |
|
| 84 | + ], |
|
| 85 | + 'columns' => [ |
|
| 86 | + '__checkbox' => [ |
|
| 87 | + 'renderer' => CheckBoxRenderer::class, |
|
| 88 | + ], |
|
| 89 | + 'uid' => [ |
|
| 90 | + 'visible' => false, |
|
| 91 | + 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:uid', |
|
| 92 | + 'width' => '5px', |
|
| 93 | + ], |
|
| 94 | + 'identifier' => [ |
|
| 95 | + 'visible' => false, |
|
| 96 | + ], |
|
| 97 | + 'fileinfo' => [ |
|
| 98 | + 'renderer' => PreviewRenderer::class, |
|
| 99 | + 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:preview', |
|
| 100 | + 'wrap' => '<div class="center preview">|</div>', |
|
| 101 | + 'width' => '150px', |
|
| 102 | + 'sortable' => false, |
|
| 103 | + ], |
|
| 104 | + 'metadata.title' => [ |
|
| 105 | + 'renderer' => MetadataRenderer::class, |
|
| 106 | + 'rendererConfiguration' => [ |
|
| 107 | + 'property' => 'title', |
|
| 108 | + ], |
|
| 109 | + 'width' => '400px', |
|
| 110 | + 'editable' => true, |
|
| 111 | + 'sortable' => true, |
|
| 112 | + ], |
|
| 113 | + 'metadata.description' => [ |
|
| 114 | + 'renderer' => MetadataRenderer::class, |
|
| 115 | + 'rendererConfiguration' => [ |
|
| 116 | + 'property' => 'description', |
|
| 117 | + ], |
|
| 118 | + 'visible' => false, |
|
| 119 | + 'sortable' => false, |
|
| 120 | + ], |
|
| 121 | + 'tstamp' => [ |
|
| 122 | + 'visible' => false, |
|
| 123 | + 'format' => 'Fab\Vidi\Formatter\Date', |
|
| 124 | + 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:sys_file.tstamp', |
|
| 125 | + ], |
|
| 126 | + 'metadata.categories' => [ |
|
| 127 | + 'renderers' => [ |
|
| 128 | + RelationEditRenderer::class, |
|
| 129 | + CategoryRenderer::class, |
|
| 130 | + ], |
|
| 131 | + 'editable' => true, |
|
| 132 | + 'visible' => true, |
|
| 133 | + 'sortable' => false, |
|
| 134 | + ], |
|
| 135 | + 'usage' => [ |
|
| 136 | + 'renderer' => 'Fab\Media\Grid\UsageRenderer', |
|
| 137 | + 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:usage', |
|
| 138 | + 'visible' => true, |
|
| 139 | + 'sortable' => false, |
|
| 140 | + ], |
|
| 141 | + 'metadata' => [ |
|
| 142 | + 'label' => 'Metadata File Identifier', |
|
| 143 | + 'renderer' => MetadataRenderer::class, |
|
| 144 | + 'rendererConfiguration' => [ |
|
| 145 | + 'property' => 'uid', |
|
| 146 | + ], |
|
| 147 | + 'visible' => false, |
|
| 148 | + 'sortable' => false, |
|
| 149 | + ], |
|
| 150 | + '__action_permission' => [ |
|
| 151 | + 'renderer' => 'Fab\Media\Grid\ActionPermissionColumn', |
|
| 152 | + 'visible' => false, |
|
| 153 | + 'sortable' => false, |
|
| 154 | + 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:permission', |
|
| 155 | + ], |
|
| 156 | + ] |
|
| 157 | + ] |
|
| 158 | 158 | ]; |
| 159 | 159 | |
| 160 | 160 | // Add more info to the Grid if EXT:filemetadata is loaded. Notice that the extension is not required but suggested. |
| 161 | 161 | if (ExtensionManagementUtility::isLoaded('filemetadata')) { |
| 162 | - $additionalTca = [ |
|
| 163 | - 'ctrl' => [ |
|
| 164 | - 'searchFields' => $tca['ctrl']['searchFields'] . ', metadata.keywords', |
|
| 165 | - ], |
|
| 166 | - 'grid' => [ |
|
| 167 | - 'columns' => [ |
|
| 168 | - 'metadata.keywords' => [ |
|
| 169 | - 'renderer' => MetadataRenderer::class, |
|
| 170 | - 'configuration' => [ |
|
| 171 | - 'property' => 'keywords', |
|
| 172 | - ], |
|
| 173 | - 'label' => 'LLL:EXT:filemetadata/Resources/Private/Language/locallang_tca.xlf:sys_file_metadata.keywords', |
|
| 174 | - 'visible' => false, |
|
| 175 | - 'sortable' => false, |
|
| 176 | - ], |
|
| 177 | - 'metadata.fe_groups' => [ |
|
| 178 | - 'renderers' => [ |
|
| 179 | - RelationEditRenderer::class, |
|
| 180 | - FrontendPermissionRenderer::class, |
|
| 181 | - ], |
|
| 182 | - 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:permissions_fe_groups', |
|
| 183 | - 'visible' => false, |
|
| 184 | - 'sortable' => false, |
|
| 185 | - ], |
|
| 186 | - 'metadata.status' => [ |
|
| 187 | - 'renderer' => MetadataRenderer::class, |
|
| 188 | - 'rendererConfiguration' => [ |
|
| 189 | - 'property' => 'status', |
|
| 190 | - ], |
|
| 191 | - 'label' => 'LLL:EXT:filemetadata/Resources/Private/Language/locallang_tca.xlf:sys_file_metadata.status', |
|
| 192 | - 'visible' => false, |
|
| 193 | - 'width' => '5%', |
|
| 194 | - 'sortable' => false, |
|
| 195 | - ], |
|
| 196 | - # un-comment me to see the "visible" flag in the grid. |
|
| 197 | - #'visible' => array( |
|
| 198 | - # 'renderer' => 'Fab\Media\Grid\VisibilityRenderer', @todo will not work out of the box after 6.2 migration |
|
| 199 | - # 'label' => 'LLL:EXT:vidi/Resources/Private/Language/locallang.xlf:visibility_abbreviation', |
|
| 200 | - # 'width' => '3%', |
|
| 201 | - #), |
|
| 202 | - 'metadata.creator_tool' => [ |
|
| 203 | - 'renderer' => MetadataRenderer::class, |
|
| 204 | - 'rendererConfiguration' => [ |
|
| 205 | - 'property' => 'creator_tool', |
|
| 206 | - ], |
|
| 207 | - 'label' => 'LLL:EXT:filemetadata/Resources/Private/Language/locallang_tca.xlf:sys_file_metadata.creator_tool', |
|
| 208 | - 'visible' => false, |
|
| 209 | - 'sortable' => false, |
|
| 210 | - ], |
|
| 211 | - 'metadata.content_creation_date' => [ |
|
| 212 | - 'renderer' => MetadataRenderer::class, |
|
| 213 | - 'rendererConfiguration' => [ |
|
| 214 | - 'property' => 'content_creation_date', |
|
| 215 | - ], |
|
| 216 | - 'label' => 'LLL:EXT:filemetadata/Resources/Private/Language/locallang_tca.xlf:sys_file_metadata.content_creation_date', |
|
| 217 | - 'visible' => false, |
|
| 218 | - 'format' => 'datetime', |
|
| 219 | - 'sortable' => false, |
|
| 220 | - ], |
|
| 221 | - 'metadata.content_modification_date' => [ |
|
| 222 | - 'renderer' => MetadataRenderer::class, |
|
| 223 | - 'rendererConfiguration' => [ |
|
| 224 | - 'property' => 'content_modification_date', |
|
| 225 | - ], |
|
| 226 | - 'label' => 'LLL:EXT:filemetadata/Resources/Private/Language/locallang_tca.xlf:sys_file_metadata.content_modification_date', |
|
| 227 | - 'visible' => false, |
|
| 228 | - 'format' => 'datetime', |
|
| 229 | - 'sortable' => false, |
|
| 230 | - ], |
|
| 231 | - ] |
|
| 232 | - ] |
|
| 233 | - ]; |
|
| 234 | - ArrayUtility::mergeRecursiveWithOverrule($tca, $additionalTca); |
|
| 162 | + $additionalTca = [ |
|
| 163 | + 'ctrl' => [ |
|
| 164 | + 'searchFields' => $tca['ctrl']['searchFields'] . ', metadata.keywords', |
|
| 165 | + ], |
|
| 166 | + 'grid' => [ |
|
| 167 | + 'columns' => [ |
|
| 168 | + 'metadata.keywords' => [ |
|
| 169 | + 'renderer' => MetadataRenderer::class, |
|
| 170 | + 'configuration' => [ |
|
| 171 | + 'property' => 'keywords', |
|
| 172 | + ], |
|
| 173 | + 'label' => 'LLL:EXT:filemetadata/Resources/Private/Language/locallang_tca.xlf:sys_file_metadata.keywords', |
|
| 174 | + 'visible' => false, |
|
| 175 | + 'sortable' => false, |
|
| 176 | + ], |
|
| 177 | + 'metadata.fe_groups' => [ |
|
| 178 | + 'renderers' => [ |
|
| 179 | + RelationEditRenderer::class, |
|
| 180 | + FrontendPermissionRenderer::class, |
|
| 181 | + ], |
|
| 182 | + 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:permissions_fe_groups', |
|
| 183 | + 'visible' => false, |
|
| 184 | + 'sortable' => false, |
|
| 185 | + ], |
|
| 186 | + 'metadata.status' => [ |
|
| 187 | + 'renderer' => MetadataRenderer::class, |
|
| 188 | + 'rendererConfiguration' => [ |
|
| 189 | + 'property' => 'status', |
|
| 190 | + ], |
|
| 191 | + 'label' => 'LLL:EXT:filemetadata/Resources/Private/Language/locallang_tca.xlf:sys_file_metadata.status', |
|
| 192 | + 'visible' => false, |
|
| 193 | + 'width' => '5%', |
|
| 194 | + 'sortable' => false, |
|
| 195 | + ], |
|
| 196 | + # un-comment me to see the "visible" flag in the grid. |
|
| 197 | + #'visible' => array( |
|
| 198 | + # 'renderer' => 'Fab\Media\Grid\VisibilityRenderer', @todo will not work out of the box after 6.2 migration |
|
| 199 | + # 'label' => 'LLL:EXT:vidi/Resources/Private/Language/locallang.xlf:visibility_abbreviation', |
|
| 200 | + # 'width' => '3%', |
|
| 201 | + #), |
|
| 202 | + 'metadata.creator_tool' => [ |
|
| 203 | + 'renderer' => MetadataRenderer::class, |
|
| 204 | + 'rendererConfiguration' => [ |
|
| 205 | + 'property' => 'creator_tool', |
|
| 206 | + ], |
|
| 207 | + 'label' => 'LLL:EXT:filemetadata/Resources/Private/Language/locallang_tca.xlf:sys_file_metadata.creator_tool', |
|
| 208 | + 'visible' => false, |
|
| 209 | + 'sortable' => false, |
|
| 210 | + ], |
|
| 211 | + 'metadata.content_creation_date' => [ |
|
| 212 | + 'renderer' => MetadataRenderer::class, |
|
| 213 | + 'rendererConfiguration' => [ |
|
| 214 | + 'property' => 'content_creation_date', |
|
| 215 | + ], |
|
| 216 | + 'label' => 'LLL:EXT:filemetadata/Resources/Private/Language/locallang_tca.xlf:sys_file_metadata.content_creation_date', |
|
| 217 | + 'visible' => false, |
|
| 218 | + 'format' => 'datetime', |
|
| 219 | + 'sortable' => false, |
|
| 220 | + ], |
|
| 221 | + 'metadata.content_modification_date' => [ |
|
| 222 | + 'renderer' => MetadataRenderer::class, |
|
| 223 | + 'rendererConfiguration' => [ |
|
| 224 | + 'property' => 'content_modification_date', |
|
| 225 | + ], |
|
| 226 | + 'label' => 'LLL:EXT:filemetadata/Resources/Private/Language/locallang_tca.xlf:sys_file_metadata.content_modification_date', |
|
| 227 | + 'visible' => false, |
|
| 228 | + 'format' => 'datetime', |
|
| 229 | + 'sortable' => false, |
|
| 230 | + ], |
|
| 231 | + ] |
|
| 232 | + ] |
|
| 233 | + ]; |
|
| 234 | + ArrayUtility::mergeRecursiveWithOverrule($tca, $additionalTca); |
|
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | // Control buttons such as edit, delete, etc... must be set at the end in any case. |
| 238 | 238 | $tca['grid']['columns']['__buttons'] = [ |
| 239 | - 'renderer' => ButtonGroupRenderer::class, |
|
| 239 | + 'renderer' => ButtonGroupRenderer::class, |
|
| 240 | 240 | ]; |
| 241 | 241 | |
| 242 | 242 | ArrayUtility::mergeRecursiveWithOverrule($GLOBALS['TCA']['sys_file'], $tca); |
@@ -161,7 +161,7 @@ |
||
| 161 | 161 | if (ExtensionManagementUtility::isLoaded('filemetadata')) { |
| 162 | 162 | $additionalTca = [ |
| 163 | 163 | 'ctrl' => [ |
| 164 | - 'searchFields' => $tca['ctrl']['searchFields'] . ', metadata.keywords', |
|
| 164 | + 'searchFields' => $tca['ctrl']['searchFields'].', metadata.keywords', |
|
| 165 | 165 | ], |
| 166 | 166 | 'grid' => [ |
| 167 | 167 | 'columns' => [ |
@@ -51,12 +51,12 @@ discard block |
||
| 51 | 51 | defined('TYPO3') or die(); |
| 52 | 52 | |
| 53 | 53 | call_user_func(function () { |
| 54 | - $configuration = GeneralUtility::makeInstance( |
|
| 55 | - ExtensionConfiguration::class |
|
| 56 | - )->get('media'); |
|
| 54 | + $configuration = GeneralUtility::makeInstance( |
|
| 55 | + ExtensionConfiguration::class |
|
| 56 | + )->get('media'); |
|
| 57 | 57 | |
| 58 | - // Default User TSConfig to be added in any case. |
|
| 59 | - ExtensionManagementUtility::addUserTSConfig(' |
|
| 58 | + // Default User TSConfig to be added in any case. |
|
| 59 | + ExtensionManagementUtility::addUserTSConfig(' |
|
| 60 | 60 | |
| 61 | 61 | # Enable or disabled the Media File Picker in the BE |
| 62 | 62 | options.vidi.enableMediaFilePicker = 1 |
@@ -66,145 +66,145 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | '); |
| 68 | 68 | |
| 69 | - $moduleFileLanguage = 'LLL:EXT:media/Resources/Private/Language/locallang.xlf'; |
|
| 70 | - if ($configuration['hide_file_list'] == 1) { |
|
| 71 | - $moduleFileLanguage = 'LLL:EXT:media/Resources/Private/Language/locallang_filelist.xlf'; |
|
| 69 | + $moduleFileLanguage = 'LLL:EXT:media/Resources/Private/Language/locallang.xlf'; |
|
| 70 | + if ($configuration['hide_file_list'] == 1) { |
|
| 71 | + $moduleFileLanguage = 'LLL:EXT:media/Resources/Private/Language/locallang_filelist.xlf'; |
|
| 72 | 72 | |
| 73 | - // Default User TSConfig to be added in any case. |
|
| 74 | - ExtensionManagementUtility::addUserTSConfig(' |
|
| 73 | + // Default User TSConfig to be added in any case. |
|
| 74 | + ExtensionManagementUtility::addUserTSConfig(' |
|
| 75 | 75 | |
| 76 | 76 | # Hide default File List |
| 77 | 77 | options.hideModules.file := addToList(FilelistList) |
| 78 | 78 | '); |
| 79 | - } |
|
| 80 | - |
|
| 81 | - ExtensionUtility::registerModule( |
|
| 82 | - 'Media', |
|
| 83 | - 'user', // Make media module a submodule of 'user' |
|
| 84 | - 'm1', |
|
| 85 | - 'bottom', // Position |
|
| 86 | - [ |
|
| 87 | - AssetController::class => 'create, update, download, editStorage', |
|
| 88 | - ImageEditorController::class => 'show', |
|
| 89 | - LinkCreatorController::class => 'show', |
|
| 90 | - ProcessedFileController::class => 'create', |
|
| 91 | - ], |
|
| 92 | - [ |
|
| 93 | - 'access' => 'user,group', |
|
| 94 | - 'icon' => 'EXT:media/Resources/Public/Icons/Extension.svg', |
|
| 95 | - 'labels' => 'LLL:EXT:media/Resources/Private/Language/locallang_module.xlf', |
|
| 96 | - ] |
|
| 97 | - ); |
|
| 98 | - |
|
| 99 | - $defaultMainModule = (bool)$configuration['has_folder_tree'] ? 'file' : 'content'; |
|
| 100 | - |
|
| 101 | - /** @var ModuleLoader $moduleLoader */ |
|
| 102 | - $moduleLoader = GeneralUtility::makeInstance( |
|
| 103 | - ModuleLoader::class, |
|
| 104 | - 'sys_file' |
|
| 105 | - ); |
|
| 106 | - $moduleLoader->setIcon('EXT:media/Resources/Public/Icons/Extension.svg') |
|
| 107 | - ->setModuleLanguageFile($moduleFileLanguage) |
|
| 108 | - ->setMainModule($defaultMainModule) |
|
| 109 | - ->addJavaScriptFiles([ |
|
| 110 | - 'EXT:media/Resources/Public/Libraries/Fineuploader/jquery.fineuploader-5.0.9.min.js', |
|
| 111 | - ]) |
|
| 112 | - ->addStyleSheetFiles([ |
|
| 113 | - 'EXT:media/Resources/Public/StyleSheets/media.css', |
|
| 114 | - 'EXT:media/Resources/Public/StyleSheets/fineuploader.css', |
|
| 115 | - ]) |
|
| 116 | - ->setDocHeaderTopLeftComponents( |
|
| 117 | - [ |
|
| 118 | - StorageMenu::class, |
|
| 119 | - RecursiveCheckbox::class,] |
|
| 120 | - ) |
|
| 121 | - ->setDocHeaderBottomLeftComponents([ |
|
| 122 | - ClipboardButton::class, |
|
| 123 | - NewFolder::class, |
|
| 124 | - UploadButton::class, |
|
| 125 | - ]) |
|
| 126 | - ->setGridTopComponents([ |
|
| 127 | - InlineJavaScript::class, |
|
| 128 | - ConfigurationWarning::class, |
|
| 129 | - SelectedFolderInfo::class, |
|
| 130 | - ]) |
|
| 131 | - ->setGridBottomComponents([ |
|
| 132 | - LinkCreatorPlugin::class, |
|
| 133 | - ImageEditorPlugin::class, |
|
| 134 | - FilePickerPlugin::class, |
|
| 135 | - ]) |
|
| 136 | - ->setGridButtonsComponents([ |
|
| 137 | - LinkCreatorButton::class, |
|
| 138 | - ImageEditorButton::class, |
|
| 139 | - FilePickerButton::class, |
|
| 140 | - EditButton::class, |
|
| 141 | - DownloadButton::class, |
|
| 142 | - DeleteButton::class, |
|
| 143 | - ]) |
|
| 144 | - ->setMenuMassActionComponents([ |
|
| 145 | - ExportXlsMenuItem::class, |
|
| 146 | - ExportXmlMenuItem::class, |
|
| 147 | - ExportCsvMenuItem::class, |
|
| 148 | - DividerMenuItem::class, |
|
| 149 | - |
|
| 150 | - // Media custom View Helper |
|
| 151 | - ClipboardMenuItem::class, |
|
| 152 | - FilePickerMenuItem::class, |
|
| 153 | - ChangeStorageMenuItem::class, |
|
| 154 | - MassDeleteMenuItem::class, |
|
| 155 | - ]) |
|
| 156 | - ->register(); |
|
| 157 | - |
|
| 158 | - |
|
| 159 | - /** @var $signalSlotDispatcher \TYPO3\CMS\Extbase\SignalSlot\Dispatcher */ |
|
| 160 | - $signalSlotDispatcher = GeneralUtility::makeInstance(Dispatcher::class); |
|
| 161 | - |
|
| 162 | - # Register some tool for Media. |
|
| 163 | - ToolRegistry::getInstance()->register('sys_file', ThumbnailGeneratorTool::class); |
|
| 164 | - ToolRegistry::getInstance()->register('sys_file', CacheWarmUpTool::class); |
|
| 165 | - ToolRegistry::getInstance()->register('sys_file', MissingFilesFinderTool::class); |
|
| 166 | - ToolRegistry::getInstance()->register('sys_file', DuplicateRecordsFinderTool::class); |
|
| 167 | - ToolRegistry::getInstance()->register('sys_file', DuplicateFilesFinderTool::class); |
|
| 168 | - |
|
| 169 | - // Connect some signals with slots. |
|
| 170 | - $signalSlotDispatcher->connect( |
|
| 171 | - 'Fab\Vidi\Controller\Backend\ContentController', // Small exception in naming here as the class was previously located in "Controller\Backend". |
|
| 172 | - 'postProcessMatcherObject', |
|
| 173 | - FilePermissionsAspect::class, |
|
| 174 | - 'addFilePermissionsForFileStorages' |
|
| 175 | - ); |
|
| 176 | - |
|
| 177 | - $signalSlotDispatcher->connect( |
|
| 178 | - ContentRepository::class, |
|
| 179 | - 'postProcessConstraintsObject', |
|
| 180 | - FilePermissionsAspect::class, |
|
| 181 | - 'addFilePermissionsForFileMounts' |
|
| 182 | - ); |
|
| 183 | - |
|
| 184 | - $signalSlotDispatcher->connect( |
|
| 185 | - ContentService::class, |
|
| 186 | - 'afterFindContentObjects', |
|
| 187 | - ActionPermissionFacet::class, |
|
| 188 | - 'modifyResultSet' |
|
| 189 | - ); |
|
| 190 | - |
|
| 191 | - // Add new sprite icon. |
|
| 192 | - $icons = [ |
|
| 193 | - 'image-edit' => 'EXT:media/Resources/Public/Icons/image_edit.png', |
|
| 194 | - 'image-link' => 'EXT:media/Resources/Public/Icons/image_link.png', |
|
| 195 | - 'image-export' => 'EXT:media/Resources/Public/Icons/image_export.png', |
|
| 196 | - 'storage-change' => 'EXT:media/Resources/Public/Icons/folder_go.png', |
|
| 197 | - ]; |
|
| 198 | - /** @var IconRegistry $iconRegistry */ |
|
| 199 | - $iconRegistry = GeneralUtility::makeInstance(IconRegistry::class); |
|
| 200 | - foreach ($icons as $key => $icon) { |
|
| 201 | - $iconRegistry->registerIcon( |
|
| 202 | - 'extensions-media-' . $key, |
|
| 203 | - BitmapIconProvider::class, |
|
| 204 | - [ |
|
| 205 | - 'source' => $icon |
|
| 206 | - ] |
|
| 207 | - ); |
|
| 208 | - } |
|
| 209 | - unset($iconRegistry); |
|
| 79 | + } |
|
| 80 | + |
|
| 81 | + ExtensionUtility::registerModule( |
|
| 82 | + 'Media', |
|
| 83 | + 'user', // Make media module a submodule of 'user' |
|
| 84 | + 'm1', |
|
| 85 | + 'bottom', // Position |
|
| 86 | + [ |
|
| 87 | + AssetController::class => 'create, update, download, editStorage', |
|
| 88 | + ImageEditorController::class => 'show', |
|
| 89 | + LinkCreatorController::class => 'show', |
|
| 90 | + ProcessedFileController::class => 'create', |
|
| 91 | + ], |
|
| 92 | + [ |
|
| 93 | + 'access' => 'user,group', |
|
| 94 | + 'icon' => 'EXT:media/Resources/Public/Icons/Extension.svg', |
|
| 95 | + 'labels' => 'LLL:EXT:media/Resources/Private/Language/locallang_module.xlf', |
|
| 96 | + ] |
|
| 97 | + ); |
|
| 98 | + |
|
| 99 | + $defaultMainModule = (bool)$configuration['has_folder_tree'] ? 'file' : 'content'; |
|
| 100 | + |
|
| 101 | + /** @var ModuleLoader $moduleLoader */ |
|
| 102 | + $moduleLoader = GeneralUtility::makeInstance( |
|
| 103 | + ModuleLoader::class, |
|
| 104 | + 'sys_file' |
|
| 105 | + ); |
|
| 106 | + $moduleLoader->setIcon('EXT:media/Resources/Public/Icons/Extension.svg') |
|
| 107 | + ->setModuleLanguageFile($moduleFileLanguage) |
|
| 108 | + ->setMainModule($defaultMainModule) |
|
| 109 | + ->addJavaScriptFiles([ |
|
| 110 | + 'EXT:media/Resources/Public/Libraries/Fineuploader/jquery.fineuploader-5.0.9.min.js', |
|
| 111 | + ]) |
|
| 112 | + ->addStyleSheetFiles([ |
|
| 113 | + 'EXT:media/Resources/Public/StyleSheets/media.css', |
|
| 114 | + 'EXT:media/Resources/Public/StyleSheets/fineuploader.css', |
|
| 115 | + ]) |
|
| 116 | + ->setDocHeaderTopLeftComponents( |
|
| 117 | + [ |
|
| 118 | + StorageMenu::class, |
|
| 119 | + RecursiveCheckbox::class,] |
|
| 120 | + ) |
|
| 121 | + ->setDocHeaderBottomLeftComponents([ |
|
| 122 | + ClipboardButton::class, |
|
| 123 | + NewFolder::class, |
|
| 124 | + UploadButton::class, |
|
| 125 | + ]) |
|
| 126 | + ->setGridTopComponents([ |
|
| 127 | + InlineJavaScript::class, |
|
| 128 | + ConfigurationWarning::class, |
|
| 129 | + SelectedFolderInfo::class, |
|
| 130 | + ]) |
|
| 131 | + ->setGridBottomComponents([ |
|
| 132 | + LinkCreatorPlugin::class, |
|
| 133 | + ImageEditorPlugin::class, |
|
| 134 | + FilePickerPlugin::class, |
|
| 135 | + ]) |
|
| 136 | + ->setGridButtonsComponents([ |
|
| 137 | + LinkCreatorButton::class, |
|
| 138 | + ImageEditorButton::class, |
|
| 139 | + FilePickerButton::class, |
|
| 140 | + EditButton::class, |
|
| 141 | + DownloadButton::class, |
|
| 142 | + DeleteButton::class, |
|
| 143 | + ]) |
|
| 144 | + ->setMenuMassActionComponents([ |
|
| 145 | + ExportXlsMenuItem::class, |
|
| 146 | + ExportXmlMenuItem::class, |
|
| 147 | + ExportCsvMenuItem::class, |
|
| 148 | + DividerMenuItem::class, |
|
| 149 | + |
|
| 150 | + // Media custom View Helper |
|
| 151 | + ClipboardMenuItem::class, |
|
| 152 | + FilePickerMenuItem::class, |
|
| 153 | + ChangeStorageMenuItem::class, |
|
| 154 | + MassDeleteMenuItem::class, |
|
| 155 | + ]) |
|
| 156 | + ->register(); |
|
| 157 | + |
|
| 158 | + |
|
| 159 | + /** @var $signalSlotDispatcher \TYPO3\CMS\Extbase\SignalSlot\Dispatcher */ |
|
| 160 | + $signalSlotDispatcher = GeneralUtility::makeInstance(Dispatcher::class); |
|
| 161 | + |
|
| 162 | + # Register some tool for Media. |
|
| 163 | + ToolRegistry::getInstance()->register('sys_file', ThumbnailGeneratorTool::class); |
|
| 164 | + ToolRegistry::getInstance()->register('sys_file', CacheWarmUpTool::class); |
|
| 165 | + ToolRegistry::getInstance()->register('sys_file', MissingFilesFinderTool::class); |
|
| 166 | + ToolRegistry::getInstance()->register('sys_file', DuplicateRecordsFinderTool::class); |
|
| 167 | + ToolRegistry::getInstance()->register('sys_file', DuplicateFilesFinderTool::class); |
|
| 168 | + |
|
| 169 | + // Connect some signals with slots. |
|
| 170 | + $signalSlotDispatcher->connect( |
|
| 171 | + 'Fab\Vidi\Controller\Backend\ContentController', // Small exception in naming here as the class was previously located in "Controller\Backend". |
|
| 172 | + 'postProcessMatcherObject', |
|
| 173 | + FilePermissionsAspect::class, |
|
| 174 | + 'addFilePermissionsForFileStorages' |
|
| 175 | + ); |
|
| 176 | + |
|
| 177 | + $signalSlotDispatcher->connect( |
|
| 178 | + ContentRepository::class, |
|
| 179 | + 'postProcessConstraintsObject', |
|
| 180 | + FilePermissionsAspect::class, |
|
| 181 | + 'addFilePermissionsForFileMounts' |
|
| 182 | + ); |
|
| 183 | + |
|
| 184 | + $signalSlotDispatcher->connect( |
|
| 185 | + ContentService::class, |
|
| 186 | + 'afterFindContentObjects', |
|
| 187 | + ActionPermissionFacet::class, |
|
| 188 | + 'modifyResultSet' |
|
| 189 | + ); |
|
| 190 | + |
|
| 191 | + // Add new sprite icon. |
|
| 192 | + $icons = [ |
|
| 193 | + 'image-edit' => 'EXT:media/Resources/Public/Icons/image_edit.png', |
|
| 194 | + 'image-link' => 'EXT:media/Resources/Public/Icons/image_link.png', |
|
| 195 | + 'image-export' => 'EXT:media/Resources/Public/Icons/image_export.png', |
|
| 196 | + 'storage-change' => 'EXT:media/Resources/Public/Icons/folder_go.png', |
|
| 197 | + ]; |
|
| 198 | + /** @var IconRegistry $iconRegistry */ |
|
| 199 | + $iconRegistry = GeneralUtility::makeInstance(IconRegistry::class); |
|
| 200 | + foreach ($icons as $key => $icon) { |
|
| 201 | + $iconRegistry->registerIcon( |
|
| 202 | + 'extensions-media-' . $key, |
|
| 203 | + BitmapIconProvider::class, |
|
| 204 | + [ |
|
| 205 | + 'source' => $icon |
|
| 206 | + ] |
|
| 207 | + ); |
|
| 208 | + } |
|
| 209 | + unset($iconRegistry); |
|
| 210 | 210 | }); |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | defined('TYPO3') or die(); |
| 52 | 52 | |
| 53 | -call_user_func(function () { |
|
| 53 | +call_user_func(function() { |
|
| 54 | 54 | $configuration = GeneralUtility::makeInstance( |
| 55 | 55 | ExtensionConfiguration::class |
| 56 | 56 | )->get('media'); |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | ->setDocHeaderTopLeftComponents( |
| 117 | 117 | [ |
| 118 | 118 | StorageMenu::class, |
| 119 | - RecursiveCheckbox::class,] |
|
| 119 | + RecursiveCheckbox::class, ] |
|
| 120 | 120 | ) |
| 121 | 121 | ->setDocHeaderBottomLeftComponents([ |
| 122 | 122 | ClipboardButton::class, |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | $iconRegistry = GeneralUtility::makeInstance(IconRegistry::class); |
| 200 | 200 | foreach ($icons as $key => $icon) { |
| 201 | 201 | $iconRegistry->registerIcon( |
| 202 | - 'extensions-media-' . $key, |
|
| 202 | + 'extensions-media-'.$key, |
|
| 203 | 203 | BitmapIconProvider::class, |
| 204 | 204 | [ |
| 205 | 205 | 'source' => $icon |
@@ -21,42 +21,42 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | class DomElementTest extends UnitTestCase |
| 23 | 23 | { |
| 24 | - /** |
|
| 25 | - * @var DomElement |
|
| 26 | - */ |
|
| 27 | - private $fixture; |
|
| 24 | + /** |
|
| 25 | + * @var DomElement |
|
| 26 | + */ |
|
| 27 | + private $fixture; |
|
| 28 | 28 | |
| 29 | - public function setUp() |
|
| 30 | - { |
|
| 31 | - $this->fixture = new DomElement(); |
|
| 32 | - } |
|
| 29 | + public function setUp() |
|
| 30 | + { |
|
| 31 | + $this->fixture = new DomElement(); |
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | - public function tearDown() |
|
| 35 | - { |
|
| 36 | - unset($this->fixture); |
|
| 37 | - } |
|
| 34 | + public function tearDown() |
|
| 35 | + { |
|
| 36 | + unset($this->fixture); |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * @test |
|
| 41 | - * @dataProvider nameProvider |
|
| 42 | - */ |
|
| 43 | - public function givenNameCanBeConvertedToAnExpectedId($input, $expectedId) |
|
| 44 | - { |
|
| 45 | - $this->assertEquals($expectedId, $this->fixture->formatId($input)); |
|
| 46 | - } |
|
| 39 | + /** |
|
| 40 | + * @test |
|
| 41 | + * @dataProvider nameProvider |
|
| 42 | + */ |
|
| 43 | + public function givenNameCanBeConvertedToAnExpectedId($input, $expectedId) |
|
| 44 | + { |
|
| 45 | + $this->assertEquals($expectedId, $this->fixture->formatId($input)); |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | - /** |
|
| 49 | - * Provider |
|
| 50 | - */ |
|
| 51 | - public function nameProvider() |
|
| 52 | - { |
|
| 53 | - return array( |
|
| 54 | - array('foobar', 'foobar'), |
|
| 55 | - array('foo-bar', 'foo-bar'), |
|
| 56 | - array('foo_bar', 'foo-bar'), |
|
| 57 | - array('FooBarBaz', 'foo-bar-baz'), |
|
| 58 | - array('Foo Bar', 'foo-bar'), |
|
| 59 | - array('foo[bar]', 'foo-bar'), |
|
| 60 | - ); |
|
| 61 | - } |
|
| 48 | + /** |
|
| 49 | + * Provider |
|
| 50 | + */ |
|
| 51 | + public function nameProvider() |
|
| 52 | + { |
|
| 53 | + return array( |
|
| 54 | + array('foobar', 'foobar'), |
|
| 55 | + array('foo-bar', 'foo-bar'), |
|
| 56 | + array('foo_bar', 'foo-bar'), |
|
| 57 | + array('FooBarBaz', 'foo-bar-baz'), |
|
| 58 | + array('Foo Bar', 'foo-bar'), |
|
| 59 | + array('foo[bar]', 'foo-bar'), |
|
| 60 | + ); |
|
| 61 | + } |
|
| 62 | 62 | } |
@@ -21,26 +21,26 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | class PermissionUtilityTest extends UnitTestCase |
| 23 | 23 | { |
| 24 | - /** |
|
| 25 | - * @var PermissionUtility |
|
| 26 | - */ |
|
| 27 | - private $fixture; |
|
| 24 | + /** |
|
| 25 | + * @var PermissionUtility |
|
| 26 | + */ |
|
| 27 | + private $fixture; |
|
| 28 | 28 | |
| 29 | - public function setUp() |
|
| 30 | - { |
|
| 31 | - $this->fixture = new PermissionUtility(); |
|
| 32 | - } |
|
| 29 | + public function setUp() |
|
| 30 | + { |
|
| 31 | + $this->fixture = new PermissionUtility(); |
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | - public function tearDown() |
|
| 35 | - { |
|
| 36 | - unset($this->fixture); |
|
| 37 | - } |
|
| 34 | + public function tearDown() |
|
| 35 | + { |
|
| 36 | + unset($this->fixture); |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * @test |
|
| 41 | - */ |
|
| 42 | - public function checkWhetherPermissionUtilityIsCorrect() |
|
| 43 | - { |
|
| 44 | - $this->assertInstanceOf('\Fab\Media\Utility\PermissionUtility', $this->fixture); |
|
| 45 | - } |
|
| 39 | + /** |
|
| 40 | + * @test |
|
| 41 | + */ |
|
| 42 | + public function checkWhetherPermissionUtilityIsCorrect() |
|
| 43 | + { |
|
| 44 | + $this->assertInstanceOf('\Fab\Media\Utility\PermissionUtility', $this->fixture); |
|
| 45 | + } |
|
| 46 | 46 | } |