forked from magento/magento2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUser.php
53 lines (50 loc) · 1.4 KB
/
User.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
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\User\Block;
/**
* User block
*
* @api
* @since 100.0.2
*/
class User extends \Magento\Backend\Block\Widget\Grid\Container
{
/**
* @var \Magento\User\Model\ResourceModel\User
*/
protected $_resourceModel;
/**
* @param \Magento\Backend\Block\Widget\Context $context
* @param \Magento\User\Model\ResourceModel\User $resourceModel
* @param array $data
*/
public function __construct(
\Magento\Backend\Block\Widget\Context $context,
\Magento\User\Model\ResourceModel\User $resourceModel,
array $data = []
) {
parent::__construct($context, $data);
$this->_resourceModel = $resourceModel;
}
/**
* Class constructor
*
* @return void
*/
protected function _construct()
{
$this->addData(
[
\Magento\Backend\Block\Widget\Container::PARAM_CONTROLLER => 'user',
\Magento\Backend\Block\Widget\Grid\Container::PARAM_BLOCK_GROUP => 'Magento_User',
\Magento\Backend\Block\Widget\Grid\Container::PARAM_BUTTON_NEW => __('Add New User'),
\Magento\Backend\Block\Widget\Container::PARAM_HEADER_TEXT => __('Users'),
]
);
parent::_construct();
$this->_addNewButton();
}
}