Initial commit
This commit is contained in:
25
local/modules/Carousel/Config/config.xml
Normal file
25
local/modules/Carousel/Config/config.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?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="carousel" class="Carousel\Loop\CarouselLoop" />
|
||||
</loops>
|
||||
|
||||
<forms>
|
||||
<form name="carousel.image" class="Carousel\Form\CarouselImageForm" />
|
||||
<form name="carousel.update" class="Carousel\Form\CarouselUpdateForm" />
|
||||
</forms>
|
||||
|
||||
<hooks>
|
||||
<hook id="carousel.hook">
|
||||
<tag name="hook.event_listener" event="home.body" type="front" templates="render:carousel.html" />
|
||||
<tag name="hook.event_listener" event="module.configuration" type="back" templates="render:module_configuration.html" />
|
||||
<tag name="hook.event_listener" event="module.config-js" type="back" templates="js:assets/js/module-configuration.js" />
|
||||
</hook>
|
||||
<hook id="carousel.hook.back" class="Carousel\Hook\BackHook">
|
||||
<tag name="hook.event_listener" event="main.top-menu-tools" type="back" />
|
||||
</hook>
|
||||
</hooks>
|
||||
</config>
|
||||
24
local/modules/Carousel/Config/module.xml
Normal file
24
local/modules/Carousel/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>Carousel\Carousel</fullnamespace>
|
||||
<descriptive locale="en_US">
|
||||
<title>An image carousel</title>
|
||||
</descriptive>
|
||||
<descriptive locale="fr_FR">
|
||||
<title>Un carrousel d'images</title>
|
||||
</descriptive>
|
||||
<languages>
|
||||
<language>en_US</language>
|
||||
<language>fr_FR</language>
|
||||
</languages>
|
||||
<version>2.4.3</version>
|
||||
<author>
|
||||
<name>Manuel Raynaud, Franck Allimant</name>
|
||||
<email>manu@raynaud.io, franck@cqfdev.fr</email>
|
||||
</author>
|
||||
<type>classic</type>
|
||||
<thelia>2.4.3</thelia>
|
||||
<stability>alpha</stability>
|
||||
</module>
|
||||
42
local/modules/Carousel/Config/routing.xml
Normal file
42
local/modules/Carousel/Config/routing.xml
Normal file
@@ -0,0 +1,42 @@
|
||||
<?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">
|
||||
|
||||
<!--
|
||||
|
||||
if a /admin/module/carousel/ route is provided, a "Configuration" button will be displayed
|
||||
for the module in the module list. Clicking this button will invoke this route.
|
||||
|
||||
<route id="my_route_id" path="/admin/module/carousel">
|
||||
<default key="_controller">Carousel\Full\Class\Name\Of\YourConfigurationController::methodName</default>
|
||||
</route>
|
||||
|
||||
<route id="my_route_id" path="/admin/module/carousel/route-name">
|
||||
<default key="_controller">Carousel\Full\Class\Name\Of\YourAdminController::methodName</default>
|
||||
</route>
|
||||
|
||||
<route id="my_route_id" path="/my/route/name">
|
||||
<default key="_controller">Carousel\Full\Class\Name\Of\YourOtherController::methodName</default>
|
||||
</route>
|
||||
|
||||
...add as many routes as required.
|
||||
|
||||
<route>
|
||||
...
|
||||
</route>
|
||||
-->
|
||||
<route id="carousel.upload.image" path="/admin/module/carousel/upload" methods="post">
|
||||
<default key="_controller">Carousel\Controller\ConfigurationController::uploadImage</default>
|
||||
</route>
|
||||
|
||||
<route id="carousel.update" path="/admin/module/carousel/update" methods="post">
|
||||
<default key="_controller">Carousel\Controller\ConfigurationController::updateAction</default>
|
||||
</route>
|
||||
|
||||
<route id="carousel.delete" path="/admin/module/carousel/delete" methods="post">
|
||||
<default key="_controller">Carousel\Controller\ConfigurationController::deleteAction</default>
|
||||
</route>
|
||||
|
||||
</routes>
|
||||
29
local/modules/Carousel/Config/schema.xml
Normal file
29
local/modules/Carousel/Config/schema.xml
Normal file
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<database defaultIdMethod="native" name="thelia" namespace="Carousel\Model">
|
||||
<!--
|
||||
See propel documentation on http://propelorm.org for all information about schema file
|
||||
-->
|
||||
|
||||
<table name="carousel">
|
||||
<column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
|
||||
<column name="file" type="VARCHAR" size="255" />
|
||||
<column name="position" type="INTEGER" />
|
||||
<column name="disable" type="INTEGER" />
|
||||
<column name="group" size="255" type="VARCHAR" />
|
||||
<column name="alt" size="255" type="VARCHAR" />
|
||||
<column name="url" size="255" type="VARCHAR" />
|
||||
<column name="title" size="255" type="VARCHAR" />
|
||||
<column name="description" type="CLOB" />
|
||||
<column name="chapo" type="LONGVARCHAR" />
|
||||
<column name="postscriptum" type="LONGVARCHAR" />
|
||||
<column name="limited" type="INTEGER" />
|
||||
<column name="start_date" type="TIMESTAMP" />
|
||||
<column name="end_date" type="TIMESTAMP" />
|
||||
<behavior name="timestampable" />
|
||||
<behavior name="i18n">
|
||||
<parameter name="i18n_columns" value="alt, title, description, chapo, postscriptum" />
|
||||
</behavior>
|
||||
</table>
|
||||
|
||||
<external-schema filename="local/config/schema.xml" referenceOnly="true" />
|
||||
</database>
|
||||
6
local/modules/Carousel/Config/sql/destroy.sql
Normal file
6
local/modules/Carousel/Config/sql/destroy.sql
Normal file
@@ -0,0 +1,6 @@
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
DROP TABLE IF EXISTS `carousel`;
|
||||
DROP TABLE IF EXISTS `carousel_i18n`;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
51
local/modules/Carousel/Config/thelia.sql
Normal file
51
local/modules/Carousel/Config/thelia.sql
Normal file
@@ -0,0 +1,51 @@
|
||||
|
||||
# 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;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- carousel
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `carousel`;
|
||||
|
||||
CREATE TABLE `carousel`
|
||||
(
|
||||
`id` INTEGER NOT NULL AUTO_INCREMENT,
|
||||
`file` VARCHAR(255),
|
||||
`position` INTEGER,
|
||||
`disable` INTEGER,
|
||||
`group` VARCHAR(255),
|
||||
`url` VARCHAR(255),
|
||||
`limited` INTEGER,
|
||||
`start_date` DATETIME,
|
||||
`end_date` DATETIME,
|
||||
`created_at` DATETIME,
|
||||
`updated_at` DATETIME,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- carousel_i18n
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `carousel_i18n`;
|
||||
|
||||
CREATE TABLE `carousel_i18n`
|
||||
(
|
||||
`id` INTEGER NOT NULL,
|
||||
`locale` VARCHAR(5) DEFAULT 'en_US' NOT NULL,
|
||||
`alt` VARCHAR(255),
|
||||
`title` VARCHAR(255),
|
||||
`description` LONGTEXT,
|
||||
`chapo` TEXT,
|
||||
`postscriptum` TEXT,
|
||||
PRIMARY KEY (`id`,`locale`),
|
||||
CONSTRAINT `carousel_i18n_fk_2ec1b2`
|
||||
FOREIGN KEY (`id`)
|
||||
REFERENCES `carousel` (`id`)
|
||||
ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
# This restores the fkey checks, after having unset them earlier
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
1
local/modules/Carousel/Config/update/2.4.0.sql
Normal file
1
local/modules/Carousel/Config/update/2.4.0.sql
Normal file
@@ -0,0 +1 @@
|
||||
ALTER TABLE `carousel` ADD (`disable` INTEGER, `group` VARCHAR(255),`limited` INTEGER, `start_date` DATETIME, `end_date` DATETIME);
|
||||
Reference in New Issue
Block a user