Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
deactivateelementitem.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
DeactivateElementItem
extends
BaseItem
10
{
11
use ChangeActiveHandler;
12
13
protected
function
getSetActiveValue
(): string
14
{
15
return
'N'
;
16
}
17
18
public
static
function
getId
(): ?string
19
{
20
return
'deactivate_element'
;
21
}
22
23
protected
function
getText
(): string
24
{
25
return
Loc::getMessage
(
'IBLOCK_GRID_ROW_ACTIONS_DEACTIVATE_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\BaseItem
Definition
baseitem.php:8
Bitrix\Iblock\Grid\Row\Actions\Item\DeactivateElementItem
Definition
deactivateelementitem.php:10
Bitrix\Iblock\Grid\Row\Actions\Item\DeactivateElementItem\getControl
getControl(array $rawFields)
Definition
deactivateelementitem.php:28
Bitrix\Iblock\Grid\Row\Actions\Item\DeactivateElementItem\getText
getText()
Definition
deactivateelementitem.php:23
Bitrix\Iblock\Grid\Row\Actions\Item\DeactivateElementItem\getSetActiveValue
getSetActiveValue()
Definition
deactivateelementitem.php:13
Bitrix\Iblock\Grid\Row\Actions\Item\DeactivateElementItem\getId
static getId()
Definition
deactivateelementitem.php:18
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
deactivateelementitem.php
Создано системой
1.10.0