Initial commit: is_imageslider out of the box. v2.3.2

This commit is contained in:
Isabelle Anno
2025-11-19 13:30:22 +01:00
commit 2f4716f567
100 changed files with 8635 additions and 0 deletions

View File

@ -0,0 +1,11 @@
<?php
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@ -0,0 +1,191 @@
imports:
- { resource: ../common.yml }
services:
_defaults:
public: true
# Controller
Oksydan\IsImageslider\Controller\IsImagesliderController:
public: true
class: Oksydan\IsImageslider\Controller\IsImagesliderController
arguments:
- '@oksydan.is_imageslider.handler.file_eraser'
- "@=service('prestashop.adapter.legacy.context').getLanguages(false)"
- "@oksydan.is_imageslider.cache.template_cache"
# installer
oksydan.is_imageslider.image_slider_installer:
class: 'Oksydan\IsImageslider\Installer\ImageSliderInstaller'
arguments:
- '@doctrine.dbal.default_connection'
- '@oksydan.is_imageslider.installer.database_yml_parser'
- "@=service('prestashop.adapter.legacy.context').getContext()"
oksydan.is_imageslider.installer.database_yml_parser:
class: 'Oksydan\IsImageslider\Installer\DatabaseYamlParser'
arguments:
- '@oksydan.is_imageslider.installer.database_yml_parser_provider'
oksydan.is_imageslider.installer.database_yml_parser_provider:
class: 'Oksydan\IsImageslider\Installer\Provider\DatabaseYamlProvider'
arguments:
- '@oksydan.is_imageslider.module'
oksydan.is_imageslider.installer.action_databse_create_table:
class: 'Oksydan\IsImageslider\Installer\ActionDatabaseCrateTable'
parent: 'oksydan.is_imageslider.installer.abstract_action_databse'
public: true
oksydan.is_imageslider.installer.action_databse_drop_table:
class: 'Oksydan\IsImageslider\Installer\ActionDatabaseDropTable'
parent: 'oksydan.is_imageslider.installer.abstract_action_databse'
public: true
oksydan.is_imageslider.installer.abstract_action_databse:
class: 'Oksydan\IsImageslider\Installer\ActionDatabaseAbstract'
abstract: true
arguments:
- '@doctrine.dbal.default_connection'
- '%database_prefix%'
oksydan.is_imageslider.handler.file_uploader:
class: 'Oksydan\IsImageslider\Handler\FileUploader'
arguments:
$targetDirectory: '%is_imageslider_images_directory%'
oksydan.is_imageslider.handler.file_eraser:
class: 'Oksydan\IsImageslider\Handler\FileEraser'
arguments:
$targetDirectory: '%is_imageslider_images_directory%'
#creation/edition form
oksydan.is_imageslider.form.identifiable_object.data_provider.image_slider_form_data_provider:
class: 'Oksydan\IsImageslider\Form\Provider\ImageSliderFormDataProvider'
arguments:
- '@oksydan.is_imageslider.repository.image_slider'
- '@oksydan.is_imageslider.provider.image_provider'
- '@prestashop.core.admin.lang.repository'
- '%is_imageslider_placeholder_img%'
- '@prestashop.adapter.shop.context'
oksydan.is_imageslider.form.identifiable_object.builder.image_slider_form_builder:
class: 'PrestaShop\PrestaShop\Core\Form\IdentifiableObject\Builder\FormBuilder'
factory: 'prestashop.core.form.builder.form_builder_factory:create'
arguments:
- 'Oksydan\IsImageslider\Form\ImageSliderType'
- '@oksydan.is_imageslider.form.identifiable_object.data_provider.image_slider_form_data_provider'
oksydan.is_imageslider.form.identifiable_object.data_handler.image_slider_form_data_handler:
class: 'Oksydan\IsImageslider\Form\DataHandler\ImageSliderFormDataHandler'
arguments:
- '@oksydan.is_imageslider.repository.image_slider'
- '@prestashop.core.admin.lang.repository'
- '@doctrine.orm.default_entity_manager'
- '@oksydan.is_imageslider.handler.file_uploader'
- '@oksydan.is_imageslider.handler.file_eraser'
- "@=service('prestashop.adapter.legacy.context').getLanguages()"
oksydan.is_imageslider.form.identifiable_object.handler.image_slider_form_handler:
class: 'PrestaShop\PrestaShop\Core\Form\IdentifiableObject\Handler\FormHandler'
factory: 'prestashop.core.form.identifiable_object.handler.form_handler_factory:create'
arguments:
- '@oksydan.is_imageslider.form.identifiable_object.data_handler.image_slider_form_data_handler'
#grid services
oksydan.is_imageslider.grid.definition.factory.image_sliders:
class: 'Oksydan\IsImageslider\Grid\Definition\Factory\ImageSliderGridDefinitionFactory'
parent: 'prestashop.core.grid.definition.factory.abstract_grid_definition'
public: true
oksydan.is_imageslider.grid.query.image_slider_query_builder:
class: 'Oksydan\IsImageslider\Grid\Query\ImageSliderQueryBuilder'
parent: 'prestashop.core.grid.abstract_query_builder'
public: true
arguments:
- '@prestashop.adapter.shop.context'
- "@=service('prestashop.adapter.legacy.context').getContext().language.id"
oksydan.is_imageslider.grid.image_slider_grid_factory:
class: 'PrestaShop\PrestaShop\Core\Grid\GridFactory'
arguments:
- '@oksydan.is_imageslider.grid.definition.factory.image_sliders'
- '@oksydan.is_imageslider.grid.data.factory.image_slider_decorator'
- '@prestashop.core.grid.filter.form_factory'
- '@prestashop.core.hook.dispatcher'
oksydan.is_imageslider.grid.data.factory.image_slider_data_factory:
class: '%prestashop.core.grid.data.factory.doctrine_grid_data_factory%'
arguments:
- '@oksydan.is_imageslider.grid.query.image_slider_query_builder'
- '@prestashop.core.hook.dispatcher'
- '@prestashop.core.grid.query.doctrine_query_parser'
- 'is_imageslider'
oksydan.is_imageslider.grid.data.factory.image_slider_decorator:
class: 'Oksydan\IsImageslider\Grid\Data\Factory\ImageSliderGridDataFactory'
arguments:
- '@oksydan.is_imageslider.grid.data.factory.image_slider_data_factory'
- '@oksydan.is_imageslider.provider.image_provider'
# config form
oksydan.is_imageslider.image_slider.configuration:
class: 'Oksydan\IsImageslider\Form\DataConfiguration\ImageSliderDataConfiguration'
arguments:
- '@prestashop.adapter.legacy.configuration'
- '@prestashop.adapter.shop.context'
- '@prestashop.adapter.multistore_feature'
oksydan.is_imageslider.image_slider_configuration.form_provider:
class: 'Oksydan\IsImageslider\Form\Provider\ImageSliderConfigurationFormDataProvider'
arguments:
- '@oksydan.is_imageslider.image_slider.configuration'
oksydan.is_imageslider.image_slider_configuration.form_handler:
class: 'PrestaShop\PrestaShop\Core\Form\Handler'
arguments:
- '@form.factory'
- '@prestashop.core.hook.dispatcher'
- '@oksydan.is_imageslider.image_slider_configuration.form_provider'
- 'Oksydan\IsImageslider\Form\ImageSliderConfigurationType'
- 'ConfigurationForm'
oksydan.is_imageslider.form.image_slider_type:
class: 'Oksydan\IsImageslider\Form\ImageSliderType'
parent: 'form.type.translatable.aware'
arguments:
- '@=service("prestashop.adapter.multistore_feature").isUsed()'
public: true
tags:
- { name: form.type }
oksydan.is_imageslider.form.image_slider_configuration_type:
class: 'Oksydan\IsImageslider\Form\ImageSliderConfigurationType'
parent: 'form.type.translatable.aware'
public: true
tags:
- { name: form.type }
Oksydan\IsImageslider\Type\TranslatableFile:
class: 'Oksydan\IsImageslider\Type\TranslatableFile'
parent: 'form.type.common.translatable'
public: true
tags:
- { name: form.type }
oksydan.is_imageslider.grid.position_definition:
class: PrestaShop\PrestaShop\Core\Grid\Position\PositionDefinition
arguments:
- 'image_slider'
- 'id_slide'
- 'position'
oksydan.is_imageslider.provider.image_provider:
class: 'Oksydan\IsImageslider\Provider\ImageProvider'
public: true
arguments:
- '%is_imageslider_images_uri%'

