Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
elementpanelprovider.php
1
<?php
2
3
namespace
Bitrix\Iblock\Grid\Panel\UI
;
4
5
use
Bitrix\Iblock\Grid\Access\IblockRightsChecker
;
6
use
Bitrix\Iblock\Grid\Entity\ElementSettings
;
7
use
Bitrix\Iblock\Grid\Panel\UI\Actions\Item\EditActionsItem
;
8
use
Bitrix\Iblock\Grid\Panel\UI\Actions\Item\ElementGroupActionsItem
;
9
use
Bitrix\Iblock\Grid\Panel\UI\Actions\Item\RemoveActionsItem
;
10
use
Bitrix\Main\Grid\Column\Columns
;
11
use
Bitrix\Main\Grid\Panel\Action\ForAllCheckboxAction
;
12
use
Bitrix\Main\Grid\Panel\Action\DataProvider
;
13
21
class
ElementPanelProvider
extends
DataProvider
22
{
23
private
Columns
$columns;
24
private
IblockRightsChecker
$rights;
25
26
public
function
__construct
(
27
ElementSettings
$settings,
28
Columns
$columns,
29
IblockRightsChecker
$rights
30
)
31
{
32
parent::__construct($settings);
33
34
$this->columns = $columns;
35
$this->rights = $rights;
36
}
37
38
final
protected
function
getIblockId
(): int
39
{
40
return
$this->
getSettings
()->getIblockId();
41
}
42
43
final
protected
function
getListMode
(): string
44
{
45
return
$this->
getSettings
()->getListMode();
46
}
47
48
final
protected
function
getIblockRightsChecker
():
IblockRightsChecker
49
{
50
return
$this->rights;
51
}
52
53
final
protected
function
getColumns
():
Columns
54
{
55
return
$this->columns;
56
}
57
58
public
function
prepareActions
(): array
59
{
60
$result = [];
61
62
if
($this->rights->canEditElements())
63
{
64
$result[] =
new
EditActionsItem
($this->
getIblockId
(), $this->columns, $this->rights);
65
}
66
67
if
($this->rights->canDeleteElements())
68
{
69
$result[] =
new
RemoveActionsItem
($this->
getIblockId
(), $this->rights, $this->
getListMode
());
70
}
71
72
$result[] =
new
ElementGroupActionsItem
($this->
getIblockId
(), $this->rights, $this->
getListMode
());
73
74
if
(!empty($result))
75
{
76
$result[] =
new
ForAllCheckboxAction
();
77
}
78
79
return
$result;
80
}
81
}
Bitrix\Iblock\Grid\Access\IblockRightsChecker
Definition
iblockrightschecker.php:10
Bitrix\Iblock\Grid\Entity\ElementSettings
Definition
elementsettings.php:9
Bitrix\Iblock\Grid\Panel\UI\Actions\Item\EditActionsItem
Definition
editactionsitem.php:20
Bitrix\Iblock\Grid\Panel\UI\Actions\Item\ElementGroupActionsItem
Definition
elementgroupactionsitem.php:19
Bitrix\Iblock\Grid\Panel\UI\Actions\Item\RemoveActionsItem
Definition
removeactionsitem.php:19
Bitrix\Iblock\Grid\Panel\UI\ElementPanelProvider
Definition
elementpanelprovider.php:22
Bitrix\Iblock\Grid\Panel\UI\ElementPanelProvider\getIblockId
getIblockId()
Definition
elementpanelprovider.php:38
Bitrix\Iblock\Grid\Panel\UI\ElementPanelProvider\getColumns
getColumns()
Definition
elementpanelprovider.php:53
Bitrix\Iblock\Grid\Panel\UI\ElementPanelProvider\prepareActions
prepareActions()
Definition
elementpanelprovider.php:58
Bitrix\Iblock\Grid\Panel\UI\ElementPanelProvider\__construct
__construct(ElementSettings $settings, Columns $columns, IblockRightsChecker $rights)
Definition
elementpanelprovider.php:26
Bitrix\Iblock\Grid\Panel\UI\ElementPanelProvider\getListMode
getListMode()
Definition
elementpanelprovider.php:43
Bitrix\Iblock\Grid\Panel\UI\ElementPanelProvider\getIblockRightsChecker
getIblockRightsChecker()
Definition
elementpanelprovider.php:48
Bitrix\Main\Grid\Column\Columns
Definition
columns.php:14
Bitrix\Main\Grid\Panel\Action\DataProvider
Definition
dataprovider.php:10
Bitrix\Main\Grid\Panel\Action\DataProvider\getSettings
getSettings()
Definition
dataprovider.php:35
Bitrix\Main\Grid\Panel\Action\ForAllCheckboxAction
Definition
forallcheckboxaction.php:11
Bitrix\Iblock\Grid\Panel\UI
modules
iblock
lib
grid
panel
ui
elementpanelprovider.php
Создано системой
1.10.0