This commit is contained in:
2026-09-15 10:35:56 +08:00
commit 782f8ea7aa
4086 changed files with 631288 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
<?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_Catalog::catalog">
<resource id="Esun_ImageManager::root" title="Esun Image Manager" sortOrder="86">
<resource id="Esun_ImageManager::images" title="Manage Images" sortOrder="10">
<resource id="Esun_ImageManager::images_save" title="Save Images" sortOrder="10"/>
<resource id="Esun_ImageManager::images_delete" title="Delete Images" sortOrder="20"/>
</resource>
<resource id="Esun_ImageManager::categories" title="Manage Categories" sortOrder="20">
<resource id="Esun_ImageManager::categories_save" title="Save Categories" sortOrder="10"/>
<resource id="Esun_ImageManager::categories_delete" title="Delete Categories" sortOrder="20"/>
</resource>
</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:framework:ObjectManager/etc/config.xsd">
<type name="Magento\MediaGalleryUi\Model\UploadImage">
<plugin name="esun_image_manager_sanitize_png_upload"
type="Esun\ImageManager\Plugin\MediaGallery\SanitizePngUploadPlugin"
sortOrder="10"/>
</type>
</config>
@@ -0,0 +1,17 @@
<?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_ImageManager::esun" title="Esun" module="Esun_ImageManager"
sortOrder="31" resource="Magento_Backend::admin"/>
<add id="Esun_ImageManager::root" title="Image Manager" module="Esun_ImageManager"
sortOrder="10" parent="Esun_ImageManager::esun"
resource="Esun_ImageManager::root"/>
<add id="Esun_ImageManager::images" title="Images" module="Esun_ImageManager"
sortOrder="10" parent="Esun_ImageManager::root"
action="esun_image_manager/image/index" resource="Esun_ImageManager::images"/>
<add id="Esun_ImageManager::categories" title="Categories" module="Esun_ImageManager"
sortOrder="20" parent="Esun_ImageManager::root"
action="esun_image_manager/category/index" resource="Esun_ImageManager::categories"/>
</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_image_manager" frontName="esun_image_manager">
<module name="Esun_ImageManager" before="Magento_Backend"/>
</route>
</router>
</config>
@@ -0,0 +1,53 @@
<?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_image_category" resource="default" engine="innodb" comment="Esun Image Categories">
<column xsi:type="int" name="category_id" unsigned="true" nullable="false" identity="true" comment="Category ID"/>
<column xsi:type="varchar" name="name" nullable="false" length="255" comment="Name"/>
<column xsi:type="varchar" name="identifier" nullable="false" length="128" comment="Identifier"/>
<column xsi:type="text" name="description" nullable="true" comment="Description"/>
<column xsi:type="smallint" name="status" unsigned="true" nullable="false" default="1" comment="Status"/>
<column xsi:type="int" name="sort_order" unsigned="false" nullable="false" default="0" comment="Sort Order"/>
<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="category_id"/>
</constraint>
<constraint xsi:type="unique" referenceId="ESUN_IMAGE_CATEGORY_IDENTIFIER">
<column name="identifier"/>
</constraint>
<index referenceId="ESUN_IMAGE_CATEGORY_STATUS_SORT" indexType="btree">
<column name="status"/>
<column name="sort_order"/>
</index>
</table>
<table name="esun_image" resource="default" engine="innodb" comment="Esun Managed Images">
<column xsi:type="int" name="image_id" unsigned="true" nullable="false" identity="true" comment="Image ID"/>
<column xsi:type="int" name="category_id" unsigned="true" nullable="false" comment="Category ID"/>
<column xsi:type="varchar" name="title" nullable="false" length="255" comment="Title"/>
<column xsi:type="text" name="description" nullable="true" comment="Description"/>
<column xsi:type="varchar" name="thumbnail_path" nullable="true" length="1024" comment="Thumbnail Path"/>
<column xsi:type="varchar" name="image_path" nullable="true" length="1024" comment="Image Path"/>
<column xsi:type="varchar" name="icon_path" nullable="true" length="1024" comment="Icon Path"/>
<column xsi:type="varchar" name="link_url" nullable="true" length="1024" comment="Link URL"/>
<column xsi:type="smallint" name="status" unsigned="true" nullable="false" default="1" comment="Status"/>
<column xsi:type="int" name="sort_order" unsigned="false" nullable="false" default="0" comment="Sort Order"/>
<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="image_id"/>
</constraint>
<constraint xsi:type="foreign" referenceId="ESUN_IMAGE_CATEGORY_ID_ESUN_IMAGE_CATEGORY_CATEGORY_ID"
table="esun_image" column="category_id"
referenceTable="esun_image_category" referenceColumn="category_id"
onDelete="NO ACTION"/>
<index referenceId="ESUN_IMAGE_CATEGORY_STATUS_SORT" indexType="btree">
<column name="category_id"/>
<column name="status"/>
<column name="sort_order"/>
</index>
</table>
</schema>
@@ -0,0 +1,44 @@
{
"esun_image_category": {
"column": {
"category_id": true,
"name": true,
"identifier": true,
"description": true,
"status": true,
"sort_order": true,
"created_at": true,
"updated_at": true
},
"constraint": {
"PRIMARY": true,
"ESUN_IMAGE_CATEGORY_IDENTIFIER": true
},
"index": {
"ESUN_IMAGE_CATEGORY_STATUS_SORT": true
}
},
"esun_image": {
"column": {
"image_id": true,
"category_id": true,
"title": true,
"description": true,
"thumbnail_path": true,
"image_path": true,
"icon_path": true,
"link_url": true,
"status": true,
"sort_order": true,
"created_at": true,
"updated_at": true
},
"constraint": {
"PRIMARY": true,
"ESUN_IMAGE_CATEGORY_ID_ESUN_IMAGE_CATEGORY_CATEGORY_ID": true
},
"index": {
"ESUN_IMAGE_CATEGORY_STATUS_SORT": true
}
}
}
+11
View File
@@ -0,0 +1,11 @@
<?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_ImageManager">
<sequence>
<module name="Magento_Backend"/>
<module name="Magento_MediaStorage"/>
<module name="Magento_MediaGalleryUi"/>
</sequence>
</module>
</config>