Rajout du module View pour pouvoir afficher dans les menus la liste des marques

This commit is contained in:
2023-12-02 15:42:11 +01:00
parent fc6a693f1c
commit 97a75fbf2a
37 changed files with 4471 additions and 5 deletions

View File

@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8" ?>
<config xmlns="http://thelia.net/schema/dic/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://thelia.net/schema/dic/config http://thelia.net/schema/dic/config/thelia-1.0.xsd">
<loops>
<loop name="view" class="View\Loop\View" />
<loop name="frontview" class="View\Loop\FrontView" />
<loop name="frontfiles" class="View\Loop\Frontfiles" />
</loops>
<forms>
<form name="view.create" class="View\Form\ViewForm" />
</forms>
<commands>
<!--
<command class="MyModule\Command\MySuperCommand" />
-->
</commands>
<services>
<service id="view.listener" class="View\Listener\ViewListener">
<argument type="service" id="service_container"/>
<tag name="kernel.event_subscriber"/>
</service>
<service id="module.view.listener" class="View\Listener\ControllerListener">
<tag name="kernel.event_subscriber"/>
</service>
</services>
<hooks>
<hook id="view.hookmanager.hook" class="View\Hook\HookManager">
<tag name="hook.event_listener" event="module.configuration" type="back" method="onModuleConfiguration"/>
<tag name="hook.event_listener" event="category.tab-content" type="back" method="onEditModuleTab"/>
<tag name="hook.event_listener" event="content.tab-content" type="back" method="onEditModuleTab"/>
<tag name="hook.event_listener" event="folder.tab-content" type="back" method="onEditModuleTab"/>
<tag name="hook.event_listener" event="product.tab-content" type="back" method="onEditModuleTab"/>
</hook>
</hooks>
</config>

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="http://thelia.net/schema/dic/module"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://thelia.net/schema/dic/module http://thelia.net/schema/dic/module/module-2_1.xsd">
<fullnamespace>View\View</fullnamespace>
<descriptive locale="en_US">
<title>Assign a specific view for any category, product, folder or content</title>
</descriptive>
<descriptive locale="fr_FR">
<title>Utilisez une vue spécifique pour chaque catégorie, produit, dossier ou contenu</title>
</descriptive>
<languages>
<language>en_US</language>
<language>fr_FR</language>
</languages>
<version>2.0.2</version>
<author>
<name>Anthony Chevrier / Franck Allimant</name>
<email>anthony@meedle.fr / thelia@cqfdev.fr</email>
</author>
<type>classic</type>
<thelia>2.1.0</thelia>
<stability>other</stability>
</module>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<routes xmlns="http://symfony.com/schema/routing"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
<route id="view.add" path="/admin/view/add/{source_id}" methods="post">
<default key="_controller">View\Controller\ViewController::createAction</default>
<requirement key="source_id">\d+</requirement>
</route>
</routes>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<database defaultIdMethod="native" name="thelia" namespace="View\Model">
<!--
See propel documentation on http://propelorm.org for all information about schema file
-->
<table name="view">
<column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
<column name="view" size="255" type="VARCHAR" />
<column name="source" type="CLOB" />
<column name="source_id" type="INTEGER" />
<column name="subtree_view" size="255" type="VARCHAR" default="" />
<column name="children_view" size="255" type="VARCHAR" default="" />
<behavior name="timestampable" />
</table>
<external-schema filename="local/config/schema.xml" referenceOnly="true" />
</database>

View File

@@ -0,0 +1,26 @@
# This is a fix for InnoDB in MySQL >= 4.1.x
# It "suspends judgement" for fkey relationships until are tables are set.
SET FOREIGN_KEY_CHECKS = 0;
-- ---------------------------------------------------------------------
-- view
-- ---------------------------------------------------------------------
DROP TABLE IF EXISTS `view`;
CREATE TABLE `view`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`view` VARCHAR(255),
`source` LONGTEXT,
`source_id` INTEGER,
`subtree_view` VARCHAR(255) DEFAULT '',
`children_view` VARCHAR(255) DEFAULT '',
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`)
) ENGINE=InnoDB;
# This restores the fkey checks, after having unset them earlier
SET FOREIGN_KEY_CHECKS = 1;

View File

@@ -0,0 +1,14 @@
# This is a fix for InnoDB in MySQL >= 4.1.x
# It "suspends judgement" for fkey relationships until are tables are set.
SET FOREIGN_KEY_CHECKS = 0;
-- ---------------------------------------------------------------------
-- view
-- ---------------------------------------------------------------------
ALTER TABLE `view` ADD `subtree_view` VARCHAR(255) AFTER `view`;
ALTER TABLE `view` ADD `children_view` VARCHAR(255) AFTER `view`;
# This restores the fkey checks, after having unset them earlier
SET FOREIGN_KEY_CHECKS = 1;