• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/note/source/parser.php
  • Класс: BitrixLandingNoteSourceParser
  • Вызов: Parser::replaceFilesInContent
static function replaceFilesInContent(string $text, array $files = []): string
{
	$replace = [];

	foreach ($files as $fId => $item)
	{
		if ($item['prefix'])
		{
			$actionUrl = str_replace(
				'#attachedId#',
				$item['id'],
				self::ACTION_DOWNLOAD_FILE
			);
			$replace['[DISK FILE ID=' . $fId . ']'] =
				'' .
					$item['file_name'] .
				'';
		}
	}

	if ($replace)
	{
		$text = str_replace(
			array_keys($replace),
			array_values($replace),
			$text
		);
	}

	return $text;
}