Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
onchange.php
1<?
2
4
6
7Loc::loadMessages(__FILE__);
8
9
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}
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29