• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/tradingplatform/vk/sectionslist.php
  • Класс: BitrixSaleTradingPlatformVkSectionsList
  • Вызов: SectionsList::prepareSectionToShow
public function prepareSectionToShow($sectionId)
{
	$sections = $this->getSections(false, false);
	$section = $sections[$sectionId];

	$currParams = $this->mappedSections[$sectionId]['PARAMS'];
	$parentParams = $currParams["PARENT_SETTINGS"];

//		for root section inherit always false
	if (!$section["IBLOCK_SECTION_ID"])
	{
		$currParams['INHERIT'] = false;
	}

//		if not INHERIT - get own settings, Else - find parents
	if (isset($currParams['INHERIT']) && !$currParams['INHERIT'])
	{
		$currParams = $currParams + $this->getDefaultExportParams($sectionId);
	}
	else
	{
//			prepared for correct show to_album and album_alias
		if (!empty($parentParams))
		{
			$currParams = $this->prepareParentSettingToShow($parentParams, $section);
		}
//			if parent not set - get default
		else
		{
			$currParams = $this->getDefaultExportParams($sectionId);
		}

//			override parent setting
		$currParams['INHERIT'] = true;
	}

//		add hidden fields for saving PARENTS settings
	$hiddenParentParams = !empty($parentParams) ?
		$this->prepareParentSettingToShow($parentParams, $section) :
		$hiddenParentParams = $this->getDefaultExportParams($sectionId);
	foreach ($hiddenParentParams as $key => $param)
	{
		$currParams[$key . '__PARENT'] = $param;
	}

	return $currParams;
}