Skip to content

Commit b52aa74

Browse files
[FEATURE][IN23-254] Add plugin to override the label from "Upload image" to "Upload image / file". This more clearly presents the functionality.
1 parent cf5a343 commit b52aa74

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
## 1.2.0 (2023-10-27)
2+
3+
[View Release]([email protected]:experius/Magento-2-Module-Experius-WysiwygDownloads.git/commits/tag/1.2.0)
4+
5+
* [FEATURE][IN23-254] Add ods as default allowed filetype. Refactor classes abit mostly to avoid "unused parameters such as $subject" listed below. *(Boris van Katwijk)*
6+
* [FEATURE][IN23-254] Add support for .odt files and make .ods mimeType mapping complete in di.xml. *(Boris van Katwijk)*
7+
* [FEATURE][IN23-254] Add plugin to override the label from "Upload image" to "Upload image / file". This more clearly presents the functionality. *(Boris van Katwijk)*
8+
9+
10+
## 1.1.1 (2023-03-14)
11+
12+
[View Release]([email protected]:experius/Magento-2-Module-Experius-WysiwygDownloads.git/commits/tag/1.1.1)
13+
14+
* [FEATURE][SGO-630] Adding extra check if there is a config value. *(Jeffrey Leeuw)*
15+
16+
117
## 1.1.0 (2021-01-25)
218

319
[View Release]([email protected]:experius/Magento-2-Module-Experius-WysiwygDownloads.git/commits/tag/1.1.0)
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
/**
3+
* Copyright © Happy Horizon Utrecht Development & Technology B.V. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Experius\WysiwygDownloads\Plugin\Magento\MediaGalleryUi\Ui\Component\Control;
9+
10+
class UploadAssets
11+
{
12+
/**
13+
* @param \Magento\MediaGalleryUi\Ui\Component\Control\UploadAssets $subject
14+
* @param $result
15+
* @return array
16+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
17+
*/
18+
public function afterGetButtonData(
19+
\Magento\MediaGalleryUi\Ui\Component\Control\UploadAssets $subject,
20+
$buttonData
21+
): array {
22+
// Override label to more correctly represent the functionality
23+
if (isset($buttonData['label']) && $buttonData['label'] == __('Upload Image')) {
24+
$buttonData['label'] = __('Upload Image / File');
25+
}
26+
return $buttonData;
27+
}
28+
}

etc/adminhtml/di.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,10 @@
6161
</argument>
6262
</arguments>
6363
</type>
64+
<type name="Magento\MediaGalleryUi\Ui\Component\Control\UploadAssets">
65+
<plugin name="Experius_WysiwygDownloads_Plugin_Magento_MediaGalleryUi_Ui_Component_Control_UploadAssets"
66+
type="Experius\WysiwygDownloads\Plugin\Magento\MediaGalleryUi\Ui\Component\Control\UploadAssets"
67+
sortOrder="10"/>
68+
</type>
6469
<preference for="Magento\Framework\Image\Adapter\Gd2" type="Experius\WysiwygDownloads\Image\Adapter\Gd2" />
6570
</config>

0 commit comments

Comments
 (0)