• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/History/Action/EditStyleAction.php
  • Класс: BitrixLandingHistoryActionEditStyleAction
  • Вызов: EditStyleAction::execute
public function execute(bool $undo = true): bool
{
	$block = new Block((int)$this->params['block']);
	$selector = $this->params['selector'];
	$position = $this->params['position'];
	$isWrapper = $this->params['isWrapper'];
	$value = $undo ? $this->params['valueBefore'] : $this->params['valueAfter'];

	if ($selector)
	{
		if ($position >= 0 && !$isWrapper)
		{
			$selector = $selector . '@' . $position;
		}
		$data = [
			$selector => [
				'classList' => explode(' ', $value['className']),
				'style' => $value['style'],
				'affect' => $this->params['affect'],
			],
		];

		return $block->setClasses($data) && $block->save();
	}

	return false;
}