1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Created by PhpStorm. |
4
|
|
|
* User: willi |
5
|
|
|
* Date: 10.03.18 |
6
|
|
|
* Time: 17:54 |
7
|
|
|
*/ |
8
|
|
|
|
9
|
|
|
namespace Firegento\DevDashboard\Block; |
10
|
|
|
|
11
|
|
|
|
12
|
|
|
class UserEditTab extends \Magento\Backend\Block\Widget\Form\Generic |
|
|
|
|
13
|
|
|
{ |
14
|
|
|
/** @var \Firegento\DevDashboard\Model\ConfigRepository */ |
15
|
|
|
protected $_configRepository; |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* @param \Magento\Backend\Block\Template\Context $context |
19
|
|
|
* @param \Magento\Framework\Registry $registry |
20
|
|
|
* @param \Magento\Framework\Data\FormFactory $formFactory |
21
|
|
|
* @param \Firegento\DevDashboard\Model\ConfigRepository |
22
|
|
|
* @param array $data |
23
|
|
|
*/ |
24
|
|
|
public function __construct( |
25
|
|
|
\Magento\Backend\Block\Template\Context $context, |
|
|
|
|
26
|
|
|
\Magento\Framework\Registry $registry, |
27
|
|
|
\Magento\Framework\Data\FormFactory $formFactory, |
28
|
|
|
\Firegento\DevDashboard\Model\ConfigRepository $configRepository, |
29
|
|
|
array $data = [] |
30
|
|
|
) { |
31
|
|
|
$this->_configRepository = $configRepository; |
32
|
|
|
|
33
|
|
|
parent::__construct($context, $registry, $formFactory, $data); |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
protected function _prepareForm() |
37
|
|
|
{ |
38
|
|
|
/** @var $model \Magento\User\Model\User */ |
39
|
|
|
$model = $this->_coreRegistry->registry('permissions_user'); |
40
|
|
|
|
41
|
|
|
/** @var \Magento\Framework\Data\Form $form */ |
42
|
|
|
$form = $this->_formFactory->create(); |
43
|
|
|
$form->setHtmlIdPrefix('devdashboard_'); |
44
|
|
|
|
45
|
|
|
$baseFieldset = $form->addFieldset('base_fieldset', ['legend' => __('Dashboard Configuration')]); |
|
|
|
|
46
|
|
|
|
47
|
|
|
|
48
|
|
|
$config = $this->_configRepository->getByUserId($model->getId() ? $model->getId() : null); |
49
|
|
|
|
50
|
|
|
$baseFieldset->addField( |
51
|
|
|
'configuration', |
52
|
|
|
'textarea', |
53
|
|
|
[ |
54
|
|
|
'name' => 'configuration', |
55
|
|
|
'label' => __('Configuration'), |
56
|
|
|
'id' => 'configuration', |
57
|
|
|
'title' => __('Configuration'), |
58
|
|
|
'required' => false |
59
|
|
|
] |
60
|
|
|
); |
61
|
|
|
|
62
|
|
|
$baseFieldset->addField( |
63
|
|
|
'use_devdashboard', |
64
|
|
|
'select', |
65
|
|
|
[ |
66
|
|
|
'name' => 'use_devdashboard', |
67
|
|
|
'label' => __('Use developer dashboard as default'), |
68
|
|
|
'id' => 'use_devdashboard', |
69
|
|
|
'title' => __('Use developer dashboard'), |
70
|
|
|
'class' => 'input-select', |
71
|
|
|
'options' => ['1' => __('Yes'), '0' => __('No')] |
72
|
|
|
] |
73
|
|
|
); |
74
|
|
|
|
75
|
|
|
$data = $config->getData(); |
76
|
|
|
$form->setValues($data); |
77
|
|
|
|
78
|
|
|
$this->setForm($form); |
79
|
|
|
|
80
|
|
|
return parent::_prepareForm(); |
81
|
|
|
} |
82
|
|
|
|
83
|
|
|
} |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths