UpdateDynamicAction::getJsCommand

  1. Bitrix24 API (v. 23.675.0)
  2. landing
  3. UpdateDynamicAction
  4. getJsCommand
  • Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/History/Action/UpdateDynamicAction.php
  • Класс: BitrixLandingHistoryActionUpdateDynamicAction
  • Вызов: UpdateDynamicAction::getJsCommand
public function getJsCommand(bool $undo = true): array
{
	$params = parent::getJsCommand($undo);

	$params['params']['value'] =
		$undo
			? $params['params']['valueBefore']
			: $params['params']['valueAfter'];

	unset(
		$params['params']['valueAfter'],
		$params['params']['valueBefore'],
	);

	$params['params']['dynamicParams'] = $params['params']['value'];
	$params['params']['dynamicState'] = [];
	foreach (array_keys($params['params']['dynamicParams']) as $selector)
	{
		$params['params']['dynamicState'][$selector] = true;
	}
	if (!$params['params']['dynamicState']['wrapper'])
	{
		!$params['params']['dynamicState']['wrapper'] = false;
	}

	return $params;
}

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