CCrmUrlTemplate::BuildNode

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmUrlTemplate
  4. BuildNode
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_url_util.php
  • Класс: \CCrmUrlTemplate
  • Вызов: CCrmUrlTemplate::BuildNode
static function BuildNode(&$node, &$params, &$output)
{
	$nodeType = $node['nodeType'];
	if($nodeType === 2)
	{
		$output[] = $node['content'];
	}
	elseif($nodeType === 1)
	{
		$nodeName = $node['name'];

		if($nodeName === 'PHONE')
		{
			$output[] = $params['PHONE'];
		}
		if(in_array($nodeName, self::$CONTAINER_TAGS, true))
		{
			$childrenOutput = array();
			if(isset($node['nodes']) && is_array($node['nodes']))
			{
				self::BuildNodes($node['nodes'], $params, $childrenOutput);
			}

			if(!empty($childrenOutput))
			{
				$childrenText = implode('', $childrenOutput);
				if($nodeName === 'URLENCODE')
				{
					$output[] = urlencode($childrenText);
				}
				elseif($nodeName === 'HTMLENCODE')
				{
					$output[] = htmlspecialcharsbx($childrenText);
				}
				elseif($nodeName === 'JSENCODE')
				{
					$output[] = CUtil::JSEscape($childrenText);
				}
				elseif($nodeName === 'SHA1')
				{
					$output[] = hash('sha1', $childrenText);
				}
				elseif($nodeName === 'MD4')
				{
					$output[] = hash('md4', $childrenText);
				}
				elseif($nodeName === 'MD5')
				{
					$output[] = hash('md5', $childrenText);
				}
			}
			unset($childrenOutput);
		}
	}
}

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