• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/block.php
  • Класс: BitrixLandingBlock
  • Вызов: Block::setCardContent
public function setCardContent($selector, $position, $content)
{
	if (!is_string($selector))
	{
		return false;
	}

	if ($this->access < $this::ACCESS_W)
	{
		$this->error->addError(
			'ACCESS_DENIED',
			Loc::getMessage('LANDING_BLOCK_ACCESS_DENIED')
		);
		return false;
	}

	$doc = $this->getDom();
	$position = intval($position);
	$resultList = $doc->querySelectorAll($selector);
	if (isset($resultList[$position]))
	{
		$resultList[$position]->setInnerHTML(
			$content
		);
		$this->saveContent($doc->saveHTML());
		return true;
	}

	$this->error->addError(
		'CARD_NOT_FOUND',
		Loc::getMessage('LANDING_BLOCK_CARD_NOT_FOUND')
	);
	return false;
}