View File

@ -0,0 +1,91 @@
parameters:
is_imageslider_images_directory: '%kernel.project_dir%/modules/is_imageslider/img/'
is_imageslider_module_uri: !php/const _MODULE_DIR_
is_imageslider_images_uri: '%is_imageslider_module_uri%is_imageslider/img/'
is_imageslider_placeholder_img: '/modules/is_imageslider/views/img/placeholder.jpeg'
services:
_defaults:
public: true
oksydan.is_imageslider.module:
class: Is_imageslider
factory: [ 'Module', 'getInstanceByName' ]
public: false
arguments:
- 'is_imageslider'
oksydan.is_imageslider.repository.image_slider:
class: Oksydan\IsImageslider\Repository\ImageSliderRepository
public: true
factory: ['@doctrine.orm.default_entity_manager', getRepository]
arguments:
- Oksydan\IsImageslider\Entity\ImageSlider
oksydan.is_imageslider.repository.hook_module_repository:
class: Oksydan\IsImageslider\Repository\HookModuleRepository
public: true
arguments:
- '@doctrine.dbal.default_connection'
- '%database_prefix%'
oksydan.is_imageslider.presenter.image_slide_presenter:
class: Oksydan\IsImageslider\Presenter\ImageSlidePresenter
public: true
arguments:
- '%is_imageslider_images_uri%'
- '%is_imageslider_images_directory%'
- "@=service('prestashop.adapter.legacy.context').getContext()"
oksydan.is_imageslider.configuration.slider_configuration:
class: Oksydan\IsImageslider\Configuration\SliderConfiguration
public: true
oksydan.is_imageslider.hook.abstract_hook:
class: Oksydan\IsImageslider\Hook\AbstractHook
public: true
arguments:
- '@oksydan.is_imageslider.module'
- "@=service('prestashop.adapter.legacy.context').getContext()"
oksydan.is_imageslider.hook.abstract_display_hook:
class: Oksydan\IsImageslider\Hook\AbstractDisplayHook
parent: 'oksydan.is_imageslider.hook.abstract_hook'
public: true
arguments:
- '@oksydan.is_imageslider.configuration.slider_configuration'
oksydan.is_imageslider.hook.abstract_cacheable_display_hook:
class: Oksydan\IsImageslider\Hook\AbstractCacheableDisplayHook
parent: 'oksydan.is_imageslider.hook.abstract_display_hook'
public: true
arguments:
- '@oksydan.is_imageslider.repository.image_slider'
- '@oksydan.is_imageslider.presenter.image_slide_presenter'
- '@oksydan.is_imageslider.cache.template_cache'
oksydan.is_imageslider.hook.display_home:
class: Oksydan\IsImageslider\Hook\DisplayHome
parent: 'oksydan.is_imageslider.hook.abstract_cacheable_display_hook'
public: true
oksydan.is_imageslider.hook.display_header:
class: Oksydan\IsImageslider\Hook\DisplayHeader
parent: 'oksydan.is_imageslider.hook.abstract_cacheable_display_hook'
public: true
# Modification of the module into a widget
oksydan.is_imageslider.hook.widget_capability:
class: Oksydan\IsImageslider\Hook\WidgetCapability
parent: 'oksydan.is_imageslider.hook.abstract_cacheable_display_hook'
public: true
oksydan.is_imageslider.cache.template_cache:
class: Oksydan\IsImageslider\Cache\TemplateCache
public: true
arguments:
- '@oksydan.is_imageslider.module'
- "@=service('prestashop.adapter.legacy.context').getContext()"
- '@oksydan.is_imageslider.repository.hook_module_repository'
- '@prestashop.adapter.legacy.configuration'
- '@oksydan.is_imageslider.repository.image_slider'

