-
Notifications
You must be signed in to change notification settings - Fork 0
/
hooktest.php
58 lines (51 loc) · 1.87 KB
/
hooktest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
use Symfony\Component\Form\Extension\Core\Type\TextType;
/**
* 2007-2018 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 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:
* https://opensource.org/licenses/OSL-3.0
* 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 https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
class HookTest extends Module
{
public function __construct($name = null, Context $context = null)
{
$this->name = 'hooktest';
$this->version = '1.0.0';
$this->author = 'Rokas';
$this->description = 'This module is used to test hooks';
$this->displayName = 'Hook test';
parent::__construct($name, $context);
}
public function install()
{
return parent::install() &&
$this->registerHook('actionTranslationSettingsPageForm');
}
public function hookActionTranslationSettingsPageForm($params)
{
/** @var \Symfony\Component\Form\FormBuilderInterface $formBuilder */
$formBuilder = $params['form_builder'];
foreach ($formBuilder->all() as $subFormBuilder) {
$subFormBuilder->add('test_field', TextType::class);
}
}
}