- Модуль: intranet
- Путь к файлу: ~/bitrix/modules/intranet/classes/general/event_calendar.php
- Класс: CEventCalendar
- Вызов: CEventCalendar::GetCalendarList
static function GetCalendarList($calendarId)
{
[$iblockId, $sectionId, $subSectionId, $ownerType] = $calendarId;
$arFilter = array('IBLOCK_ID' => $iblockId, "ACTIVE" => "Y", "CHECK_PERMISSIONS" => 'Y');
if (empty($ownerType))
{
if ($sectionId > 0)
$arFilter['ID'] = $sectionId;
}
else
{
$arFilter["SECTION_ID"] = $sectionId;
if ($subSectionId > 0)
$arFilter['ID'] = $subSectionId;
}
$arCalendars = array();
$dbSections = CIBlockSection::GetList(array('ID' => 'ASC'), $arFilter);
while ($arSection = $dbSections->Fetch())
{
$privateStatus = CECCalendar::GetPrivateStatus($iblockId, $arSection['ID'], mb_strtoupper($ownerType));
$arCalendars[] = array(
"ID" => intval($arSection['ID']),
"IBLOCK_ID" => $iblockId,
"IBLOCK_SECTION_ID" => intval($arSection['IBLOCK_SECTION_ID']),
"NAME" => htmlspecialcharsex($arSection['NAME']),
"DESCRIPTION" => htmlspecialcharsex($arSection['DESCRIPTION']),
"COLOR" => CECCalendar::GetColor($iblockId, $arSection['ID'], mb_strtoupper($ownerType)),
"PRIVATE_STATUS" => $privateStatus,
"DATE_CREATE" => date("d.m.Y H:i", MakeTimeStamp($arSection['DATE_CREATE'], getTSFormat()))
);
}
return $arCalendars;
}