Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/main/lib/ui/selector/ |
Upload File : |
<? namespace Bitrix\Main\UI\Selector; use Bitrix\Main\Event; use Bitrix\Main\EventResult; class Actions { const GET_DATA = "getData"; const GET_DEPARTMENT_DATA = "getDepartmentData"; const GET_TREE_ITEM_DATA = "getTreeItemRelation"; const SEARCH = "search"; public static function getList() { $reflection = new \ReflectionClass(__CLASS__); return $reflection->getConstants(); } public static function processAjax($action = false, $options = array(), $requestFields = array()) { $result = array(); if (isset($requestFields['LD_SEARCH']) && $requestFields['LD_SEARCH'] == 'Y') { $action = self::SEARCH; } elseif (isset($requestFields['LD_DEPARTMENT_RELATION']) && $requestFields['LD_DEPARTMENT_RELATION'] == 'Y') { $action = self::GET_DEPARTMENT_DATA; } if (!in_array($action, self::getList())) { return $result; } $event = new Event("main", "OnUISelectorActionProcessAjax", array( 'action' => $action, 'options' => $options, 'requestFields' => $requestFields )); $event->send(); $eventResultList = $event->getResults(); if (is_array($eventResultList) && !empty($eventResultList)) { foreach ($eventResultList as $eventResult) { if ($eventResult->getType() == EventResult::SUCCESS) { $resultParams = $eventResult->getParameters(); $result = $resultParams['result']; break; } } } return $result; } }