Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
elementpanelprovider.php
1<?php
2
4
13
22{
23 private Columns $columns;
24 private IblockRightsChecker $rights;
25
26 public function __construct(
27 ElementSettings $settings,
28 Columns $columns,
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}
__construct(ElementSettings $settings, Columns $columns, IblockRightsChecker $rights)