@@ -18,15 +18,15 @@ discard block |
||
18 | 18 | { |
19 | 19 | |
20 | 20 | |
21 | - /** |
|
22 | - * Renders a button for uploading assets. |
|
23 | - * |
|
24 | - * @return string |
|
25 | - */ |
|
26 | - public function render() |
|
27 | - { |
|
28 | - $parameterPrefix = MediaModule::getParameterPrefix(); |
|
29 | - $output = " |
|
21 | + /** |
|
22 | + * Renders a button for uploading assets. |
|
23 | + * |
|
24 | + * @return string |
|
25 | + */ |
|
26 | + public function render() |
|
27 | + { |
|
28 | + $parameterPrefix = MediaModule::getParameterPrefix(); |
|
29 | + $output = " |
|
30 | 30 | <script> |
31 | 31 | |
32 | 32 | window.Media = window.Media || {}; |
@@ -34,8 +34,8 @@ discard block |
||
34 | 34 | |
35 | 35 | </script>"; |
36 | 36 | |
37 | - return $output; |
|
38 | - } |
|
37 | + return $output; |
|
38 | + } |
|
39 | 39 | |
40 | 40 | |
41 | 41 | } |
@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if (!defined('TYPO3_MODE')) die ('Access denied.'); |
|
2 | +if (!defined('TYPO3_MODE')) { |
|
3 | + die ('Access denied.'); |
|
4 | +} |
|
3 | 5 | |
4 | 6 | $tca = [ |
5 | 7 | 'ctrl' => [ |
@@ -145,7 +145,7 @@ |
||
145 | 145 | |
146 | 146 | $additionalTca = [ |
147 | 147 | 'ctrl' => [ |
148 | - 'searchFields' => $tca['ctrl']['searchFields'] . ', metadata.keywords', |
|
148 | + 'searchFields' => $tca['ctrl']['searchFields'].', metadata.keywords', |
|
149 | 149 | ], |
150 | 150 | 'grid' => [ |
151 | 151 | 'columns' => [ |
@@ -2,226 +2,226 @@ |
||
2 | 2 | if (!defined('TYPO3_MODE')) die ('Access denied.'); |
3 | 3 | |
4 | 4 | $tca = [ |
5 | - 'ctrl' => [ |
|
6 | - 'default_sortby' => 'uid DESC', |
|
7 | - // Beware that "metadata.categories" is quite expansive performance wise. |
|
8 | - 'searchFields' => 'uid, extension, name, metadata.title, metadata.description, metadata.categories', |
|
9 | - ], |
|
10 | - 'columns' => [ |
|
11 | - 'extension' => [ |
|
12 | - 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:sys_file.extension', |
|
13 | - 'config' => [ |
|
14 | - 'type' => 'input', |
|
15 | - 'size' => 255, |
|
16 | - 'eval' => 'trim', |
|
17 | - ], |
|
18 | - ], |
|
19 | - 'number_of_references' => [ |
|
20 | - 'config' => [ |
|
21 | - 'type' => 'input', |
|
22 | - 'size' => 255, |
|
23 | - 'readOnly' => true, |
|
24 | - ], |
|
25 | - ], |
|
26 | - ], |
|
27 | - 'vidi' => [ |
|
28 | - // For actions such as update, remove, copy, move, the DataHandler of the Core is configured to be used by default. |
|
29 | - // 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) |
|
30 | - // Another reasons, would be for speed. You will notice a performance cost when mass editing data using the Core DataHandler. |
|
31 | - // Using your own DataHandler would make the mass processing much faster. |
|
32 | - 'data_handler' => [ |
|
33 | - // For all actions |
|
34 | - '*' => 'Fab\Media\DataHandler\FileDataHandler' |
|
35 | - ], |
|
36 | - ], |
|
37 | - 'grid' => [ |
|
38 | - 'excluded_fields' => 'number_of_references, missing', |
|
39 | - 'facets' => [ |
|
40 | - 'metadata.title', |
|
41 | - 'metadata.categories', |
|
42 | - 'name', |
|
43 | - \Fab\Vidi\Facet\StandardFacet::class => [ |
|
44 | - 'name' => 'extension', |
|
45 | - 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:sys_file.extension' |
|
46 | - ], |
|
47 | - 'metadata.description', |
|
48 | - 'identifier', |
|
49 | - \Fab\Vidi\Facet\StandardFacet::class => [ |
|
50 | - 'name' => 'number_of_references', |
|
51 | - 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:usage', |
|
52 | - 'suggestions' => ['0', '1', '2', '3', 'etc...'] // auto-suggestions |
|
53 | - ], |
|
5 | + 'ctrl' => [ |
|
6 | + 'default_sortby' => 'uid DESC', |
|
7 | + // Beware that "metadata.categories" is quite expansive performance wise. |
|
8 | + 'searchFields' => 'uid, extension, name, metadata.title, metadata.description, metadata.categories', |
|
9 | + ], |
|
10 | + 'columns' => [ |
|
11 | + 'extension' => [ |
|
12 | + 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:sys_file.extension', |
|
13 | + 'config' => [ |
|
14 | + 'type' => 'input', |
|
15 | + 'size' => 255, |
|
16 | + 'eval' => 'trim', |
|
17 | + ], |
|
18 | + ], |
|
19 | + 'number_of_references' => [ |
|
20 | + 'config' => [ |
|
21 | + 'type' => 'input', |
|
22 | + 'size' => 255, |
|
23 | + 'readOnly' => true, |
|
24 | + ], |
|
25 | + ], |
|
26 | + ], |
|
27 | + 'vidi' => [ |
|
28 | + // For actions such as update, remove, copy, move, the DataHandler of the Core is configured to be used by default. |
|
29 | + // 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) |
|
30 | + // Another reasons, would be for speed. You will notice a performance cost when mass editing data using the Core DataHandler. |
|
31 | + // Using your own DataHandler would make the mass processing much faster. |
|
32 | + 'data_handler' => [ |
|
33 | + // For all actions |
|
34 | + '*' => 'Fab\Media\DataHandler\FileDataHandler' |
|
35 | + ], |
|
36 | + ], |
|
37 | + 'grid' => [ |
|
38 | + 'excluded_fields' => 'number_of_references, missing', |
|
39 | + 'facets' => [ |
|
40 | + 'metadata.title', |
|
41 | + 'metadata.categories', |
|
42 | + 'name', |
|
43 | + \Fab\Vidi\Facet\StandardFacet::class => [ |
|
44 | + 'name' => 'extension', |
|
45 | + 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:sys_file.extension' |
|
46 | + ], |
|
47 | + 'metadata.description', |
|
48 | + 'identifier', |
|
49 | + \Fab\Vidi\Facet\StandardFacet::class => [ |
|
50 | + 'name' => 'number_of_references', |
|
51 | + 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:usage', |
|
52 | + 'suggestions' => ['0', '1', '2', '3', 'etc...'] // auto-suggestions |
|
53 | + ], |
|
54 | 54 | |
55 | - \Fab\Vidi\Facet\StandardFacet::class => [ |
|
56 | - 'name' => 'type', |
|
57 | - 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:type', |
|
58 | - 'suggestions' => [ |
|
59 | - \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:type_1', |
|
60 | - \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:type_2', |
|
61 | - \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:type_3', |
|
62 | - \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:type_4', |
|
63 | - \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:type_5', |
|
64 | - ] |
|
65 | - ], |
|
66 | - \Fab\Media\Facet\ActionPermissionFacet::class => [], |
|
67 | - 'uid', |
|
68 | - ], |
|
69 | - 'columns' => [ |
|
70 | - '__checkbox' => [ |
|
71 | - 'renderer' => \Fab\Vidi\Grid\CheckBoxRenderer::class, |
|
72 | - ], |
|
73 | - 'uid' => [ |
|
74 | - 'visible' => false, |
|
75 | - 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:uid', |
|
76 | - 'width' => '5px', |
|
77 | - ], |
|
78 | - 'identifier' => [ |
|
79 | - 'visible' => false, |
|
80 | - ], |
|
81 | - 'fileinfo' => [ |
|
82 | - 'renderer' => Fab\Media\Grid\PreviewRenderer::class, |
|
83 | - 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:preview', |
|
84 | - 'wrap' => '<div class="center preview">|</div>', |
|
85 | - 'width' => '150px', |
|
86 | - 'sortable' => false, |
|
87 | - ], |
|
88 | - 'metadata.title' => [ |
|
89 | - 'renderer' => \Fab\Media\Grid\MetadataRenderer::class, |
|
90 | - 'rendererConfiguration' => [ |
|
91 | - 'property' => 'title', |
|
92 | - ], |
|
93 | - 'width' => '400px', |
|
94 | - 'editable' => true, |
|
95 | - 'sortable' => true, |
|
96 | - ], |
|
97 | - 'metadata.description' => [ |
|
98 | - 'renderer' => \Fab\Media\Grid\MetadataRenderer::class, |
|
99 | - 'rendererConfiguration' => [ |
|
100 | - 'property' => 'description', |
|
101 | - ], |
|
102 | - 'visible' => false, |
|
103 | - 'sortable' => false, |
|
104 | - ], |
|
105 | - 'tstamp' => [ |
|
106 | - 'visible' => false, |
|
107 | - 'format' => 'Fab\Vidi\Formatter\Date', |
|
108 | - 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:sys_file.tstamp', |
|
109 | - ], |
|
110 | - 'metadata.categories' => [ |
|
111 | - 'renderers' => [ |
|
112 | - \Fab\Vidi\Grid\RelationEditRenderer::class, |
|
113 | - \Fab\Media\Grid\CategoryRenderer::class, |
|
114 | - ], |
|
115 | - 'editable' => true, |
|
116 | - 'visible' => true, |
|
117 | - 'sortable' => false, |
|
118 | - ], |
|
119 | - 'usage' => [ |
|
120 | - 'renderer' => 'Fab\Media\Grid\UsageRenderer', |
|
121 | - 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:usage', |
|
122 | - 'visible' => true, |
|
123 | - 'sortable' => false, |
|
124 | - ], |
|
125 | - 'metadata' => [ |
|
126 | - 'label' => 'Metadata File Identifier', |
|
127 | - 'renderer' => \Fab\Media\Grid\MetadataRenderer::class, |
|
128 | - 'rendererConfiguration' => [ |
|
129 | - 'property' => 'uid', |
|
130 | - ], |
|
131 | - 'visible' => false, |
|
132 | - 'sortable' => false, |
|
133 | - ], |
|
134 | - '__action_permission' => [ |
|
135 | - 'renderer' => 'Fab\Media\Grid\ActionPermissionColumn', |
|
136 | - 'visible' => false, |
|
137 | - 'sortable' => false, |
|
138 | - 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:permission', |
|
139 | - ], |
|
140 | - ] |
|
141 | - ] |
|
55 | + \Fab\Vidi\Facet\StandardFacet::class => [ |
|
56 | + 'name' => 'type', |
|
57 | + 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:type', |
|
58 | + 'suggestions' => [ |
|
59 | + \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:type_1', |
|
60 | + \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:type_2', |
|
61 | + \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:type_3', |
|
62 | + \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:type_4', |
|
63 | + \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:type_5', |
|
64 | + ] |
|
65 | + ], |
|
66 | + \Fab\Media\Facet\ActionPermissionFacet::class => [], |
|
67 | + 'uid', |
|
68 | + ], |
|
69 | + 'columns' => [ |
|
70 | + '__checkbox' => [ |
|
71 | + 'renderer' => \Fab\Vidi\Grid\CheckBoxRenderer::class, |
|
72 | + ], |
|
73 | + 'uid' => [ |
|
74 | + 'visible' => false, |
|
75 | + 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:uid', |
|
76 | + 'width' => '5px', |
|
77 | + ], |
|
78 | + 'identifier' => [ |
|
79 | + 'visible' => false, |
|
80 | + ], |
|
81 | + 'fileinfo' => [ |
|
82 | + 'renderer' => Fab\Media\Grid\PreviewRenderer::class, |
|
83 | + 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:preview', |
|
84 | + 'wrap' => '<div class="center preview">|</div>', |
|
85 | + 'width' => '150px', |
|
86 | + 'sortable' => false, |
|
87 | + ], |
|
88 | + 'metadata.title' => [ |
|
89 | + 'renderer' => \Fab\Media\Grid\MetadataRenderer::class, |
|
90 | + 'rendererConfiguration' => [ |
|
91 | + 'property' => 'title', |
|
92 | + ], |
|
93 | + 'width' => '400px', |
|
94 | + 'editable' => true, |
|
95 | + 'sortable' => true, |
|
96 | + ], |
|
97 | + 'metadata.description' => [ |
|
98 | + 'renderer' => \Fab\Media\Grid\MetadataRenderer::class, |
|
99 | + 'rendererConfiguration' => [ |
|
100 | + 'property' => 'description', |
|
101 | + ], |
|
102 | + 'visible' => false, |
|
103 | + 'sortable' => false, |
|
104 | + ], |
|
105 | + 'tstamp' => [ |
|
106 | + 'visible' => false, |
|
107 | + 'format' => 'Fab\Vidi\Formatter\Date', |
|
108 | + 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:sys_file.tstamp', |
|
109 | + ], |
|
110 | + 'metadata.categories' => [ |
|
111 | + 'renderers' => [ |
|
112 | + \Fab\Vidi\Grid\RelationEditRenderer::class, |
|
113 | + \Fab\Media\Grid\CategoryRenderer::class, |
|
114 | + ], |
|
115 | + 'editable' => true, |
|
116 | + 'visible' => true, |
|
117 | + 'sortable' => false, |
|
118 | + ], |
|
119 | + 'usage' => [ |
|
120 | + 'renderer' => 'Fab\Media\Grid\UsageRenderer', |
|
121 | + 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:usage', |
|
122 | + 'visible' => true, |
|
123 | + 'sortable' => false, |
|
124 | + ], |
|
125 | + 'metadata' => [ |
|
126 | + 'label' => 'Metadata File Identifier', |
|
127 | + 'renderer' => \Fab\Media\Grid\MetadataRenderer::class, |
|
128 | + 'rendererConfiguration' => [ |
|
129 | + 'property' => 'uid', |
|
130 | + ], |
|
131 | + 'visible' => false, |
|
132 | + 'sortable' => false, |
|
133 | + ], |
|
134 | + '__action_permission' => [ |
|
135 | + 'renderer' => 'Fab\Media\Grid\ActionPermissionColumn', |
|
136 | + 'visible' => false, |
|
137 | + 'sortable' => false, |
|
138 | + 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:permission', |
|
139 | + ], |
|
140 | + ] |
|
141 | + ] |
|
142 | 142 | ]; |
143 | 143 | |
144 | 144 | // Add more info to the Grid if EXT:filemetadata is loaded. Notice that the extension is not required but suggested. |
145 | 145 | if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('filemetadata')) { |
146 | 146 | |
147 | - $additionalTca = [ |
|
148 | - 'ctrl' => [ |
|
149 | - 'searchFields' => $tca['ctrl']['searchFields'] . ', metadata.keywords', |
|
150 | - ], |
|
151 | - 'grid' => [ |
|
152 | - 'columns' => [ |
|
153 | - 'metadata.keywords' => [ |
|
154 | - 'renderer' => \Fab\Media\Grid\MetadataRenderer::class, |
|
155 | - 'configuration' => [ |
|
156 | - 'property' => 'keywords', |
|
157 | - ], |
|
158 | - 'label' => 'LLL:EXT:filemetadata/Resources/Private/Language/locallang_tca.xlf:sys_file_metadata.keywords', |
|
159 | - 'visible' => false, |
|
160 | - 'sortable' => false, |
|
161 | - ], |
|
162 | - 'metadata.fe_groups' => [ |
|
163 | - 'renderers' => [ |
|
164 | - \Fab\Vidi\Grid\RelationEditRenderer::class, |
|
165 | - \Fab\Media\Grid\FrontendPermissionRenderer::class, |
|
166 | - ], |
|
167 | - 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:permissions_fe_groups', |
|
168 | - 'visible' => false, |
|
169 | - 'sortable' => false, |
|
170 | - ], |
|
171 | - 'metadata.status' => [ |
|
172 | - 'renderer' => \Fab\Media\Grid\MetadataRenderer::class, |
|
173 | - 'rendererConfiguration' => [ |
|
174 | - 'property' => 'status', |
|
175 | - ], |
|
176 | - 'label' => 'LLL:EXT:filemetadata/Resources/Private/Language/locallang_tca.xlf:sys_file_metadata.status', |
|
177 | - 'visible' => false, |
|
178 | - 'width' => '5%', |
|
179 | - 'sortable' => false, |
|
180 | - ], |
|
181 | - # un-comment me to see the "visible" flag in the grid. |
|
182 | - #'visible' => array( |
|
183 | - # 'renderer' => 'Fab\Media\Grid\VisibilityRenderer', @todo will not work out of the box after 6.2 migration |
|
184 | - # 'label' => 'LLL:EXT:vidi/Resources/Private/Language/locallang.xlf:visibility_abbreviation', |
|
185 | - # 'width' => '3%', |
|
186 | - #), |
|
187 | - 'metadata.creator_tool' => [ |
|
188 | - 'renderer' => \Fab\Media\Grid\MetadataRenderer::class, |
|
189 | - 'rendererConfiguration' => [ |
|
190 | - 'property' => 'creator_tool', |
|
191 | - ], |
|
192 | - 'label' => 'LLL:EXT:filemetadata/Resources/Private/Language/locallang_tca.xlf:sys_file_metadata.creator_tool', |
|
193 | - 'visible' => false, |
|
194 | - 'sortable' => false, |
|
195 | - ], |
|
196 | - 'metadata.content_creation_date' => [ |
|
197 | - 'renderer' => \Fab\Media\Grid\MetadataRenderer::class, |
|
198 | - 'rendererConfiguration' => [ |
|
199 | - 'property' => 'content_creation_date', |
|
200 | - ], |
|
201 | - 'label' => 'LLL:EXT:filemetadata/Resources/Private/Language/locallang_tca.xlf:sys_file_metadata.content_creation_date', |
|
202 | - 'visible' => false, |
|
203 | - 'format' => 'datetime', |
|
204 | - 'sortable' => false, |
|
205 | - ], |
|
206 | - 'metadata.content_modification_date' => [ |
|
207 | - 'renderer' => \Fab\Media\Grid\MetadataRenderer::class, |
|
208 | - 'rendererConfiguration' => [ |
|
209 | - 'property' => 'content_modification_date', |
|
210 | - ], |
|
211 | - 'label' => 'LLL:EXT:filemetadata/Resources/Private/Language/locallang_tca.xlf:sys_file_metadata.content_modification_date', |
|
212 | - 'visible' => false, |
|
213 | - 'format' => 'datetime', |
|
214 | - 'sortable' => false, |
|
215 | - ], |
|
216 | - ] |
|
217 | - ] |
|
218 | - ]; |
|
219 | - \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($tca, $additionalTca); |
|
147 | + $additionalTca = [ |
|
148 | + 'ctrl' => [ |
|
149 | + 'searchFields' => $tca['ctrl']['searchFields'] . ', metadata.keywords', |
|
150 | + ], |
|
151 | + 'grid' => [ |
|
152 | + 'columns' => [ |
|
153 | + 'metadata.keywords' => [ |
|
154 | + 'renderer' => \Fab\Media\Grid\MetadataRenderer::class, |
|
155 | + 'configuration' => [ |
|
156 | + 'property' => 'keywords', |
|
157 | + ], |
|
158 | + 'label' => 'LLL:EXT:filemetadata/Resources/Private/Language/locallang_tca.xlf:sys_file_metadata.keywords', |
|
159 | + 'visible' => false, |
|
160 | + 'sortable' => false, |
|
161 | + ], |
|
162 | + 'metadata.fe_groups' => [ |
|
163 | + 'renderers' => [ |
|
164 | + \Fab\Vidi\Grid\RelationEditRenderer::class, |
|
165 | + \Fab\Media\Grid\FrontendPermissionRenderer::class, |
|
166 | + ], |
|
167 | + 'label' => 'LLL:EXT:media/Resources/Private/Language/locallang.xlf:permissions_fe_groups', |
|
168 | + 'visible' => false, |
|
169 | + 'sortable' => false, |
|
170 | + ], |
|
171 | + 'metadata.status' => [ |
|
172 | + 'renderer' => \Fab\Media\Grid\MetadataRenderer::class, |
|
173 | + 'rendererConfiguration' => [ |
|
174 | + 'property' => 'status', |
|
175 | + ], |
|
176 | + 'label' => 'LLL:EXT:filemetadata/Resources/Private/Language/locallang_tca.xlf:sys_file_metadata.status', |
|
177 | + 'visible' => false, |
|
178 | + 'width' => '5%', |
|
179 | + 'sortable' => false, |
|
180 | + ], |
|
181 | + # un-comment me to see the "visible" flag in the grid. |
|
182 | + #'visible' => array( |
|
183 | + # 'renderer' => 'Fab\Media\Grid\VisibilityRenderer', @todo will not work out of the box after 6.2 migration |
|
184 | + # 'label' => 'LLL:EXT:vidi/Resources/Private/Language/locallang.xlf:visibility_abbreviation', |
|
185 | + # 'width' => '3%', |
|
186 | + #), |
|
187 | + 'metadata.creator_tool' => [ |
|
188 | + 'renderer' => \Fab\Media\Grid\MetadataRenderer::class, |
|
189 | + 'rendererConfiguration' => [ |
|
190 | + 'property' => 'creator_tool', |
|
191 | + ], |
|
192 | + 'label' => 'LLL:EXT:filemetadata/Resources/Private/Language/locallang_tca.xlf:sys_file_metadata.creator_tool', |
|
193 | + 'visible' => false, |
|
194 | + 'sortable' => false, |
|
195 | + ], |
|
196 | + 'metadata.content_creation_date' => [ |
|
197 | + 'renderer' => \Fab\Media\Grid\MetadataRenderer::class, |
|
198 | + 'rendererConfiguration' => [ |
|
199 | + 'property' => 'content_creation_date', |
|
200 | + ], |
|
201 | + 'label' => 'LLL:EXT:filemetadata/Resources/Private/Language/locallang_tca.xlf:sys_file_metadata.content_creation_date', |
|
202 | + 'visible' => false, |
|
203 | + 'format' => 'datetime', |
|
204 | + 'sortable' => false, |
|
205 | + ], |
|
206 | + 'metadata.content_modification_date' => [ |
|
207 | + 'renderer' => \Fab\Media\Grid\MetadataRenderer::class, |
|
208 | + 'rendererConfiguration' => [ |
|
209 | + 'property' => 'content_modification_date', |
|
210 | + ], |
|
211 | + 'label' => 'LLL:EXT:filemetadata/Resources/Private/Language/locallang_tca.xlf:sys_file_metadata.content_modification_date', |
|
212 | + 'visible' => false, |
|
213 | + 'format' => 'datetime', |
|
214 | + 'sortable' => false, |
|
215 | + ], |
|
216 | + ] |
|
217 | + ] |
|
218 | + ]; |
|
219 | + \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($tca, $additionalTca); |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | // Control buttons such as edit, delete, etc... must be set at the end in any case. |
223 | 223 | $tca['grid']['columns']['__buttons'] = [ |
224 | - 'renderer' => \Fab\Vidi\Grid\ButtonGroupRenderer::class, |
|
224 | + 'renderer' => \Fab\Vidi\Grid\ButtonGroupRenderer::class, |
|
225 | 225 | ]; |
226 | 226 | |
227 | 227 | \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($GLOBALS['TCA']['sys_file'], $tca); |
228 | 228 | \ No newline at end of file |
@@ -20,47 +20,47 @@ |
||
20 | 20 | class ChangeStorageMenuItem extends AbstractComponentView |
21 | 21 | { |
22 | 22 | |
23 | - /** |
|
24 | - * Renders a "change storage" menu item to be placed in the grid menu of Media. |
|
25 | - * |
|
26 | - * @return string |
|
27 | - */ |
|
28 | - public function render() |
|
29 | - { |
|
30 | - $output = ''; |
|
31 | - if (!$this->getMediaModule()->hasFolderTree()) { |
|
23 | + /** |
|
24 | + * Renders a "change storage" menu item to be placed in the grid menu of Media. |
|
25 | + * |
|
26 | + * @return string |
|
27 | + */ |
|
28 | + public function render() |
|
29 | + { |
|
30 | + $output = ''; |
|
31 | + if (!$this->getMediaModule()->hasFolderTree()) { |
|
32 | 32 | |
33 | 33 | |
34 | - $output = sprintf('<li><a href="%s" class="change-storage" >%s %s</a>', |
|
35 | - $this->getChangeStorageUri(), |
|
36 | - $this->getIconFactory()->getIcon('extensions-media-storage-change', Icon::SIZE_SMALL), |
|
37 | - $this->getLanguageService()->sL('LLL:EXT:media/Resources/Private/Language/locallang.xlf:change_storage') |
|
38 | - ); |
|
34 | + $output = sprintf('<li><a href="%s" class="change-storage" >%s %s</a>', |
|
35 | + $this->getChangeStorageUri(), |
|
36 | + $this->getIconFactory()->getIcon('extensions-media-storage-change', Icon::SIZE_SMALL), |
|
37 | + $this->getLanguageService()->sL('LLL:EXT:media/Resources/Private/Language/locallang.xlf:change_storage') |
|
38 | + ); |
|
39 | 39 | |
40 | - } |
|
41 | - return $output; |
|
42 | - } |
|
40 | + } |
|
41 | + return $output; |
|
42 | + } |
|
43 | 43 | |
44 | - /** |
|
45 | - * @return string |
|
46 | - */ |
|
47 | - protected function getChangeStorageUri() |
|
48 | - { |
|
49 | - $urlParameters = array( |
|
50 | - MediaModule::getParameterPrefix() => array( |
|
51 | - 'controller' => 'Asset', |
|
52 | - 'action' => 'editStorage', |
|
53 | - ), |
|
54 | - ); |
|
55 | - return BackendUtility::getModuleUrl(MediaModule::getSignature(), $urlParameters); |
|
56 | - } |
|
44 | + /** |
|
45 | + * @return string |
|
46 | + */ |
|
47 | + protected function getChangeStorageUri() |
|
48 | + { |
|
49 | + $urlParameters = array( |
|
50 | + MediaModule::getParameterPrefix() => array( |
|
51 | + 'controller' => 'Asset', |
|
52 | + 'action' => 'editStorage', |
|
53 | + ), |
|
54 | + ); |
|
55 | + return BackendUtility::getModuleUrl(MediaModule::getSignature(), $urlParameters); |
|
56 | + } |
|
57 | 57 | |
58 | - /** |
|
59 | - * @return object|MediaModule |
|
60 | - */ |
|
61 | - protected function getMediaModule() |
|
62 | - { |
|
63 | - return GeneralUtility::makeInstance(MediaModule::class); |
|
64 | - } |
|
58 | + /** |
|
59 | + * @return object|MediaModule |
|
60 | + */ |
|
61 | + protected function getMediaModule() |
|
62 | + { |
|
63 | + return GeneralUtility::makeInstance(MediaModule::class); |
|
64 | + } |
|
65 | 65 | |
66 | 66 | } |
@@ -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 |
@@ -19,50 +19,50 @@ discard block |
||
19 | 19 | class RecursiveCheckbox extends AbstractComponentView |
20 | 20 | { |
21 | 21 | |
22 | - /** |
|
23 | - * @var \Fab\Vidi\Module\ModuleLoader |
|
24 | - * @inject |
|
25 | - */ |
|
26 | - protected $moduleLoader; |
|
27 | - |
|
28 | - /** |
|
29 | - * Renders a checkbox for recursive file browsing. |
|
30 | - * |
|
31 | - * @return string |
|
32 | - * @throws \InvalidArgumentException |
|
33 | - */ |
|
34 | - public function render() |
|
35 | - { |
|
36 | - |
|
37 | - $output = ''; |
|
38 | - if ($this->isDisplayed()) { |
|
39 | - $this->loadRequireJsCode(); |
|
40 | - $output = $this->renderRecursiveCheckbox(); |
|
41 | - } |
|
42 | - |
|
43 | - return $output; |
|
44 | - } |
|
45 | - |
|
46 | - /** |
|
47 | - * @return string |
|
48 | - * @throws \InvalidArgumentException |
|
49 | - */ |
|
50 | - protected function isDisplayed() |
|
51 | - { |
|
52 | - $isDisplayed = $this->getMediaModule()->hasFolderTree(); |
|
53 | - if ($this->getModuleLoader()->hasPlugin()) { |
|
54 | - $isDisplayed = false; |
|
55 | - } |
|
56 | - return $isDisplayed; |
|
57 | - } |
|
58 | - |
|
59 | - /** |
|
60 | - * @return string |
|
61 | - */ |
|
62 | - protected function renderRecursiveCheckbox() |
|
63 | - { |
|
64 | - |
|
65 | - $template = '<form action="%s" id="form-checkbox-hasRecursiveSelection" method="get"> |
|
22 | + /** |
|
23 | + * @var \Fab\Vidi\Module\ModuleLoader |
|
24 | + * @inject |
|
25 | + */ |
|
26 | + protected $moduleLoader; |
|
27 | + |
|
28 | + /** |
|
29 | + * Renders a checkbox for recursive file browsing. |
|
30 | + * |
|
31 | + * @return string |
|
32 | + * @throws \InvalidArgumentException |
|
33 | + */ |
|
34 | + public function render() |
|
35 | + { |
|
36 | + |
|
37 | + $output = ''; |
|
38 | + if ($this->isDisplayed()) { |
|
39 | + $this->loadRequireJsCode(); |
|
40 | + $output = $this->renderRecursiveCheckbox(); |
|
41 | + } |
|
42 | + |
|
43 | + return $output; |
|
44 | + } |
|
45 | + |
|
46 | + /** |
|
47 | + * @return string |
|
48 | + * @throws \InvalidArgumentException |
|
49 | + */ |
|
50 | + protected function isDisplayed() |
|
51 | + { |
|
52 | + $isDisplayed = $this->getMediaModule()->hasFolderTree(); |
|
53 | + if ($this->getModuleLoader()->hasPlugin()) { |
|
54 | + $isDisplayed = false; |
|
55 | + } |
|
56 | + return $isDisplayed; |
|
57 | + } |
|
58 | + |
|
59 | + /** |
|
60 | + * @return string |
|
61 | + */ |
|
62 | + protected function renderRecursiveCheckbox() |
|
63 | + { |
|
64 | + |
|
65 | + $template = '<form action="%s" id="form-checkbox-hasRecursiveSelection" method="get"> |
|
66 | 66 | <label> |
67 | 67 | <input type="checkbox" |
68 | 68 | name="%s[hasRecursiveSelection]" |
@@ -73,35 +73,35 @@ discard block |
||
73 | 73 | </label> |
74 | 74 | </form>'; |
75 | 75 | |
76 | - return sprintf( |
|
77 | - $template, |
|
78 | - $this->getModuleLoader()->getModuleUrl(), |
|
79 | - $this->moduleLoader->getParameterPrefix(), |
|
80 | - $this->getLanguageService()->sL('LLL:EXT:media/Resources/Private/Language/locallang.xlf:browse_subfolders') |
|
81 | - ); |
|
82 | - } |
|
83 | - |
|
84 | - /** |
|
85 | - * @return void |
|
86 | - * @throws \InvalidArgumentException |
|
87 | - */ |
|
88 | - protected function loadRequireJsCode() |
|
89 | - { |
|
90 | - $pageRenderer = GeneralUtility::makeInstance(PageRenderer::class); |
|
91 | - |
|
92 | - $configuration['paths']['Fab/Media'] = '../typo3conf/ext/media/Resources/Public/JavaScript'; |
|
93 | - $pageRenderer->addRequireJsConfiguration($configuration); |
|
94 | - $pageRenderer->loadRequireJsModule('Fab/Media/BrowseRecursively'); |
|
95 | - } |
|
96 | - |
|
97 | - |
|
98 | - /** |
|
99 | - * @return MediaModule|object |
|
100 | - * @throws \InvalidArgumentException |
|
101 | - */ |
|
102 | - protected function getMediaModule() |
|
103 | - { |
|
104 | - return GeneralUtility::makeInstance(\Fab\Media\Module\MediaModule::class); |
|
105 | - } |
|
76 | + return sprintf( |
|
77 | + $template, |
|
78 | + $this->getModuleLoader()->getModuleUrl(), |
|
79 | + $this->moduleLoader->getParameterPrefix(), |
|
80 | + $this->getLanguageService()->sL('LLL:EXT:media/Resources/Private/Language/locallang.xlf:browse_subfolders') |
|
81 | + ); |
|
82 | + } |
|
83 | + |
|
84 | + /** |
|
85 | + * @return void |
|
86 | + * @throws \InvalidArgumentException |
|
87 | + */ |
|
88 | + protected function loadRequireJsCode() |
|
89 | + { |
|
90 | + $pageRenderer = GeneralUtility::makeInstance(PageRenderer::class); |
|
91 | + |
|
92 | + $configuration['paths']['Fab/Media'] = '../typo3conf/ext/media/Resources/Public/JavaScript'; |
|
93 | + $pageRenderer->addRequireJsConfiguration($configuration); |
|
94 | + $pageRenderer->loadRequireJsModule('Fab/Media/BrowseRecursively'); |
|
95 | + } |
|
96 | + |
|
97 | + |
|
98 | + /** |
|
99 | + * @return MediaModule|object |
|
100 | + * @throws \InvalidArgumentException |
|
101 | + */ |
|
102 | + protected function getMediaModule() |
|
103 | + { |
|
104 | + return GeneralUtility::makeInstance(\Fab\Media\Module\MediaModule::class); |
|
105 | + } |
|
106 | 106 | |
107 | 107 | } |
@@ -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 | } |