Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
activateelementitem.php
1
<?php
2
3
namespace
Bitrix\Iblock\Grid\Row\Actions\Item
;
4
5
use Bitrix\Iblock\Grid\Row\Actions\Item\Helpers\ChangeActiveHandler;
6
use
Bitrix\Main\Localization\Loc
;
7
use CUtil;
8
9
final
class
ActivateElementItem
extends
BaseItem
10
{
11
use ChangeActiveHandler;
12
13
protected
function
getSetActiveValue
(): string
14
{
15
return
'Y'
;
16
}
17
18
public
static
function
getId
(): ?string
19
{
20
return
'activate_element'
;
21
}
22
23
protected
function
getText
(): string
24
{
25
return
Loc::getMessage
(
'IBLOCK_GRID_ROW_ACTIONS_ACTIVE_ELEMENT_NAME'
);
26
}
27
28
public
function
getControl
(array $rawFields): ?array
29
{
30
$id = (int)($rawFields[
'ID'
] ?? 0);
31
if
($id <= 0)
32
{
33
return
null
;
34
}
35
36
$actionId =
self::getId
();
37
$data = CUtil::PhpToJSObject([
38
'id'
=> $id,
39
]);
40
41
$this->onclick =
"IblockGridInstance.sendRowAction('{$actionId}', {$data})"
;
42
43
return
parent::getControl($rawFields);
44
}
45
}
Bitrix\Iblock\Grid\Row\Actions\Item\ActivateElementItem
Definition
activateelementitem.php:10
Bitrix\Iblock\Grid\Row\Actions\Item\ActivateElementItem\getControl
getControl(array $rawFields)
Definition
activateelementitem.php:28
Bitrix\Iblock\Grid\Row\Actions\Item\ActivateElementItem\getText
getText()
Definition
activateelementitem.php:23
Bitrix\Iblock\Grid\Row\Actions\Item\ActivateElementItem\getSetActiveValue
getSetActiveValue()
Definition
activateelementitem.php:13
Bitrix\Iblock\Grid\Row\Actions\Item\ActivateElementItem\getId
static getId()
Definition
activateelementitem.php:18
Bitrix\Iblock\Grid\Row\Actions\Item\BaseItem
Definition
baseitem.php:8
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Iblock\Grid\Row\Actions\Item
Definition
activateelementitem.php:3
modules
iblock
lib
grid
row
actions
item
activateelementitem.php
Создано системой
1.10.0