• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/tradingplatform/vk/catalogsectiontabhandler.php
  • Класс: Bitrix\Sale\TradingPlatform\Vk\CatalogSectionTabHandler
  • Вызов: CatalogSectionTabHandler::check
public function check($arArgs)
{
	$vk = Vk::getInstance();
	$exports = $vk->getExportProfilesList();
	$errors = array();

	foreach ($exports as $export)
	{
		$currErrors = array();
//			all VK-errors can be only if export ENABLE
		if (isset($_POST['VK_EXPORT'][$export["ID"]]["ENABLE"]) && $_POST['VK_EXPORT'][$export["ID"]]["ENABLE"])
		{
//				wrong section
			if (isset($_POST['VK_EXPORT'][$export["ID"]]["TO_ALBUM"]) && $_POST['VK_EXPORT'][$export["ID"]]["TO_ALBUM"] < 0)
			{
				$currErrors[] = Loc::getMessage("SALE_VK_EXPORT_SETTINGS__ERROR_WRONG_ALBUM");
				unset($_POST['VK_EXPORT'][$export["ID"]]["TO_ALBUM"]);
			}

//				section is selected, but alias is empty
			if (
				isset($_POST['VK_EXPORT'][$export["ID"]]["TO_ALBUM"]) && $_POST['VK_EXPORT'][$export["ID"]]["TO_ALBUM"] > 0 &&
				$_POST['VK_EXPORT'][$export["ID"]]["TO_ALBUM"] == $_POST['VK_EXPORT'][$export["ID"]]["TO_ALBUM_CURRENT"] &&
				mb_strlen($_POST['VK_EXPORT'][$export["ID"]]["TO_ALBUM_ALIAS"]) < 2
			)
			{
				$currErrors[] = Loc::getMessage("SALE_VK_EXPORT_SETTINGS__ERROR_EMPTY_ALIAS");
				unset($_POST['VK_EXPORT'][$export["ID"]]["TO_ALBUM_ALIAS"]);
			}

			if (isset($_POST['VK_EXPORT'][$export["ID"]]["VK_CATEGORY"]) && $_POST['VK_EXPORT'][$export["ID"]]["VK_CATEGORY"] == 0)
			{
				$currErrors[] = Loc::getMessage("SALE_VK_EXPORT_SETTINGS__ERROR_WRONG_VK_CATEGORY");
				unset($_POST['VK_EXPORT'][$export["ID"]]["VK_CATEGORY"]);
			}
		}

		if (!empty($currErrors))
			$errors[] =
				Loc::getMessage("SALE_VK_EXPORT_PROFILE") .
				'"' . HtmlFilter::encode($export['DESC']) . '": 
' . implode('
', $currErrors); } if (!empty($errors)) throw new SystemException(implode('

', $errors)); return true; }