Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
onchange.php
1
<?
2
3
namespace
Bitrix\Main\Grid\Panel\Snippet
;
4
5
use
Bitrix\Main\Localization\Loc
;
6
7
Loc::loadMessages
(__FILE__);
8
9
14
class
Onchange
15
{
16
protected
$actions
;
17
22
public
function
__construct
(
$actions
= array())
23
{
24
if
(!empty(
$actions
) && is_array(
$actions
))
25
{
26
foreach
(
$actions
as $key => $action)
27
{
28
if
(isset($action[
"CONFIRM"
]) && $action[
"CONFIRM"
] ===
true
)
29
{
30
if
(empty($action[
"CONFIRM_MESSAGE"
]))
31
{
32
$actions
[$key][
"CONFIRM_MESSAGE"
] =
Loc::getMessage
(
"DEFAULT_CONFIRM_MESSAGE"
);
33
}
34
35
if
(empty($action[
"CONFIRM_APPLY_BUTTON"
]))
36
{
37
$actions
[$key][
"CONFIRM_APPLY_BUTTON"
] =
Loc::getMessage
(
"CONFIRM_APPLY_BUTTON"
);
38
}
39
40
if
(empty($action[
"CONFIRM_CANCEL_BUTTON"
]))
41
{
42
$actions
[$key][
"CONFIRM_CANCEL_BUTTON"
] =
Loc::getMessage
(
"CONFIRM_CANCEL_BUTTON"
);
43
}
44
}
45
}
46
47
$this->actions =
$actions
;
48
}
49
}
50
51
56
public
function
addAction
($action = array())
57
{
58
if
(isset($action[
"CONFIRM"
]) && $action[
"CONFIRM"
] ===
true
)
59
{
60
if
(!isset($action[
"CONFIRM_MESSAGE"
]) || empty($action[
"CONFIRM_MESSAGE"
]))
61
{
62
$action[
"CONFIRM_MESSAGE"
] =
Loc::getMessage
(
"DEFAULT_CONFIRM_MESSAGE"
);
63
}
64
65
if
(!isset($action[
"CONFIRM_APPLY_BUTTON"
]) || empty($action[
"CONFIRM_APPLY_BUTTON"
]))
66
{
67
$action[
"CONFIRM_APPLY_BUTTON"
] =
Loc::getMessage
(
"CONFIRM_APPLY_BUTTON"
);
68
}
69
70
if
(!isset($action[
"CONFIRM_CANCEL_BUTTON"
]) || empty($action[
"CONFIRM_CANCEL_BUTTON"
]))
71
{
72
$action[
"CONFIRM_CANCEL_BUTTON"
] =
Loc::getMessage
(
"CONFIRM_CANCEL_BUTTON"
);
73
}
74
}
75
76
$this->actions[] = $action;
77
}
78
79
83
public
function
toArray
()
84
{
85
return
$this->actions
;
86
}
87
}
Bitrix\Main\Grid\Panel\Snippet\Onchange
Definition
onchange.php:15
Bitrix\Main\Grid\Panel\Snippet\Onchange\addAction
addAction($action=array())
Definition
onchange.php:56
Bitrix\Main\Grid\Panel\Snippet\Onchange\toArray
toArray()
Definition
onchange.php:83
Bitrix\Main\Grid\Panel\Snippet\Onchange\$actions
$actions
Definition
onchange.php:16
Bitrix\Main\Grid\Panel\Snippet\Onchange\__construct
__construct($actions=array())
Definition
onchange.php:22
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Main\Grid\Panel\Snippet
Definition
button.php:3
modules
main
lib
grid
panel
snippet
onchange.php
Создано системой
1.10.0