CBPVirtualDocument::prepareSectionForPrint

  1. Bitrix24 API (v. 23.675.0)
  2. bizproc
  3. CBPVirtualDocument
  4. prepareSectionForPrint
  • Модуль: bizproc
  • Путь к файлу: ~/bitrix/modules/bizproc/classes/general/virtualdocument.php
  • Класс: CBPVirtualDocument
  • Вызов: CBPVirtualDocument::prepareSectionForPrint
static function prepareSectionForPrint($value, $iblockId = 0)
{
	if ($iblockId <= 0)
		$iblockId = COption::GetOptionInt("intranet", "iblock_tasks", 0);
	if ($iblockId <= 0)
		return false;

	$arReturn = array();

	$valueTmp = $value;
	if (!is_array($valueTmp))
		$valueTmp = array($valueTmp);

	foreach ($valueTmp as $val)
	{
		$ar = array();

		$dbSectionsList = CIBlockSection::GetNavChain($iblockId, $val);
		while ($arSection = $dbSectionsList->GetNext())
			$ar[$arSection["ID"]] = array("NAME" => $arSection["NAME"], "XML_ID" => $arSection["XML_ID"]);

		$arReturn[] = $ar;
	}

	return (is_array($value) ? $arReturn : ((count($arReturn) > 0) ? $arReturn[0] : array()));
}

Добавить комментарий