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 | class UserEditTab extends \Magento\Backend\Block\Widget\Form\Generic |
||||
0 ignored issues
–
show
Deprecated Code
introduced
by
Loading history...
|
|||||
12 | { |
||||
13 | /** @var \Firegento\DevDashboard\Model\ConfigRepository */ |
||||
14 | protected $_configRepository; |
||||
15 | |||||
16 | /** |
||||
17 | * @param \Magento\Backend\Block\Template\Context $context |
||||
18 | * @param \Magento\Framework\Registry $registry |
||||
19 | * @param \Magento\Framework\Data\FormFactory $formFactory |
||||
20 | * @param \Firegento\DevDashboard\Model\ConfigRepository |
||||
21 | * @param array $data |
||||
22 | */ |
||||
23 | public function __construct( |
||||
24 | \Magento\Backend\Block\Template\Context $context, |
||||
25 | \Magento\Framework\Registry $registry, |
||||
26 | \Magento\Framework\Data\FormFactory $formFactory, |
||||
27 | \Firegento\DevDashboard\Model\ConfigRepository $configRepository, |
||||
28 | array $data = [] |
||||
29 | ) { |
||||
30 | $this->_configRepository = $configRepository; |
||||
31 | |||||
32 | parent::__construct($context, $registry, $formFactory, $data); |
||||
33 | } |
||||
34 | |||||
35 | protected function _prepareForm() |
||||
36 | { |
||||
37 | /** @var $model \Magento\User\Model\User */ |
||||
38 | $model = $this->_coreRegistry->registry('permissions_user'); |
||||
0 ignored issues
–
show
The function
Magento\Framework\Registry::registry() has been deprecated: 102.0.0
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This function has been deprecated. The supplier of the function has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.
Loading history...
|
|||||
39 | |||||
40 | /** @var \Magento\Framework\Data\Form $form */ |
||||
41 | $form = $this->_formFactory->create(); |
||||
42 | $form->setHtmlIdPrefix('devdashboard_'); |
||||
43 | |||||
44 | $baseFieldset = $form->addFieldset('base_fieldset', ['legend' => __('Dashboard Configuration')]); |
||||
45 | |||||
46 | $config = $this->_configRepository->getByUserId($model->getId() ? $model->getId() : null); |
||||
47 | |||||
48 | $baseFieldset->addField( |
||||
49 | 'configuration', |
||||
50 | 'textarea', |
||||
51 | [ |
||||
52 | 'name' => 'configuration', |
||||
53 | 'label' => __('Configuration'), |
||||
54 | 'id' => 'configuration', |
||||
55 | 'title' => __('Configuration'), |
||||
56 | 'required' => false |
||||
57 | ] |
||||
58 | ); |
||||
59 | |||||
60 | $baseFieldset->addField( |
||||
61 | 'use_devdashboard', |
||||
62 | 'select', |
||||
63 | [ |
||||
64 | 'name' => 'use_devdashboard', |
||||
65 | 'label' => __('Use developer dashboard as default'), |
||||
66 | 'id' => 'use_devdashboard', |
||||
67 | 'title' => __('Use developer dashboard'), |
||||
68 | 'class' => 'input-select', |
||||
69 | 'options' => ['1' => __('Yes'), '0' => __('No')] |
||||
70 | ] |
||||
71 | ); |
||||
72 | |||||
73 | $data = $config->getData(); |
||||
74 | $form->setValues($data); |
||||
75 | |||||
76 | $this->setForm($form); |
||||
77 | |||||
78 | return parent::_prepareForm(); |
||||
79 | } |
||||
80 | } |
||||
81 |