• Модуль: intranet
  • Путь к файлу: ~/bitrix/modules/intranet/classes/general/event_calendar.php
  • Класс: CEventCalendar
  • Вызов: CEventCalendar::GetSectionsForOwners
function GetSectionsForOwners($arOwners, $ownerType)
{
	if ($ownerType == 'GROUP')
		$iblockId = $this->spGroupsIblId;
	elseif($ownerType == 'USER')
		$iblockId = $this->userIblockId;

	$arFilter = Array(
		"SECTION_ID" => '',
		"IBLOCK_ID" => $iblockId,
		"ACTIVE"	=> "Y"
	);

	if ($ownerType == 'USER')
		$arFilter["CREATED_BY"] = $arOwners;
	elseif ($ownerType == 'GROUP')
		$arFilter["SOCNET_GROUP_ID"] = $arOwners;

	$rsData = CIBlockSection::GetList(Array('ID' => 'ASC'), $arFilter);

	$res = array();
	while($sect = $rsData->Fetch())
	{
		if ($ownerType == 'USER')
			$res[$sect['CREATED_BY']] = $sect['ID'];
		elseif ($ownerType == 'GROUP')
			$res[$sect['SOCNET_GROUP_ID']] = $sect['ID'];
	}

	return $res;
}