-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from PrestaShop/dev
Refactor ps_linklist module using 1.7 improvements
- Loading branch information
Showing
83 changed files
with
8,894 additions
and
1,525 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
/config_*.xml | ||
/translations/*.php | ||
node_modules | ||
vendor | ||
!vendor/index.php | ||
!vendor/.htaccess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
/** | ||
* 2007-2018 PrestaShop. | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Academic Free License (AFL 3.0) | ||
* that is bundled with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://opensource.org/licenses/afl-3.0.php | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to [email protected] so we can send you a copy immediately. | ||
* | ||
* DISCLAIMER | ||
* | ||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer | ||
* versions in the future. If you wish to customize PrestaShop for your | ||
* needs please refer to http://www.prestashop.com for more information. | ||
* | ||
* @author PrestaShop SA <[email protected]> | ||
* @copyright 2007-2018 PrestaShop SA | ||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | ||
* International Registered Trademark & Property of PrestaShop SA | ||
*/ | ||
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
admin_link_block_list: | ||
path: /link-widget/list | ||
methods: [GET] | ||
defaults: | ||
_controller: 'PrestaShop\Module\LinkList\Controller\Admin\Improve\Design\LinkBlockController::listAction' | ||
_legacy_controller: AdminLinkWidget | ||
_legacy_link: AdminLinkWidget | ||
|
||
admin_link_block_create: | ||
path: /link-widget/create | ||
methods: [GET] | ||
defaults: | ||
_controller: 'PrestaShop\Module\LinkList\Controller\Admin\Improve\Design\LinkBlockController::createAction' | ||
_legacy_controller: AdminLinkWidget | ||
|
||
admin_link_block_create_process: | ||
path: /link-widget/create | ||
methods: [POST] | ||
defaults: | ||
_controller: 'PrestaShop\Module\LinkList\Controller\Admin\Improve\Design\LinkBlockController::createProcessAction' | ||
_legacy_controller: AdminLinkWidget | ||
|
||
admin_link_block_edit: | ||
path: /link-widget/edit/{linkBlockId} | ||
methods: [GET] | ||
defaults: | ||
_controller: 'PrestaShop\Module\LinkList\Controller\Admin\Improve\Design\LinkBlockController::editAction' | ||
_legacy_controller: AdminLinkWidget | ||
|
||
admin_link_block_edit_process: | ||
path: /link-widget/edit/{linkBlockId} | ||
methods: [POST] | ||
defaults: | ||
_controller: 'PrestaShop\Module\LinkList\Controller\Admin\Improve\Design\LinkBlockController::editProcessAction' | ||
_legacy_controller: AdminLinkWidget | ||
|
||
admin_link_block_delete: | ||
path: /link-widget/delete/{linkBlockId} | ||
methods: [POST] | ||
defaults: | ||
_controller: 'PrestaShop\Module\LinkList\Controller\Admin\Improve\Design\LinkBlockController::deleteAction' | ||
_legacy_controller: AdminLinkWidget | ||
requirements: | ||
linkBlockId: \d+ | ||
|
||
admin_link_block_update_positions: | ||
path: /link-widget/update-positions/{hookId} | ||
methods: [POST] | ||
defaults: | ||
_controller: 'PrestaShop\Module\LinkList\Controller\Admin\Improve\Design\LinkBlockController::updatePositionsAction' | ||
_legacy_controller: AdminLinkWidget | ||
requirements: | ||
hookId: \d+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
services: | ||
prestashop.module.link_block.cache: | ||
class: PrestaShop\Module\LinkList\Cache\LegacyLinkBlockCache | ||
arguments: | ||
$moduleRepository: '@prestashop.core.admin.module.repository' | ||
|
||
prestashop.module.link_block.repository: | ||
class: PrestaShop\Module\LinkList\Repository\LinkBlockRepository | ||
arguments: | ||
$connection: '@doctrine.dbal.default_connection' | ||
$dbPrefix: '%database_prefix%' | ||
$languages: '@=service("prestashop.adapter.legacy.context").getLanguages(true, service("prestashop.adapter.shop.context").getContextShopID())' | ||
$translator: '@translator' | ||
|
||
# Grid data query builder | ||
prestashop.module.link_block.grid.query_builder: | ||
class: PrestaShop\Module\LinkList\Core\Grid\Query\LinkBlockQueryBuilder | ||
arguments: | ||
$connection: '@doctrine.dbal.default_connection' | ||
$dbPrefix: '%database_prefix%' | ||
|
||
# Grid Data Factory | ||
prestashop.module.link_block.grid.data_factory: | ||
class: '%prestashop.core.grid.data.factory.doctrine_grid_data_factory%' | ||
arguments: | ||
$gridQueryBuilder: '@prestashop.module.link_block.grid.query_builder' | ||
$hookDispatcher: '@prestashop.core.hook.dispatcher' | ||
$queryParser: '@prestashop.core.grid.query.doctrine_query_parser' | ||
$gridId: 'link_block' | ||
|
||
# Link block grid Factory | ||
prestashop.module.link_block.grid.factory: | ||
class: PrestaShop\Module\LinkList\Core\Grid\LinkBlockGridFactory | ||
arguments: | ||
$translator: '@translator' | ||
$hookDispatcher: '@prestashop.core.hook.dispatcher' | ||
$dataFactory: '@prestashop.module.link_block.grid.data_factory' | ||
$filterFormFactory: '@prestashop.core.grid.filter.form_factory' | ||
|
||
# Grid position definition | ||
prestashop.module.link_block.grid.position_definition: | ||
class: 'PrestaShop\PrestaShop\Core\Grid\Position\PositionDefinition' | ||
arguments: | ||
$table: 'link_block' | ||
$idField: 'id_link_block' | ||
$positionField: 'position' | ||
$parentIdField: 'id_hook' | ||
|
||
# Link block form data provider | ||
prestashop.module.link_block.form_provider: | ||
class: PrestaShop\Module\LinkList\Form\LinkBlockFormDataProvider | ||
arguments: | ||
$repository: '@prestashop.module.link_block.repository' | ||
$cache: '@prestashop.module.link_block.cache' | ||
$moduleRepository: '@prestashop.core.admin.module.repository' | ||
$languages: '@=service("prestashop.adapter.legacy.context").getLanguages(true, service("prestashop.adapter.shop.context").getContextShopID())' | ||
$shopId: '@=service("prestashop.adapter.shop.context").getContextShopID()' | ||
|
||
# Form choices providers | ||
prestashop.module.link_block.choice_provider.hook: | ||
class: PrestaShop\Module\LinkList\Form\ChoiceProvider\HookChoiceProvider | ||
arguments: | ||
$connection: '@doctrine.dbal.default_connection' | ||
$dbPrefix: '%database_prefix%' | ||
|
||
prestashop.module.link_block.choice_provider.cms_category: | ||
class: PrestaShop\Module\LinkList\Form\ChoiceProvider\CMSCategoryChoiceProvider | ||
arguments: | ||
$connection: '@doctrine.dbal.default_connection' | ||
$dbPrefix: '%database_prefix%' | ||
$idLang: '@=service("prestashop.adapter.legacy.context").getLanguage().id' | ||
$shopIds: '@=service("prestashop.adapter.shop.context").getContextListShopID()' | ||
|
||
prestashop.module.link_block.choice_provider.cms_page: | ||
class: PrestaShop\Module\LinkList\Form\ChoiceProvider\CMSPageChoiceProvider | ||
arguments: | ||
$connection: '@doctrine.dbal.default_connection' | ||
$dbPrefix: '%database_prefix%' | ||
$categories: '@=service("prestashop.module.link_block.choice_provider.cms_category").getChoices()' | ||
$idLang: '@=service("prestashop.adapter.legacy.context").getLanguage().id' | ||
$shopIds: '@=service("prestashop.adapter.shop.context").getContextListShopID()' | ||
|
||
prestashop.module.link_block.choice_provider.product_page: | ||
class: PrestaShop\Module\LinkList\Form\ChoiceProvider\PageChoiceProvider | ||
arguments: | ||
$connection: '@doctrine.dbal.default_connection' | ||
$dbPrefix: '%database_prefix%' | ||
$idLang: '@=service("prestashop.adapter.legacy.context").getLanguage().id' | ||
$shopIds: '@=service("prestashop.adapter.shop.context").getContextListShopID()' | ||
$pageNames: | ||
- 'prices-drop' | ||
- 'new-products' | ||
- 'best-sales' | ||
|
||
prestashop.module.link_block.choice_provider.static_page: | ||
class: PrestaShop\Module\LinkList\Form\ChoiceProvider\PageChoiceProvider | ||
arguments: | ||
$connection: '@doctrine.dbal.default_connection' | ||
$dbPrefix: '%database_prefix%' | ||
$idLang: '@=service("prestashop.adapter.legacy.context").getLanguage().id' | ||
$shopIds: '@=service("prestashop.adapter.shop.context").getContextListShopID()' | ||
$pageNames: | ||
- 'contact' | ||
- 'sitemap' | ||
- 'stores' | ||
- 'authentication' | ||
- 'my-account' | ||
|
||
# Form types | ||
prestashop.module.link_block.form_type: | ||
class: PrestaShop\Module\LinkList\Form\Type\LinkBlockType | ||
parent: 'form.type.translatable.aware' | ||
public: true | ||
arguments: | ||
$hookChoices: '@=service("prestashop.module.link_block.choice_provider.hook").getChoices()' | ||
$cmsPageChoices: '@=service("prestashop.module.link_block.choice_provider.cms_page").getChoices()' | ||
$productPageChoices: '@=service("prestashop.module.link_block.choice_provider.product_page").getChoices()' | ||
$staticPageChoices: '@=service("prestashop.module.link_block.choice_provider.static_page").getChoices()' | ||
tags: | ||
- { name: form.type } | ||
|
||
prestashop.module.link_block.custom_url_type: | ||
class: PrestaShop\Module\LinkList\Form\Type\CustomUrlType | ||
parent: 'form.type.translatable.aware' | ||
tags: | ||
- { name: form.type } | ||
|
||
# Link block form handler | ||
prestashop.module.link_block.form_handler: | ||
class: 'PrestaShop\PrestaShop\Core\Form\FormHandler' | ||
arguments: | ||
$formBuilder: '@=service("form.factory").createBuilder()' | ||
$hookDispatcher: '@prestashop.core.hook.dispatcher' | ||
$formDataProvider: '@prestashop.module.link_block.form_provider' | ||
$formTypes: | ||
'link_block': 'PrestaShop\Module\LinkList\Form\Type\LinkBlockType' | ||
$hookName: 'AdminLinkWidget' |
Oops, something went wrong.