• Модуль: forum
  • Путь к файлу: ~/bitrix/modules/forum/classes/general/functions.php
  • Класс: forumTextParser
  • Вызов: forumTextParser::convert
function convert($text, $allow = array(), $type = "html", $arFiles = false)
{
	$text = str_replace(array("13", "14"), "", $text);

	$this->imageWidth = (isset($this->image_params["width"]) && $this->image_params["width"] > 0 ? $this->image_params["width"] : ($this->imageWidth > 0 ? $this->imageWidth : 300));
	$this->imageHeight = (isset($this->image_params["height"]) && $this->image_params["height"] > 0 ? $this->image_params["height"] : ($this->imageHeight > 0 ? $this->imageHeight : 300));

	$this->userPath = str_replace(array("#UID#", "#uid#"), "#user_id#", (empty($this->userPath) && !empty($this->pathToUser) ? $this->pathToUser : $this->userPath));

	$this->type = $type;

	$allow = (is_array($allow) ? $allow : array());
	if (!empty($this->arUserfields))
		$allow["USERFIELDS"] = $this->arUserfields;

	if (sizeof($allow)>0)
	{
		if (!isset($allow['TABLE']))
			$allow['TABLE']=$allow['BIU'];

		$this->allow = array_merge((is_array($this->allow) ? $this->allow : array()), $allow);
	}
	$this->parser_nofollow = COption::GetOptionString("forum", "parser_nofollow", "Y");
	$this->link_target = COption::GetOptionString("forum", "parser_link_target", "_blank");

	if ($arFiles !== false)
		$this->arFiles = is_array($arFiles) ? $arFiles : array($arFiles);
	$this->arFilesIDParsed = array();

	$text = str_replace(array("13", "14"), array(chr(34), chr(39)), $this->convertText($text));
	return $text;
}