Skip to content

Commit

Permalink
Merge pull request #40 from experius/feature/DOBO-786
Browse files Browse the repository at this point in the history
[FEATURE][DOBO-786] Added bmp filetype, and Magento 2.4.7 compatibility
  • Loading branch information
iriks-it authored Jul 2, 2024
2 parents dc75554 + b25fcaa commit 6771518
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 12 deletions.
1 change: 1 addition & 0 deletions Helper/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ public function getExtraFiletypes()
'mp4',
'ogg',
'webm',
'bmp'
];

return array_merge($filetypes, $defaultFiletypes);
Expand Down
33 changes: 29 additions & 4 deletions etc/adminhtml/di.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Cms\Model\Wysiwyg\Images\Storage">
<plugin name="Experius_WysiwygDownloads_Plugin_Magento_Cms_Model_Wysiwyg_Images_Storage"
<type name="Magento\Cms\Model\Wysiwyg\Images\Storage">
<plugin name="Experius_WysiwygDownloads_Plugin_Magento_Cms_Model_Wysiwyg_Images_Storage"
type="Experius\WysiwygDownloads\Plugin\Magento\Cms\Model\Wysiwyg\Images\Storage"
sortOrder="10" />
<arguments>
Expand Down Expand Up @@ -65,16 +65,25 @@
</item>
</argument>
</arguments>
</type>
</type>
<type name="Magento\MediaGalleryUi\Ui\Component\Control\UploadAssets">
<plugin name="Experius_WysiwygDownloads_Plugin_Magento_MediaGalleryUi_Ui_Component_Control_UploadAssets"
type="Experius\WysiwygDownloads\Plugin\Magento\MediaGalleryUi\Ui\Component\Control\UploadAssets"
sortOrder="10"/>
</type>
<preference for="Magento\Framework\Image\Adapter\Gd2" type="Experius\WysiwygDownloads\Image\Adapter\Gd2" />
<type name="Magento\MediaGalleryUi\Ui\Component\Listing\Columns\Url">
<plugin name="Experius_WysiwygDownloads_Plugin_Magento_MediaGalleryUi_Ui_Component_Listing_Columns_Url"
type="Experius\WysiwygDownloads\Plugin\Magento\MediaGalleryUi\Ui\Component\Listing\Columns\Url"
sortOrder="10" disabled="false"/>
</type>
<preference for="Magento\Framework\Image\Adapter\Gd2" type="Experius\WysiwygDownloads\Image\Adapter\Gd2" />
<type name="Magento\MediaGalleryIntegration\Plugin\SaveImageInformation">
<arguments>
<argument name="imageExtensions" xsi:type="array">
<item name="jpg" xsi:type="string">jpg</item>
<item name="jpeg" xsi:type="string">jpeg</item>
<item name="gif" xsi:type="string">gif</item>
<item name="png" xsi:type="string">png</item>
<item name="pdf" xsi:type="string">pdf</item>
<item name="svg" xsi:type="string">svg</item>
</argument>
Expand All @@ -83,6 +92,22 @@
<type name="Magento\MediaGalleryRenditions\Model\Queue\FetchRenditionPathsBatches">
<arguments>
<argument name="fileExtensions" xsi:type="array">
<item name="jpg" xsi:type="string">jpg</item>
<item name="jpeg" xsi:type="string">jpeg</item>
<item name="gif" xsi:type="string">gif</item>
<item name="png" xsi:type="string">png</item>
<item name="pdf" xsi:type="string">pdf</item>
<item name="svg" xsi:type="string">svg</item>
</argument>
</arguments>
</type>
<type name="Magento\MediaGallerySynchronization\Model\FetchMediaStorageFileBatches">
<arguments>
<argument name="fileExtensions" xsi:type="array">
<item name="jpg" xsi:type="string">jpg</item>
<item name="jpeg" xsi:type="string">jpeg</item>
<item name="gif" xsi:type="string">gif</item>
<item name="png" xsi:type="string">png</item>
<item name="pdf" xsi:type="string">pdf</item>
<item name="svg" xsi:type="string">svg</item>
</argument>
Expand Down
2 changes: 1 addition & 1 deletion etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<label>Extra Allowed Filetypes in the WYSIWYG-editor</label>
<frontend_model>Experius\WysiwygDownloads\Block\Adminhtml\System\Config\Form\Field\Filetypes</frontend_model>
<backend_model>Magento\Config\Model\Config\Backend\Serialized\ArraySerialized</backend_model>
<comment><![CDATA[By default the following filetypes are available after installing this module 'doc','docm','docx','csv','xml','xls','xlsx','pdf','zip','tar']]></comment>
<comment><![CDATA[By default the following filetypes are available after installing this module 'jpg', 'jpeg', 'png', 'gif', 'webp', 'svg', 'pdf', 'doc', 'docx', 'docm', 'odt', 'csv', 'txt', 'xml', 'xls', 'xlsx', 'ods', 'zip', 'tar', 'mp3', 'mp4', 'ogg', 'webm', 'bmp']]></comment>
</field>
</group>
</section>
Expand Down
17 changes: 10 additions & 7 deletions etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Experius_WysiwygDownloads">
<sequence>
<module name="Magento_Cms"/>
<module name="Magento_Config"/>
<module name="Magento_Store"/>
</sequence>
</module>
<module name="Experius_WysiwygDownloads">
<sequence>
<module name="Magento_Cms"/>
<module name="Magento_Config"/>
<module name="Magento_Store"/>
<module name="MediaGalleryUi"/>
<module name="MediaGalleryIntegration"/>
<module name="MediaGallerySyncroization"/>
</sequence>
</module>
</config>

0 comments on commit 6771518

Please sign in to comment.