• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/node/link.php
  • Класс: BitrixLandingNodeLink
  • Вызов: Link::prepareActions
static function prepareActions(array $field)
{
	if (empty($field['actions']) || !is_array($field['actions']))
	{
		return null;
	}
	$result = [];
	$dublicate = [];
	foreach ($field['actions'] as $row)
	{
		if (empty($row) || !is_array($row))
		{
			continue;
		}
		$row = array_change_key_case($row, CASE_LOWER);

		$row['name'] = static::prepareStringValue($row, 'name');
		$row['type'] = static::prepareStringValue($row, 'type');
		if (empty($row['name']) || empty($row['type']))
		{
			continue;
		}
		if (isset($dublicate[$row['type']]))
		{
			continue;
		}

		$result[] = [
			'type' => $row['type'],
			'name' => $row['name']
		];
		$dublicate[$row['type']] = true;
	}

	return (!empty($result) ? $result : null);
}