This commit is contained in:
2026-09-15 10:35:56 +08:00
commit 782f8ea7aa
4086 changed files with 631288 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
<acl>
<resources>
<resource id="Magento_Backend::admin">
<resource id="Magento_Backend::content">
<resource id="Esun_FileManager::filemanager" title="File Manager" sortOrder="90">
<resource id="Esun_FileManager::upload" title="Upload Files" sortOrder="10"/>
<resource id="Esun_FileManager::delete" title="Delete Files" sortOrder="20"/>
</resource>
</resource>
</resource>
</resources>
</acl>
</config>
@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
<menu>
<add id="Esun_FileManager::filemanager" title="File Manager" module="Esun_FileManager"
sortOrder="10" parent="Magento_MediaGalleryUi::media"
action="esun_filemanager/file/index" resource="Esun_FileManager::filemanager"/>
</menu>
</config>
@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="admin">
<route id="esun_filemanager" frontName="esun_filemanager">
<module name="Esun_FileManager"/>
</route>
</router>
</config>
@@ -0,0 +1,42 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
<section id="filemanager" translate="label" type="text" sortOrder="950"
showInDefault="1" showInWebsite="0" showInStore="0">
<label>File Manager</label>
<tab>general</tab>
<resource>Esun_FileManager::filemanager</resource>
<group id="general" translate="label" type="text" sortOrder="10"
showInDefault="1" showInWebsite="0" showInStore="0">
<label>General Settings</label>
<field id="enabled" translate="label" type="select" sortOrder="10"
showInDefault="1" showInWebsite="0" showInStore="0">
<label>Enabled</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
<field id="allowed_extensions" translate="label comment" type="textarea" sortOrder="20"
showInDefault="1" showInWebsite="0" showInStore="0">
<label>Allowed Extensions</label>
<comment>Comma or whitespace separated. Executable server-side script extensions are always blocked.</comment>
<backend_model>Esun\FileManager\Model\Config\Backend\AllowedExtensions</backend_model>
<validate>required-entry</validate>
</field>
<field id="max_file_size" translate="label comment" type="text" sortOrder="30"
showInDefault="1" showInWebsite="0" showInStore="0">
<label>Maximum File Size</label>
<comment>Maximum size per file in MB. PHP upload_max_filesize and post_max_size must also allow it.</comment>
<backend_model>Esun\FileManager\Model\Config\Backend\MaximumFileSize</backend_model>
<validate>required-entry validate-number validate-greater-than-zero</validate>
</field>
<field id="upload_path" translate="label comment" type="text" sortOrder="40"
showInDefault="1" showInWebsite="0" showInStore="0">
<label>Upload Path</label>
<comment>Relative to pub/media and restricted to uploads or a child path of uploads.</comment>
<backend_model>Esun\FileManager\Model\Config\Backend\UploadPath</backend_model>
<validate>required-entry</validate>
</field>
</group>
</section>
</system>
</config>
+14
View File
@@ -0,0 +1,14 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
<default>
<filemanager>
<general>
<enabled>1</enabled>
<allowed_extensions>zip,rar,7z,tar,gz,bz2,pdf,doc,docx,xls,xlsx,ppt,pptx,jpg,jpeg,png,gif,webp</allowed_extensions>
<max_file_size>100</max_file_size>
<upload_path>uploads</upload_path>
</general>
</filemanager>
</default>
</config>
@@ -0,0 +1,30 @@
<?xml version="1.0"?>
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
<table name="esun_filemanager_file" resource="default" engine="innodb" comment="File Manager Files">
<column xsi:type="int" name="id" unsigned="true" nullable="false" identity="true" comment="ID"/>
<column xsi:type="varchar" name="filename" nullable="false" length="255" comment="File Name"/>
<column xsi:type="varchar" name="filepath" nullable="false" length="512" comment="Media-relative File Path"/>
<column xsi:type="text" name="url" nullable="false" comment="Public URL"/>
<column xsi:type="varchar" name="extension" nullable="false" length="32" comment="Extension"/>
<column xsi:type="varchar" name="mime_type" nullable="false" length="255" comment="MIME Type"/>
<column xsi:type="bigint" name="size" unsigned="true" nullable="false" default="0" comment="Size in Bytes"/>
<column xsi:type="timestamp" name="created_at" nullable="false" default="CURRENT_TIMESTAMP" comment="Created At"/>
<column xsi:type="timestamp" name="updated_at" nullable="false" default="CURRENT_TIMESTAMP" on_update="true" comment="Updated At"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="id"/>
</constraint>
<constraint xsi:type="unique" referenceId="ESUN_FILEMANAGER_FILE_FILEPATH_UNQ">
<column name="filepath"/>
</constraint>
<index referenceId="ESUN_FILEMANAGER_FILE_FILENAME_IDX" indexType="btree">
<column name="filename"/>
</index>
<index referenceId="ESUN_FILEMANAGER_FILE_EXTENSION_IDX" indexType="btree">
<column name="extension"/>
</index>
<index referenceId="ESUN_FILEMANAGER_FILE_CREATED_AT_IDX" indexType="btree">
<column name="created_at"/>
</index>
</table>
</schema>
@@ -0,0 +1,24 @@
{
"esun_filemanager_file": {
"column": {
"id": true,
"filename": true,
"filepath": true,
"url": true,
"extension": true,
"mime_type": true,
"size": true,
"created_at": true,
"updated_at": true
},
"constraint": {
"PRIMARY": true,
"ESUN_FILEMANAGER_FILE_FILEPATH_UNQ": true
},
"index": {
"ESUN_FILEMANAGER_FILE_FILENAME_IDX": true,
"ESUN_FILEMANAGER_FILE_EXTENSION_IDX": true,
"ESUN_FILEMANAGER_FILE_CREATED_AT_IDX": true
}
}
}
+7
View File
@@ -0,0 +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="Esun\FileManager\Model\FileUploader">
<plugin name="save_asset_image" disabled="true"/>
</type>
</config>
+12
View File
@@ -0,0 +1,12 @@
<?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="Esun_FileManager">
<sequence>
<module name="Magento_Backend"/>
<module name="Magento_Config"/>
<module name="Magento_MediaGalleryUi"/>
<module name="Magento_Ui"/>
</sequence>
</module>
</config>