• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/V2/Chat/NotifyChat.php
  • Класс: BitrixImV2ChatNotifyChat
  • Вызов: NotifyChat::prepareConfirm
protected function prepareConfirm(Message $message): void
{
	if ($message->getNotifyType() == IM_NOTIFY_CONFIRM)
	{
		if (!empty($message->getNotifyButtons()))
		{
			$buttons = $message->getNotifyButtons();
			foreach ($buttons as $index => $button)
			{
				if (
					is_array($button)
					&& !empty($button['TITLE'])
					&& !empty($button['VALUE'])
					&& !empty($button['TYPE'])
				)
				{
					$button['TITLE'] = htmlspecialcharsbx($button['TITLE']);
					$button['VALUE'] = htmlspecialcharsbx($button['VALUE']);
					$button['TYPE'] = htmlspecialcharsbx($button['TYPE']);
					$buttons[$index] = $button;
				}
				else
				{
					unset($buttons[$index]);
				}
			}
		}
		else
		{
			$buttons = [
				[
					'TITLE' => Loc::getMessage('IM_NOTIFY_CONFIRM_BUTTON_ACCEPT'),
					'VALUE' => 'Y',
					'TYPE' => 'accept'
				],
				[
					'TITLE' => Loc::getMessage('IM_NOTIFY_CONFIRM_BUTTON_CANCEL'),
					'VALUE' => 'N',
					'TYPE' => 'cancel'
				],
			];
		}

		$message->setNotifyButtons($buttons);
	}
}