- Модуль: calendar
- Путь к файлу: ~/bitrix/modules/calendar/lib/ui/calendarfilter.php
- Класс: BitrixCalendarUiCalendarFilter
- Вызов: CalendarFilter::getSectionsForFilter
static function getSectionsForFilter(string $type, ?string $preset, ?int $ownerId, ?int $userId): array
{
$result = [];
$sectionList = CCalendar::getSectionList([
'CAL_TYPE' => $type,
'OWNER_ID' => $ownerId,
'checkPermissions' => true,
'getPermissions' => true,
]);
$isPersonalCalendarContext = ($type === 'user' && $userId === $ownerId);
$hiddenSections = [];
if ($preset !== self::PRESET_INVITED)
{
$hiddenSections = UserSettings::getHiddenSections(
$userId,
[
'type' => $type,
'ownerId' => $ownerId,
'isPersonalCalendarContext' => $isPersonalCalendarContext,
]
);
$hiddenSections = array_map(static function($sectionId) {
return (int)$sectionId;
}, $hiddenSections);
}
foreach ($sectionList as $section)
{
if (in_array((int)$section['ID'], $hiddenSections, true))
{
continue;
}
$result[] = (int)$section['ID'];
}
return $result;
}