1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
gridresponse.php
См. документацию.
1<?php
2
3namespace Bitrix\Main\Grid\UI;
4
5use Bitrix\Main\Application;
6use Bitrix\Main\Engine\Response\Json;
7use CMain;
8
13{
17 private array $messages = [];
18 private mixed $payload = null;
19
30 public function addMessage(string $message, string $type): void
31 {
32 $this->messages[] = [
33 'TYPE' => $type,
34 'TEXT' => $message,
35 ];
36 }
37
45 public function setPayload(mixed $payload): void
46 {
47 $this->payload = $payload;
48 }
49
55 public function isSendable(): bool
56 {
57 return !(
58 empty($this->messages) && empty($this->payload)
59 );
60 }
61
67 public function send(): void
68 {
69 global $APPLICATION;
70
74
75 $APPLICATION->RestartBuffer();
76
77 // TODO: fix JS code for correct work without messages
78 $responseData = [
79 'messages' => $this->messages,
80 ];
81 if (!empty($this->payload))
82 {
83 $responseData['payload'] = $this->payload;
84 }
85
86 $response = new Json($responseData);
87
89 }
90}
$type
Определения options.php:106
global $APPLICATION
Определения include.php:80
static getInstance()
Определения application.php:98
setPayload(mixed $payload)
Определения gridresponse.php:45
addMessage(string $message, string $type)
Определения gridresponse.php:30
Определения json.php:9
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$message
Определения payment.php:8
$messages
Определения template.php:8
$response
Определения result.php:21