Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
feedback.php
1<?
2
4
8
10{
11 protected function getDefaultPreFilters()
12 {
13 return [
14 new ActionFilter\Authentication(),
15 new ActionFilter\HttpMethod([ActionFilter\HttpMethod::METHOD_POST]),
16 new ActionFilter\Csrf(),
17 new ActionFilter\CloseSession()
18 ];
19 }
20
21 public function loadDataAction(JsonPayload $payload)
22 {
23 $request = $payload->getData();
24 $request = is_array($request) ? $request : [];
25
26
27 $feedbackForm = new \Bitrix\UI\Form\FeedbackForm($request['id']);
28
29 $feedbackForm->setFormParams($request['forms']??[]);
30
31 $feedbackForm->setPresets(is_array($request['presets']) ? $request['presets'] : []);
32 if (isset($request['title']))
33 {
34 $feedbackForm->setTitle($request['title']);
35 }
36
37 if (isset($request['portalUri']))
38 {
39 $feedbackForm->setPortalUri($request['portalUri']);
40 }
41
42 if (!$feedbackForm->getFormParams() && !isset($request['defaultForm']))
43 {
44 return [];
45 }
46
47 if (!$feedbackForm->getFormParams() && isset($request['defaultForm']))
48 {
49 $feedbackForm->setFormParamsDirectly($request['defaultForm']);
50 }
51
52 return [
53 'form' => $feedbackForm->getFormParams(),
54 'presets' => $feedbackForm->getPresets(),
55 'title' => $feedbackForm->getTitle(),
56 'portalUri' => $feedbackForm->getPortalUri(),
57 'params' => $feedbackForm->getJsObjectParams(),
58 ];
59 }
60}
loadDataAction(JsonPayload $payload)
Definition feedback.php:21