feat(main): Groups and blocks

This commit is contained in:
2026-08-10 16:13:15 +02:00
parent 6aff506cd6
commit 635c13a0ed
39 changed files with 1188 additions and 237 deletions
+47 -11
View File
@@ -1,34 +1,70 @@
services:
websmid.customhtml.form.type.customhtml:
websmid.customhtml.form.type.customhtml_group:
public: true
class: 'Websmid\CustomHtml\Form\Type\CustomHtmlType'
class: 'Websmid\CustomHtml\Form\Type\CustomHtmlGroupType'
parent: 'form.type.translatable.aware'
tags:
- { name: form.type }
websmid.customhtml.form.customhtml_data_provider:
websmid.customhtml.form.customhtmlgroup_data_provider:
public: true
class: 'Websmid\CustomHtml\Form\DataProvider\CustomHtmlDataProvider'
class: 'Websmid\CustomHtml\Form\DataProvider\CustomHtmlGroupDataProvider'
websmid.customhtml.form.customhtml_data_form_builder:
websmid.customhtml.form.customhtmlgroup_data_form_builder:
public: true
class: 'PrestaShop\PrestaShop\Core\Form\IdentifiableObject\Builder\FormBuilder'
factory:
- '@prestashop.core.form.builder.form_builder_factory'
- 'create'
arguments:
- 'Websmid\CustomHtml\Form\Type\CustomHtmlType'
- '@websmid.customhtml.form.customhtml_data_provider'
- 'Websmid\CustomHtml\Form\Type\CustomHtmlGroupType'
- '@websmid.customhtml.form.customhtmlgroup_data_provider'
websmid.customhtml.form.customhtml_data_handler:
websmid.customhtml.form.customhtmlgroup_data_handler:
public: true
class: 'Websmid\CustomHtml\Form\DataHandler\CustomHtmlDataHandler'
class: 'Websmid\CustomHtml\Form\DataHandler\CustomHtmlGroupDataHandler'
websmid.customhtml.form.customhtml_form_handler:
websmid.customhtml.form.customhtmlgroup_form_handler:
public: true
class: 'PrestaShop\PrestaShop\Core\Form\IdentifiableObject\Handler\FormHandler'
factory:
- '@prestashop.core.form.identifiable_object.handler.form_handler_factory'
- 'create'
arguments:
- '@websmid.customhtml.form.customhtml_data_handler'
- '@websmid.customhtml.form.customhtmlgroup_data_handler'
websmid.customhtml.form.type.customhtml_block:
public: true
class: 'Websmid\CustomHtml\Form\Type\CustomHtmlBlockType'
parent: 'form.type.translatable.aware'
arguments:
- '@websmid.customhtml.form.choice_provider.customhtml_group_choice_provider'
tags:
- { name: form.type }
websmid.customhtml.form.customhtmlblock_data_provider:
public: true
class: 'Websmid\CustomHtml\Form\DataProvider\CustomHtmlBlockDataProvider'
websmid.customhtml.form.customhtmlblock_data_form_builder:
public: true
class: 'PrestaShop\PrestaShop\Core\Form\IdentifiableObject\Builder\FormBuilder'
factory:
- '@prestashop.core.form.builder.form_builder_factory'
- 'create'
arguments:
- 'Websmid\CustomHtml\Form\Type\CustomHtmlBlockType'
- '@websmid.customhtml.form.customhtmlblock_data_provider'
websmid.customhtml.form.customhtmlblock_data_handler:
public: true
class: 'Websmid\CustomHtml\Form\DataHandler\CustomHtmlBlockDataHandler'
websmid.customhtml.form.customhtmlblock_form_handler:
public: true
class: 'PrestaShop\PrestaShop\Core\Form\IdentifiableObject\Handler\FormHandler'
factory:
- '@prestashop.core.form.identifiable_object.handler.form_handler_factory'
- 'create'
arguments:
- '@websmid.customhtml.form.customhtmlblock_data_handler'
+45 -10
View File
@@ -1,12 +1,12 @@
services:
websmid.customhtml.grid.definition.factory.customhtml_definition_factory:
websmid.customhtml.grid.definition.factory.customhtmlgroup_definition_factory:
public: true
class: 'Websmid\CustomHtml\Grid\Definition\Factory\CustomHtmlGridDefinitionFactory'
class: 'Websmid\CustomHtml\Grid\Definition\Factory\CustomHtmlGroupGridDefinitionFactory'
parent: 'prestashop.core.grid.definition.factory.abstract_grid_definition'
websmid.customhtml.grid.query.customhtml_query_builder:
websmid.customhtml.grid.query.customhtmlgroup_query_builder:
public: true
class: 'Websmid\CustomHtml\Grid\Query\CustomHtmlQueryBuilder'
class: 'Websmid\CustomHtml\Grid\Query\CustomHtmlGroupQueryBuilder'
parent: 'prestashop.core.grid.abstract_query_builder'
arguments:
- '@prestashop.core.query.doctrine_search_criteria_applicator'
@@ -16,20 +16,55 @@ services:
- '@prestashop.core.grid.query.filter.doctrine_filter_applicator'
- '@prestashop.adapter.legacy.configuration'
websmid.customhtml.grid.data.factory.customhtml_data_factory:
websmid.customhtml.grid.data.factory.customhtmlgroup_data_factory:
public: true
class: '%prestashop.core.grid.data.factory.doctrine_grid_data_factory%'
arguments:
- '@websmid.customhtml.grid.query.customhtml_query_builder'
- '@websmid.customhtml.grid.query.customhtmlgroup_query_builder'
- '@prestashop.core.hook.dispatcher'
- '@prestashop.core.grid.query.doctrine_query_parser'
- 'customhtml'
- 'customhtmlgroup'
websmid.customhtml.grid.customhtml_grid_factory:
websmid.customhtml.grid.customhtmlgroup_grid_factory:
public: true
class: 'PrestaShop\PrestaShop\Core\Grid\GridFactory'
arguments:
- '@websmid.customhtml.grid.definition.factory.customhtml_definition_factory'
- '@websmid.customhtml.grid.data.factory.customhtml_data_factory'
- '@websmid.customhtml.grid.definition.factory.customhtmlgroup_definition_factory'
- '@websmid.customhtml.grid.data.factory.customhtmlgroup_data_factory'
- '@prestashop.core.grid.filter.form_factory'
- '@prestashop.core.hook.dispatcher'
websmid.customhtml.grid.definition.factory.customhtmlblock_definition_factory:
public: true
class: 'Websmid\CustomHtml\Grid\Definition\Factory\CustomHtmlBlockGridDefinitionFactory'
parent: 'prestashop.core.grid.definition.factory.abstract_grid_definition'
websmid.customhtml.grid.query.customhtmlblock_query_builder:
public: true
class: 'Websmid\CustomHtml\Grid\Query\CustomHtmlBlockQueryBuilder'
parent: 'prestashop.core.grid.abstract_query_builder'
arguments:
- '@prestashop.core.query.doctrine_search_criteria_applicator'
- "@=service('prestashop.adapter.legacy.context').getContext().language.id"
- "@=service('prestashop.adapter.legacy.context').getContext().shop.id"
- "@=service('prestashop.adapter.legacy.context').getContext().shop.id_shop_group"
- '@prestashop.core.grid.query.filter.doctrine_filter_applicator'
- '@prestashop.adapter.legacy.configuration'
websmid.customhtml.grid.data.factory.customhtmlblock_data_factory:
public: true
class: '%prestashop.core.grid.data.factory.doctrine_grid_data_factory%'
arguments:
- '@websmid.customhtml.grid.query.customhtmlblock_query_builder'
- '@prestashop.core.hook.dispatcher'
- '@prestashop.core.grid.query.doctrine_query_parser'
- 'customhtmlblock'
websmid.customhtml.grid.customhtmlblock_grid_factory:
public: true
class: 'PrestaShop\PrestaShop\Core\Grid\GridFactory'
arguments:
- '@websmid.customhtml.grid.definition.factory.customhtmlblock_definition_factory'
- '@websmid.customhtml.grid.data.factory.customhtmlblock_data_factory'
- '@prestashop.core.grid.filter.form_factory'
- '@prestashop.core.hook.dispatcher'
+4
View File
@@ -0,0 +1,4 @@
services:
websmid.customhtml.form.choice_provider.customhtml_group_choice_provider:
public: true
class: 'Websmid\CustomHtml\Form\ChoiceProvider\CustomHtmlGroupChoiceProvider'
+54 -13
View File
@@ -2,31 +2,72 @@ customhtml_index:
path: ws_customhtml
methods: [GET]
defaults:
_controller: 'Websmid\CustomHtml\Controller\CustomHtmlController::indexAction'
_controller: 'Websmid\CustomHtml\Controller\CustomHtmlGroupController::indexAction'
_legacy_controller: AdminCustomHtmlParent
_legacy_link: AdminCustomHtmlParent:index
customhtmlgroup_index:
path: ws_customhtml/group
methods: [GET]
defaults:
_controller: 'Websmid\CustomHtml\Controller\CustomHtmlGroupController::indexAction'
_legacy_controller: AdminCustomHtmlOverview
_legacy_link: AdminCustomHtmlOverview:index
customhtml_search:
path: ws_customhtml
customhtmlgroup_search:
path: ws_customhtml/group
methods: [POST]
defaults:
_controller: 'Websmid\CustomHtml\Controller\CustomHtmlController::searchAction'
_controller: 'Websmid\CustomHtml\Controller\CustomHtmlGroupController::searchAction'
_legacy_controller: AdminCustomHtmlOverview
customhtml_create:
path: ws_customhtml/create
customhtmlgroup_create:
path: ws_customhtml/group/create
methods: [POST, GET]
defaults:
_controller: 'Websmid\CustomHtml\Controller\CustomHtmlController::createAction'
_controller: 'Websmid\CustomHtml\Controller\CustomHtmlGroupController::createAction'
customhtml_edit:
path: ws_customhtml/edit/{idCustomHtml}
customhtmlgroup_edit:
path: ws_customhtml/group/edit/{idCustomHtmlGroup}
methods: [POST, GET]
defaults:
_controller: 'Websmid\CustomHtml\Controller\CustomHtmlController::editAction'
_controller: 'Websmid\CustomHtml\Controller\CustomHtmlGroupController::editAction'
customhtml_delete:
path: ws_customhtml/delete/{idCustomHtml}
customhtmlgroup_delete:
path: ws_customhtml/group/delete/{idCustomHtmlGroup}
methods: [DELETE, GET, POST]
defaults:
_controller: 'Websmid\CustomHtml\Controller\CustomHtmlController::deleteAction'
_controller: 'Websmid\CustomHtml\Controller\CustomHtmlGroupController::deleteAction'
customhtmlblock_index:
path: ws_customhtml/block
methods: [GET]
defaults:
_controller: 'Websmid\CustomHtml\Controller\CustomHtmlBlockController::indexAction'
_legacy_controller: AdminCustomHtmlBlockOverview
_legacy_link: AdminCustomHtmlBlockOverview:index
customhtmlblock_search:
path: ws_customhtml/block
methods: [POST]
defaults:
_controller: 'Websmid\CustomHtml\Controller\CustomHtmlBlockController::searchAction'
_legacy_controller: AdminCustomHtmlBlockOverview
customhtmlblock_create:
path: ws_customhtml/block/create
methods: [POST, GET]
defaults:
_controller: 'Websmid\CustomHtml\Controller\CustomHtmlBlockController::createAction'
customhtmlblock_edit:
path: ws_customhtml/block/edit/{idCustomHtmlBlock}
methods: [POST, GET]
defaults:
_controller: 'Websmid\CustomHtml\Controller\CustomHtmlBlockController::editAction'
customhtmlblock_delete:
path: ws_customhtml/block/delete/{idCustomHtmlBlock}
methods: [DELETE, GET, POST]
defaults:
_controller: 'Websmid\CustomHtml\Controller\CustomHtmlBlockController::deleteAction'
+1
View File
@@ -1,3 +1,4 @@
imports:
- { resource: form.yml }
- { resource: grid.yml }
- { resource: provider.yml }