• Модуль: ui
  • Путь к файлу: ~/bitrix/modules/ui/lib/form/entityeditorconfiguration.php
  • Класс: BitrixUIFormEntityEditorConfiguration
  • Вызов: EntityEditorConfiguration::reset
public function reset($configID, array $params)
{
	$categoryName = $this->getCategoryName();

	$scope = isset($params['scope'])? mb_strtoupper($params['scope']) : EntityEditorConfigScope::UNDEFINED;
	if(!EntityEditorConfigScope::isDefined($scope))
	{
		$scope = EntityEditorConfigScope::PERSONAL;
	}

	$forAllUsers = self::canEditOtherSettings()
		&& isset($params['forAllUsers'])
		&& $params['forAllUsers'] === 'Y';

	if($scope === EntityEditorConfigScope::COMMON)
	{
		CUserOptions::DeleteOption(
			$categoryName,
			$this->prepareName($configID, $scope),
			true,
			0
		);
		CUserOptions::DeleteOption(
			$categoryName,
			static::prepareOptionsName($configID, $scope),
			true,
			0
		);
	}
	else
	{
		if($forAllUsers)
		{
			CUserOptions::DeleteOptionsByName($categoryName, $this->prepareName($configID, $scope));
			CUserOptions::DeleteOptionsByName($categoryName, static::prepareOptionsName($configID, $scope));
			CUserOptions::DeleteOptionsByName($categoryName, $this->prepareScopeName($configID));
		}
		else
		{
			CUserOptions::DeleteOption($categoryName, $this->prepareName($configID, $scope));
			CUserOptions::DeleteOption($categoryName, static::prepareOptionsName($configID, $scope));

			CUserOptions::SetOption(
				$categoryName,
				$this->prepareScopeName($configID),
				EntityEditorConfigScope::PERSONAL
			);
		}
	}

}