Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
copyelementitem.php
1<?php
2
4
5use Bitrix\Iblock\Grid\Row\Actions\Item\Helpers\WithUrl;
10
11final class CopyElementItem extends BaseAction
12{
13 use WithUrl;
14
15 public static function getId(): string
16 {
17 return 'copy_element';
18 }
19
20 public function processRequest(HttpRequest $request): ?Result
21 {
22 // only open url
23
24 return null;
25 }
26
27 protected function getText(): string
28 {
29 return Loc::getMessage('IBLOCK_GRID_ROW_ACTIONS_COPY_ELEMENT_NAME');
30 }
31
32 public function getControl(array $rawFields): ?array
33 {
34 if (empty($this->url))
35 {
36 return null;
37 }
38
39 $this->onclick = "top.BX.SidePanel.Instance.open('" . $this->getUrlForOnclick() . "')";
40
41 return parent::getControl($rawFields);
42 }
43}
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29