Initial Commit
This commit is contained in:
66
local/modules/Slide/Config/config.xml
Normal file
66
local/modules/Slide/Config/config.xml
Normal file
@@ -0,0 +1,66 @@
|
||||
<?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="slide" class="Slide\Loop\SlideItemLoop" />
|
||||
<loop name="slide-rel" class="Slide\Loop\SlideRelLoop" />
|
||||
</loops>
|
||||
|
||||
<forms>
|
||||
<form name="slide.create.form" class="Slide\Form\SlideCreateForm" />
|
||||
<form name="slide.update.form" class="Slide\Form\SlideUpdateForm" />
|
||||
</forms>
|
||||
|
||||
<commands>
|
||||
<!--
|
||||
<command class="Slide\Command\MySuperCommand" />
|
||||
-->
|
||||
</commands>
|
||||
|
||||
|
||||
<services>
|
||||
<service id="slide.action" class="Slide\EventListeners\SlideAction" scope="request">
|
||||
<tag name="kernel.event_subscriber"/>
|
||||
</service>
|
||||
</services>
|
||||
|
||||
|
||||
<hooks>
|
||||
<hook id="slide.hook.back" class="Slide\Hook\BackHook" scope="request">
|
||||
<tag name="hook.event_listener" event="main.top-menu-tools" type="back" />
|
||||
|
||||
<tag name="hook.event_listener" event="category.tab-content" type="back" method="onTabContent" />
|
||||
<tag name="hook.event_listener" event="product.tab-content" type="back" method="onTabContent" />
|
||||
<tag name="hook.event_listener" event="folder.tab-content" type="back" method="onTabContent" />
|
||||
<tag name="hook.event_listener" event="content.tab-content" type="back" method="onTabContent" />
|
||||
<tag name="hook.event_listener" event="brand.tab-content" type="back" method="onTabContent" />
|
||||
|
||||
<tag name="hook.event_listener" event="category.edit-js" type="back" method="onTabContentJs" />
|
||||
<tag name="hook.event_listener" event="product.edit-js" type="back" method="onTabContentJs" />
|
||||
<tag name="hook.event_listener" event="folder.edit-js" type="back" method="onTabContentJs" />
|
||||
<tag name="hook.event_listener" event="content.edit-js" type="back" method="onTabContentJs" />
|
||||
<tag name="hook.event_listener" event="brand.edit-js" type="back" method="onTabContentJs" />
|
||||
</hook>
|
||||
<hook id="slide.hook.front" class="Slide\Hook\FrontHook" scope="request">
|
||||
<tag name="hook.event_listener" event="main.content-top" type="front" />
|
||||
<tag name="hook.event_listener" event="main.javascript-initialization" type="front" />
|
||||
<tag name="hook.event_listener" event="main.stylesheet" type="front" />
|
||||
<tag name="hook.event_listener" event="main.after-javascript-include" type="front" />
|
||||
</hook>
|
||||
</hooks>
|
||||
|
||||
<!--
|
||||
<exports>
|
||||
|
||||
</exports>
|
||||
-->
|
||||
|
||||
<!--
|
||||
<imports>
|
||||
|
||||
</imports>
|
||||
-->
|
||||
</config>
|
||||
24
local/modules/Slide/Config/module.xml
Normal file
24
local/modules/Slide/Config/module.xml
Normal 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>Slide\Slide</fullnamespace>
|
||||
<descriptive locale="en_US">
|
||||
<title>Slide</title>
|
||||
</descriptive>
|
||||
<descriptive locale="fr_FR">
|
||||
<title>Slide</title>
|
||||
</descriptive>
|
||||
<languages>
|
||||
<language>en_US</language>
|
||||
<language>fr_FR</language>
|
||||
</languages>
|
||||
<version>0.1</version>
|
||||
<author>
|
||||
<name>Julien </name>
|
||||
<email>jchanseaume@openstudio.fr</email>
|
||||
</author>
|
||||
<type>classic</type>
|
||||
<thelia>2.1.0</thelia>
|
||||
<stability>alpha</stability>
|
||||
</module>
|
||||
36
local/modules/Slide/Config/routing.xml
Normal file
36
local/modules/Slide/Config/routing.xml
Normal file
@@ -0,0 +1,36 @@
|
||||
<?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="admin.slide.slides.default" path="/admin/module/slides">
|
||||
<default key="_controller">Slide\Controller\BackController::defaultAction</default>
|
||||
</route>
|
||||
|
||||
<route id="admin.slide.slides.create" path="/admin/module/slide/create">
|
||||
<default key="_controller">Slide\Controller\BackController::createAction</default>
|
||||
</route>
|
||||
|
||||
<route id="admin.slide.slides.update" path="/admin/module/slide/update/{slide_id}">
|
||||
<default key="_controller">Slide\Controller\BackController::updateAction</default>
|
||||
<requirement key="slide_id">\d+</requirement>
|
||||
</route>
|
||||
|
||||
<route id="admin.slide.slides.save" path="/admin/module/slide/save/{slide_id}" methods="post">
|
||||
<default key="_controller">Slide\Controller\BackController::processUpdateAction</default>
|
||||
<requirement key="slide_id">\d+</requirement>
|
||||
</route>
|
||||
|
||||
<route id="admin.slide.slides.delete" path="/admin/module/slide/delete" methods="post">
|
||||
<default key="_controller">Slide\Controller\BackController::deleteAction</default>
|
||||
</route>
|
||||
|
||||
<route id="admin.slide.slides.position" path="/admin/slide/position/save/{ref}/{ref_id}" methods="post">
|
||||
<default key="_controller">Slide\Controller\BackController::savePositionAction</default>
|
||||
<requirement key="ref">.*</requirement>
|
||||
<requirement key="ref_id">\d+</requirement>
|
||||
</route>
|
||||
|
||||
</routes>
|
||||
26
local/modules/Slide/Config/schema.xml
Normal file
26
local/modules/Slide/Config/schema.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<database defaultIdMethod="native" name="thelia"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="../../../../core/vendor/propel/propel/resources/xsd/database.xsd" >
|
||||
|
||||
<table name="slide_item" phpName="SlideItem" namespace="Slide\Model">
|
||||
<column name="id" primaryKey="true" autoIncrement="true" required="true" type="INTEGER" />
|
||||
<column name="title" size="255" type="VARCHAR" />
|
||||
<column name="content" type="LONGVARCHAR" />
|
||||
</table>
|
||||
|
||||
<table name="slide_rel" phpName="SlideRel" namespace="Slide\Model">
|
||||
<column name="id" primaryKey="true" autoIncrement="true" required="true" type="INTEGER" />
|
||||
<column name="position" type="INTEGER" default="1" required="true" />
|
||||
<column name="slide_id" type="INTEGER" required="true" />
|
||||
<column name="ref" type="VARCHAR" required="true" />
|
||||
<column name="ref_id" type="INTEGER" required="true" />
|
||||
|
||||
<foreign-key foreignTable="slide_item" name="slide_rel_slide_id" onDelete="CASCADE" >
|
||||
<reference local="slide_id" foreign="id" />
|
||||
</foreign-key>
|
||||
</table>
|
||||
|
||||
<external-schema filename="local/config/schema.xml" referenceOnly="true" />
|
||||
|
||||
</database>
|
||||
2
local/modules/Slide/Config/sqldb.map
Normal file
2
local/modules/Slide/Config/sqldb.map
Normal file
@@ -0,0 +1,2 @@
|
||||
# Sqlfile -> Database map
|
||||
thelia.sql=thelia
|
||||
42
local/modules/Slide/Config/thelia.sql
Normal file
42
local/modules/Slide/Config/thelia.sql
Normal file
@@ -0,0 +1,42 @@
|
||||
|
||||
# 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;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- slide_item
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `slide_item`;
|
||||
|
||||
CREATE TABLE `slide_item`
|
||||
(
|
||||
`id` INTEGER NOT NULL AUTO_INCREMENT,
|
||||
`title` VARCHAR(255),
|
||||
`content` TEXT,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- slide_rel
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `slide_rel`;
|
||||
|
||||
CREATE TABLE `slide_rel`
|
||||
(
|
||||
`id` INTEGER NOT NULL AUTO_INCREMENT,
|
||||
`position` INTEGER DEFAULT 1 NOT NULL,
|
||||
`slide_id` INTEGER NOT NULL,
|
||||
`ref` VARCHAR(255) NOT NULL,
|
||||
`ref_id` INTEGER NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `FI_de_rel_slide_id` (`slide_id`),
|
||||
CONSTRAINT `slide_rel_slide_id`
|
||||
FOREIGN KEY (`slide_id`)
|
||||
REFERENCES `slide_item` (`id`)
|
||||
ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
# This restores the fkey checks, after having unset them earlier
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
Reference in New Issue
Block a user