Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
actions.php
1<?
2
4
7
8class 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 {
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}
static processAjax($action=false, $options=array(), $requestFields=array())
Definition actions.php:21