CCrmLiveFeedComponent::ParseText

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmLiveFeedComponent
  4. ParseText
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/livefeed.php
  • Класс: \CCrmLiveFeedComponent
  • Вызов: CCrmLiveFeedComponent::ParseText
static function ParseText($text, $arUF, $arParams)
{
	static $parser = false;

	if (
		isset($arParams["NOTIFY"])
		&& $arParams["NOTIFY"] === "Y"
	)
	{
		$text = str_replace("\n", "", CTextParser::clearAllTags($text));
	}

	if (CModule::IncludeModule("forum"))
	{
		if (!$parser)
		{
			$parser = new forumTextParser(LANGUAGE_ID);
		}

		$parser->pathToUser = $arParams["PATH_TO_USER"] ?? '';
		$parser->arUserfields = $arUF;
		$textFormatted = $parser->convert(
			$text,
			array(
				"HTML" => "N",
				"ALIGN" => "Y",
				"ANCHOR" => "Y", "BIU" => "Y",
				"IMG" => "Y", "QUOTE" => "Y",
				"CODE" => "Y", "FONT" => "Y",
				"LIST" => "Y", "SMILES" => "Y",
				"NL2BR" => "Y", "MULTIPLE_BR" => "N",
				"VIDEO" => "Y", "LOG_VIDEO" => "N",
				"SHORT_ANCHOR" => "Y",
				"USERFIELDS" => $arUF,
				"USER" => (
					isset($arParams["NOTIFY"])
					&& $arParams["NOTIFY"] === "Y"
						? "N"
						: "Y"
				)
			),
			"html"
		);
	}
	else
	{
		$parser = new logTextParser(false, $arParams["PATH_TO_SMILE"] ?? '');
		$textFormatted = $parser->convert(
			$text,
			array(),
			array(
				"HTML" => "N",
				"ALIGN" => "Y",
				"ANCHOR" => "Y", "BIU" => "Y",
				"IMG" => "Y", "QUOTE" => "Y",
				"CODE" => "Y", "FONT" => "Y",
				"LIST" => "Y", "SMILES" => "Y",
				"NL2BR" => "Y", "MULTIPLE_BR" => "N",
				"VIDEO" => "Y", "LOG_VIDEO" => "N",
				"SHORT_ANCHOR" => "Y",
				"USERFIELDS" => $arUF
			)
		);
	}

	if (
		isset($arParams["MAX_LENGTH"])
		&& intval($arParams["MAX_LENGTH"]) > 0
	)
	{
		$textFormatted = $parser->html_cut($textFormatted, $arParams["MAX_LENGTH"]);
	}

	return $textFormatted;
}

Добавить комментарий