This commit is contained in:
2026-09-15 10:35:56 +08:00
commit 782f8ea7aa
4086 changed files with 631288 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
<?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_Wiki::root" title="Esun Wiki" sortOrder="88">
<resource id="Esun_Wiki::homepage" title="Manage Wiki Homepage" sortOrder="5"/>
<resource id="Esun_Wiki::categories" title="Manage Wiki Categories" sortOrder="10">
<resource id="Esun_Wiki::categories_save" title="Save Wiki Categories" sortOrder="10"/>
<resource id="Esun_Wiki::categories_delete" title="Delete Wiki Categories" sortOrder="20"/>
</resource>
</resource>
</resource>
<resource id="Magento_Backend::stores">
<resource id="Magento_Backend::stores_settings">
<resource id="Magento_Config::config">
<resource id="Esun_Wiki::config" title="Esun Wiki Configuration" sortOrder="90"/>
</resource>
</resource>
</resource>
</resource>
</resources>
</acl>
</config>
+17
View File
@@ -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_Wiki::root" title="Wiki Knowledge Base" module="Esun_Wiki"
sortOrder="60" parent="Esun_ImageManager::esun" resource="Esun_Wiki::root"/>
<add id="Esun_Wiki::homepage_menu" title="Wiki Homepage" module="Esun_Wiki"
sortOrder="10" parent="Esun_Wiki::root"
action="esun_wiki/homepage/edit" resource="Esun_Wiki::homepage"/>
<add id="Esun_Wiki::categories_menu" title="Wiki Categories" module="Esun_Wiki"
sortOrder="20" parent="Esun_Wiki::root"
action="esun_wiki/category/index" resource="Esun_Wiki::categories"/>
<add id="Esun_Wiki::config_menu" title="Wiki Configuration" module="Esun_Wiki"
sortOrder="30" parent="Esun_Wiki::root"
action="adminhtml/system_config/edit/section/esun_wiki" resource="Esun_Wiki::config"/>
</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_wiki" frontName="esun_wiki">
<module name="Esun_Wiki" before="Magento_Backend"/>
</route>
</router>
</config>
@@ -0,0 +1,30 @@
<?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>
<tab id="esun" translate="label" sortOrder="300">
<label>Esun</label>
</tab>
<section id="esun_wiki" translate="label" type="text" sortOrder="925"
showInDefault="1" showInWebsite="1" showInStore="1">
<label>Wiki</label>
<tab>esun</tab>
<resource>Esun_Wiki::config</resource>
<group id="appearance" translate="label" type="text" sortOrder="10"
showInDefault="1" showInWebsite="1" showInStore="1">
<label>Appearance</label>
<field id="banner_image" translate="label comment" type="image" sortOrder="10"
showInDefault="1" showInWebsite="1" showInStore="1">
<label>Top Banner Image</label>
<backend_model>Esun\Wiki\Model\Config\Backend\BannerImage</backend_model>
<upload_dir config="system/filesystem/media" scope_info="1">esun/wiki/banner</upload_dir>
<base_url type="media" scope_info="1">esun/wiki/banner</base_url>
<comment><![CDATA[
Used on the top of all Wiki pages. If empty, wiki_top_banner.png from the theme is used.
Allowed file types: jpg, jpeg, gif, png and webp.
]]></comment>
</field>
</group>
</section>
</system>
</config>
+91
View File
@@ -0,0 +1,91 @@
<?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_wiki_category" resource="default" engine="innodb" comment="Esun Wiki Categories">
<column xsi:type="int" name="category_id" unsigned="true" nullable="false" identity="true" comment="Category ID"/>
<column xsi:type="int" name="parent_id" unsigned="true" nullable="true" comment="Parent Category ID"/>
<column xsi:type="varchar" name="title" nullable="false" length="255" comment="Title"/>
<column xsi:type="varchar" name="slug" nullable="false" length="160" comment="URL Slug"/>
<column xsi:type="varchar" name="custom_url_path" nullable="true" length="255" comment="Custom URL Path"/>
<column xsi:type="varchar" name="logo_path" nullable="true" length="512" comment="Navigation Logo Path"/>
<column xsi:type="text" name="summary" nullable="true" comment="Summary"/>
<column xsi:type="mediumtext" name="content" nullable="true" comment="Wiki Content"/>
<column xsi:type="varchar" name="meta_title" nullable="true" length="255" comment="Meta Title"/>
<column xsi:type="text" name="meta_description" nullable="true" comment="Meta Description"/>
<column xsi:type="text" name="meta_keywords" nullable="true" comment="Meta Keywords"/>
<column xsi:type="smallint" name="is_active" unsigned="true" nullable="false" default="1" comment="Is Active"/>
<column xsi:type="smallint" name="is_default_open" unsigned="true" nullable="false" default="0"
comment="Is Open by Default"/>
<column xsi:type="smallint" name="is_clickable" unsigned="true" nullable="false" default="1"
comment="Can Open Wiki Content"/>
<column xsi:type="smallint" name="show_download_center" unsigned="true" nullable="false" default="0"
comment="Show Download Center"/>
<column xsi:type="smallint" name="show_parameter_comparison" unsigned="true" nullable="false" default="0"
comment="Show Parameter Comparison"/>
<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_WIKI_CATEGORY_SLUG">
<column name="slug"/>
</constraint>
<constraint xsi:type="unique" referenceId="ESUN_WIKI_CATEGORY_CUSTOM_URL_PATH">
<column name="custom_url_path"/>
</constraint>
<constraint xsi:type="foreign" referenceId="ESUN_WIKI_CATEGORY_PARENT_ID_ESUN_WIKI_CATEGORY_CATEGORY_ID"
table="esun_wiki_category" column="parent_id"
referenceTable="esun_wiki_category" referenceColumn="category_id"
onDelete="SET NULL"/>
<index referenceId="ESUN_WIKI_CATEGORY_PARENT_SORT" indexType="btree">
<column name="parent_id"/>
<column name="sort_order"/>
<column name="category_id"/>
</index>
<index referenceId="ESUN_WIKI_CATEGORY_ACTIVE_SORT" indexType="btree">
<column name="is_active"/>
<column name="sort_order"/>
<column name="category_id"/>
</index>
</table>
<table name="esun_wiki_category_store" resource="default" engine="innodb"
comment="Esun Wiki Category Store Relations">
<column xsi:type="int" name="category_id" unsigned="true" nullable="false" comment="Category ID"/>
<column xsi:type="smallint" name="store_id" unsigned="true" nullable="false" comment="Store ID"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="category_id"/>
<column name="store_id"/>
</constraint>
<constraint xsi:type="foreign" referenceId="ESUN_WIKI_CATEGORY_STORE_CATEGORY_ID_CATEGORY_CATEGORY_ID"
table="esun_wiki_category_store" column="category_id"
referenceTable="esun_wiki_category" referenceColumn="category_id"
onDelete="CASCADE"/>
<constraint xsi:type="foreign" referenceId="ESUN_WIKI_CATEGORY_STORE_STORE_ID_STORE_STORE_ID"
table="esun_wiki_category_store" column="store_id"
referenceTable="store" referenceColumn="store_id"
onDelete="CASCADE"/>
<index referenceId="ESUN_WIKI_CATEGORY_STORE_STORE_ID" indexType="btree">
<column name="store_id"/>
</index>
</table>
<table name="esun_wiki_homepage" resource="default" engine="innodb" comment="Esun Wiki Homepage">
<column xsi:type="int" name="homepage_id" unsigned="true" nullable="false" identity="true"
comment="Homepage ID"/>
<column xsi:type="varchar" name="title" nullable="false" length="255" comment="Title"/>
<column xsi:type="mediumtext" name="content" nullable="true" comment="Homepage Content"/>
<column xsi:type="varchar" name="meta_title" nullable="true" length="255" comment="Meta Title"/>
<column xsi:type="text" name="meta_description" nullable="true" comment="Meta Description"/>
<column xsi:type="text" name="meta_keywords" nullable="true" comment="Meta Keywords"/>
<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="homepage_id"/>
</constraint>
</table>
</schema>
@@ -0,0 +1,64 @@
{
"esun_wiki_category": {
"column": {
"category_id": true,
"parent_id": true,
"title": true,
"slug": true,
"custom_url_path": true,
"logo_path": true,
"summary": true,
"content": true,
"meta_title": true,
"meta_description": true,
"meta_keywords": true,
"is_active": true,
"is_default_open": true,
"is_clickable": true,
"show_download_center": true,
"show_parameter_comparison": true,
"sort_order": true,
"created_at": true,
"updated_at": true
},
"constraint": {
"PRIMARY": true,
"ESUN_WIKI_CATEGORY_SLUG": true,
"ESUN_WIKI_CATEGORY_CUSTOM_URL_PATH": true,
"ESUN_WIKI_CATEGORY_PARENT_ID_ESUN_WIKI_CATEGORY_CATEGORY_ID": true
},
"index": {
"ESUN_WIKI_CATEGORY_PARENT_SORT": true,
"ESUN_WIKI_CATEGORY_ACTIVE_SORT": true
}
},
"esun_wiki_category_store": {
"column": {
"category_id": true,
"store_id": true
},
"constraint": {
"PRIMARY": true,
"ESUN_WIKI_CATEGORY_STORE_CATEGORY_ID_CATEGORY_CATEGORY_ID": true,
"ESUN_WIKI_CATEGORY_STORE_STORE_ID_STORE_STORE_ID": true
},
"index": {
"ESUN_WIKI_CATEGORY_STORE_STORE_ID": true
}
},
"esun_wiki_homepage": {
"column": {
"homepage_id": true,
"title": true,
"content": true,
"meta_title": true,
"meta_description": true,
"meta_keywords": true,
"created_at": true,
"updated_at": true
},
"constraint": {
"PRIMARY": true
}
}
}
+15
View File
@@ -0,0 +1,15 @@
<?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\Framework\App\RouterList">
<arguments>
<argument name="routerList" xsi:type="array">
<item name="esun_wiki_custom_url" xsi:type="array">
<item name="class" xsi:type="string">Esun\Wiki\Controller\Router</item>
<item name="disable" xsi:type="boolean">false</item>
<item name="sortOrder" xsi:type="string">45</item>
</item>
</argument>
</arguments>
</type>
</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="standard">
<route id="wiki" frontName="wiki">
<module name="Esun_Wiki"/>
</route>
</router>
</config>
+17
View File
@@ -0,0 +1,17 @@
<?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_Wiki">
<sequence>
<module name="Magento_Backend"/>
<module name="Magento_Catalog"/>
<module name="Magento_Checkout"/>
<module name="Magento_Cms"/>
<module name="Magento_Config"/>
<module name="Magento_PageBuilder"/>
<module name="Magento_Store"/>
<module name="Esun_Catalog"/>
<module name="Esun_ImageManager"/>
</sequence>
</module>
</config>