Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
actions.php
1
<?
2
3
namespace
Bitrix\Main\UI\Selector
;
4
5
use
Bitrix\Main\Event
;
6
use
Bitrix\Main\EventResult
;
7
8
class
Actions
9
{
10
const
GET_DATA
=
"getData"
;
11
const
GET_DEPARTMENT_DATA
=
"getDepartmentData"
;
12
const
GET_TREE_ITEM_DATA
=
"getTreeItemRelation"
;
13
const
SEARCH
=
"search"
;
14
15
public
static
function
getList
()
16
{
17
$reflection = new \ReflectionClass(__CLASS__);
18
return
$reflection->getConstants();
19
}
20
21
public
static
function
processAjax
($action =
false
, $options = array(), $requestFields = array())
22
{
23
$result = array();
24
if
(isset($requestFields[
'LD_SEARCH'
]) && $requestFields[
'LD_SEARCH'
] ==
'Y'
)
25
{
26
$action =
self::SEARCH
;
27
}
28
elseif (isset($requestFields[
'LD_DEPARTMENT_RELATION'
]) && $requestFields[
'LD_DEPARTMENT_RELATION'
] ==
'Y'
)
29
{
30
$action =
self::GET_DEPARTMENT_DATA
;
31
}
32
33
if
(!in_array($action, self::getList()))
34
{
35
return
$result;
36
}
37
38
$event =
new
Event
(
"main"
,
"OnUISelectorActionProcessAjax"
, array(
39
'action'
=> $action,
40
'options'
=> $options,
41
'requestFields'
=> $requestFields
42
));
43
$event->send();
44
$eventResultList = $event->getResults();
45
46
if
(is_array($eventResultList) && !empty($eventResultList))
47
{
48
foreach
($eventResultList as $eventResult)
49
{
50
if
($eventResult->getType() == EventResult::SUCCESS)
51
{
52
$resultParams = $eventResult->getParameters();
53
$result = $resultParams[
'result'
];
54
break
;
55
}
56
}
57
}
58
59
return
$result;
60
}
61
}
Bitrix\Main\Event
Definition
event.php:5
Bitrix\Main\EventResult
Definition
eventresult.php:5
Bitrix\Main\UI\Selector\Actions
Definition
actions.php:9
Bitrix\Main\UI\Selector\Actions\processAjax
static processAjax($action=false, $options=array(), $requestFields=array())
Definition
actions.php:21
Bitrix\Main\UI\Selector\Actions\GET_TREE_ITEM_DATA
const GET_TREE_ITEM_DATA
Definition
actions.php:12
Bitrix\Main\UI\Selector\Actions\GET_DATA
const GET_DATA
Definition
actions.php:10
Bitrix\Main\UI\Selector\Actions\SEARCH
const SEARCH
Definition
actions.php:13
Bitrix\Main\UI\Selector\Actions\GET_DEPARTMENT_DATA
const GET_DEPARTMENT_DATA
Definition
actions.php:11
Bitrix\Main\UI\Selector\Actions\getList
static getList()
Definition
actions.php:15
Bitrix\Main\UI\Selector
Definition
actions.php:3
modules
main
lib
ui
selector
actions.php
Создано системой
1.10.0