View File

@ -0,0 +1,47 @@
database:
image_slider:
columns:
id_slide: INT AUTO_INCREMENT NOT NULL
active: TINYINT(1) NOT NULL
position: INT NOT NULL
display_from: datetime DEFAULT NULL
display_to: datetime DEFAULT NULL
primary:
- id_slide
engine: InnoDb
image_slider_lang:
columns:
id_slide: INT NOT NULL
id_lang: INT NOT NULL
title: VARCHAR(255) NOT NULL
legend: VARCHAR(255) NOT NULL
image: VARCHAR(255) NOT NULL
image_mobile: VARCHAR(255) NOT NULL
url: VARCHAR(255) NOT NULL
description: LONGTEXT NOT NULL
primary:
- id_slide
- id_lang
engine: InnoDb
image_slider_shop:
columns:
id_slide: INT NOT NULL
id_shop: INT NOT NULL
primary:
- id_slide
- id_shop
engine: InnoDb
database_add:
image_slider:
columns:
display_from: datetime DEFAULT NULL
display_to: datetime DEFAULT NULL
database_modify:
image_slider:
columns:
display_from: datetime DEFAULT NULL
display_to: datetime DEFAULT NULL

View File

@ -0,0 +1,11 @@
<?php
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@ -0,0 +1,2 @@
imports:
- { resource: ../common.yml }

View File

@ -0,0 +1,11 @@
<?php
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@ -0,0 +1,42 @@
is_imageslider_controller:
path: /is_imageslider/configuration
methods: [GET]
defaults:
_controller: 'Oksydan\IsImageslider\Controller\IsImagesliderController::index'
is_imageslider_controller_configuration_save:
path: /is_imageslider/configuration
methods: [POST, PATCH]
defaults:
_controller: 'Oksydan\IsImageslider\Controller\IsImagesliderController::saveConfiguration'
is_imageslider_controller_create:
path: /is_imageslider/imageslide/create
methods: [GET, POST]
defaults:
_controller: 'Oksydan\IsImageslider\Controller\IsImagesliderController::create'
is_imageslider_controller_edit:
path: /is_imageslider/imageslide/{slideId}/edit
methods: [GET, POST]
defaults:
_controller: 'Oksydan\IsImageslider\Controller\IsImagesliderController::edit'
is_imageslider_controller_delete:
path: /is_imageslider/imageslide/{slideId}/delete
methods: [GET, POST]
defaults:
_controller: 'Oksydan\IsImageslider\Controller\IsImagesliderController::delete'
is_imageslider_controller_toggle_status:
path: /is_imageslider/imageslide/{slideId}/toggle
methods: [POST]
defaults:
_controller: 'Oksydan\IsImageslider\Controller\IsImagesliderController::toggleStatus'
is_imageslider_controller_update_positions:
path: /is_imageslider/imageslide/update_positions
methods: [POST]
defaults:
_controller: 'Oksydan\IsImageslider\Controller\IsImagesliderController::updatePositionAction'