• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/checklist.php
  • Класс: CCheckList
  • Вызов: CCheckList::GetStructure
function GetStructure()
{ //build checklist stucture with section statistic & status info
	$arSections = $this->GetSections();
	foreach ($arSections as $key => $arSectionFields)
	{
		if (empty($arSectionFields["CATEGORIES"]))
		{
			$arSections[$key]["CATEGORIES"] = array();
			$arSectionFields["CATEGORIES"] = array();
		}
		if (empty($arSectionFields["PARENT"]))
		{
			$arSections[$key]["POINTS"] = $this->GetPoints($key);
			$arSections[$key] = array_merge($arSections[$key], $this->GetSectionStat($key));
			continue;
		}

		$arFields = $arSectionFields;
		$arFields["POINTS"] = $this->GetPoints($key);
		$arFields = array_merge($arFields, $this->GetSectionStat($key));
		$arSections[$arFields["PARENT"]]["CATEGORIES"][$key] = $arFields;
		unset($arSections[$key]);
	}

	$arResult["STRUCTURE"] = $arSections;
	$arResult["STAT"] = $this->GetSectionStat();
	return $arResult;
}