- Модуль: intranet
- Путь к файлу: ~/bitrix/modules/intranet/classes/general/event_calendar.php
- Класс: CECCalendar
- Вызов: CECCalendar::CreateDefault
static function CreateDefault($arParams = array(), $bDisplay = true, &$newSectionId = 'none')
{
$iblockId = $arParams['iblockId'];
$ownerId = $arParams['ownerId'];
$ownerType = $arParams['ownerType'];
$sectionId = $arParams['sectionId'];
if ($ownerType == 'USER')
$name = GetMessage('EC_DEF_SECT_USER_CAL');
else
$name = GetMessage('EC_DEF_SECT_GROUP_CAL');
$arFields = Array(
'ID' => 0,
'NAME' => $name,
'DESCRIPTION' => '',
"COLOR" => "#CEE669",
"EXPORT" => true,
"EXPORT_SET" => 'all'
);
$arParams['arFields'] = $arFields;
$ID = CECCalendar::Edit($arParams, $newSectionId, $bDisplay);
if ($ID > 0 && $bDisplay) // Display created calendar for js
{
$arEx = CECCalendar::GetExportParams($iblockId, $ID, $ownerType, $ownerId);
$outlookJs = CECCalendar::GetOutlookLink(array(
'ID' => intval($ID),
'PREFIX' => CEventCalendar::GetOwnerName(array('iblockId' => $iblockId, 'ownerType' => $ownerType, 'ownerId' => $ownerId))
));
?>
}
// Clear cache
$event = new CEventCalendar();
$event->ClearCache("event_calendar/".$iblockId."/calendars/".($ownerId > 0 ? $ownerId : 0)."/");
if ($ownerType == 'GROUP')
$event->ClearCache('event_calendar/sp_groups/');
elseif($ownerType == 'USER')
$event->ClearCache('event_calendar/sp_user/');
else
$event->ClearCache('event_calendar/sp_common/');
return $ID;
}