- Модуль: sale
- Путь к файлу: ~/bitrix/modules/sale/lib/tradingplatform/vk/sectionslist.php
- Класс: BitrixSaleTradingPlatformVkSectionsList
- Вызов: SectionsList::getListMappedSections
private function getListMappedSections()
{
$result = array();
foreach ($this->mappedSections as $mappedSection)
{
$params = $mappedSection["PARAMS"];
$parentParams = $params["PARENT_SETTINGS"];
// not inherit - check pur params
if (!$params["INHERIT"] && $params["ENABLE"])
{
$result[$mappedSection["BX_ID"]] = array(
"TO_ALBUM" => $params["TO_ALBUM"],
"BX_ID" => $mappedSection["BX_ID"],
"VK_CATEGORY" => $params["VK_CATEGORY"],
"IBLOCK" => $params["IBLOCK"],
);
// alias get from settings. If not set - do nothing (will be used default name)
if ($params["TO_ALBUM_ALIAS"])
{
$result[$mappedSection["BX_ID"]]["TO_ALBUM_ALIAS"] = $params["TO_ALBUM_ALIAS"];
}
}
// inherit - get params from parent. If not include child - import in self album
elseif ($params["INHERIT"] && $parentParams && $parentParams["ENABLE"] && !$parentParams["INCLUDE_CHILDS"])
{
$result[$mappedSection["BX_ID"]] = array(
"TO_ALBUM" => $mappedSection["BX_ID"],
"BX_ID" => $mappedSection["BX_ID"],
"VK_CATEGORY" => $parentParams["VK_CATEGORY"],
"IBLOCK" => $params["IBLOCK"],
);
}
// if INHERIT and parent section included childs - put section to parent to_album
elseif ($params["INHERIT"] && $parentParams && $parentParams["ENABLE"] && $parentParams["INCLUDE_CHILDS"])
{
$result[$mappedSection["BX_ID"]] = array(
"TO_ALBUM" => $parentParams["TO_ALBUM"],
"BX_ID" => $mappedSection["BX_ID"],
"VK_CATEGORY" => $params["VK_CATEGORY"],
"IBLOCK" => $params["IBLOCK"],
);
// alias get from settings. If not set - do nothing (will be used default name)
if ($parentParams["TO_ALBUM_ALIAS"])
{
$result[$mappedSection["BX_ID"]]["TO_ALBUM_ALIAS"] = $parentParams["TO_ALBUM_ALIAS"];
}
}
}
return $result;
}