-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved the module compatibility with 1.7.5 release
- Loading branch information
Mickaël Andrieu
committed
Apr 30, 2019
1 parent
f2aa659
commit 8460421
Showing
11 changed files
with
135 additions
and
200 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
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,12 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<module> | ||
<name>training</name> | ||
<displayName><![CDATA[PrestaShop Training module]]></displayName> | ||
<version><![CDATA[1.0.1]]></version> | ||
<description><![CDATA[Demonstrate all the features of the PrestaShop Back Office, in its version 1.7.5]]></description> | ||
<author><![CDATA[PrestaShop]]></author> | ||
<tab><![CDATA[]]></tab> | ||
<is_configurable>0</is_configurable> | ||
<need_instance>0</need_instance> | ||
<limited_countries></limited_countries> | ||
</module> |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
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,56 @@ | ||
<?php | ||
|
||
namespace PrestaShop\Training\Grid; | ||
|
||
use PrestaShop\PrestaShop\Core\Grid\Column\Type\DataColumn; | ||
use PrestaShop\PrestaShop\Core\Grid\Definition\GridDefinitionInterface; | ||
use PrestaShop\PrestaShop\Core\Grid\Filter\Filter; | ||
use Symfony\Component\Form\Extension\Core\Type\TextType; | ||
|
||
/** | ||
* Stores all the customizations done in the Logs Grid of the Back Office. | ||
*/ | ||
final class Logs | ||
{ | ||
/** | ||
* This moves the column "Object Type" after the "Error Code" one. | ||
* No need to touch any template for that! | ||
* | ||
* @param GridDefinitionInterface $definition | ||
*/ | ||
public static function moveObjectTypeAfterErrorColumn(GridDefinitionInterface $definition) | ||
{ | ||
$definition->getColumns() | ||
->remove('object_type') | ||
->addAfter( | ||
'error_code', | ||
(new DataColumn('object_type')) | ||
->setName('Object Type') | ||
->setOptions([ | ||
'field' => 'object_type', | ||
]) | ||
) | ||
; | ||
} | ||
|
||
/** | ||
* You can update the Filter Form of any grid. | ||
* See @doc https://symfony.com/doc/3.4/components/form.html for all available options. | ||
* | ||
* @param GridDefinitionInterface $definition | ||
*/ | ||
public static function updateObjectTypeFilterForm(GridDefinitionInterface $definition) | ||
{ | ||
$definition->getFilters() | ||
->remove('message') | ||
->add((new Filter('message', TextType::class)) | ||
->setAssociatedColumn('message') | ||
->setTypeOptions([ | ||
'attr' => [ | ||
'placeholder' => 'This field accepts regular expressions.', | ||
], | ||
]) | ||
) | ||
; | ||
} | ||
} |
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
Oops, something went wrong.