• Модуль: imconnector
  • Путь к файлу: ~/bitrix/modules/imconnector/lib/connectors/base.php
  • Класс: BitrixImConnectorConnectorsBase
  • Вызов: Base::formationQuotedText
protected function formationQuotedText($attachment)
{
	$returnText = '';

	if (!Library::isEmpty($attachment['user']))
	{
		if (
			!Library::isEmpty($attachment['user']['last_name'])
			|| !Library::isEmpty($attachment['user']['name'])
		)
		{
			//TODO: it does not work correctly, if the URL for the user
			/*if (!empty($attachment['user']['url']))
			{
				$returnText .= "[URL=" . $attachment['user']['url'] . "]";
			}*/

			if (!Library::isEmpty($attachment['user']['last_name']))
			{
				$returnText .= $attachment['user']['last_name'];
			}
			if (
				!Library::isEmpty($attachment['user']['last_name'])
				&& !empty($attachment['user']['name'])
			)
			{
				$returnText .= ' ';
			}

			if (!Library::isEmpty($attachment['user']['name']))
			{
				$returnText .= $attachment['user']['name'];
			}

			/*if (!empty($attachment['user']['url']))
			{
				$returnText .= "[/URL]  ";
			}*/
		}

		if (!Library::isEmpty($attachment['date']))
		{
			$returnText .= "[" . DateTime::createFromTimestamp((int)$attachment['date'])->toString() . "]";
		}
	}

	return $returnText;
}