• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/node/link.php
  • Класс: BitrixLandingNodeLink
  • Вызов: Link::getNode
static function getNode(BitrixLandingBlock $block, $selector)
{
	$data = array();
	$doc = $block->getDom();
	$manifest = $block->getManifest();
	$resultList = $doc->querySelectorAll($selector);

	foreach ($resultList as $pos => $res)
	{
		$data[$pos] = array(
			'href' => $res->getAttribute('href'),
			'target' => $res->getAttribute('target'),
			'attrs' => array(
				'data-embed' => $res->getAttribute('data-embed'),
				'data-url' => $res->getAttribute('data-url')
			)
		);
		if (
			!isset($manifest['nodes'][$selector]['skipContent']) ||
			$manifest['nodes'][$selector]['skipContent'] !== true
		)
		{
			$text = htmlspecialcharsback($res->getInnerHTML());
			$text = str_replace(' ', '', $text);
			$data[$pos]['text'] = $text;
		}
	}

	return $data;
}