1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
elementpanelprovider.php
См. документацию.
1<?php
2
3namespace Bitrix\Iblock\Grid\Panel\UI;
4
5use Bitrix\Iblock\Grid\Access\IblockRightsChecker;
6use Bitrix\Iblock\Grid\Entity\ElementSettings;
7use Bitrix\Iblock\Grid\Panel\UI\Actions\Item\EditActionsItem;
8use Bitrix\Iblock\Grid\Panel\UI\Actions\Item\ElementGroupActionsItem;
9use Bitrix\Iblock\Grid\Panel\UI\Actions\Item\RemoveActionsItem;
10use Bitrix\Main\Grid\Column\Columns;
11use Bitrix\Main\Grid\Panel\Action\ForAllCheckboxAction;
12use Bitrix\Main\Grid\Panel\Action\DataProvider;
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 {
77 }
78
79 return $result;
80 }
81}
__construct(ElementSettings $settings, Columns $columns, IblockRightsChecker $rights)
Определения elementpanelprovider.php:26
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14
$rights
Определения options.php:4