本文整理汇总了PHP中CCalendar::ParseHTMLToBB方法的典型用法代码示例。如果您正苦于以下问题:PHP CCalendar::ParseHTMLToBB方法的具体用法?PHP CCalendar::ParseHTMLToBB怎么用?PHP CCalendar::ParseHTMLToBB使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCalendar
的用法示例。
在下文中一共展示了CCalendar::ParseHTMLToBB方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ConvertEntity
//.........这里部分代码省略.........
} else {
$arGroupPerm = CIBlock::GetGroupPermissions($iblockId);
$taskByLetter = array('D' => CCalendar::GetAccessTasksByName('calendar_section', 'calendar_denied'), 'R' => CCalendar::GetAccessTasksByName('calendar_section', 'calendar_view'), 'W' => CCalendar::GetAccessTasksByName('calendar_section', 'calendar_edit'), 'X' => CCalendar::GetAccessTasksByName('calendar_section', 'calendar_access'));
foreach ($arGroupPerm as $groupId => $letter) {
$Access['G' . $groupId] = $taskByLetter[$letter];
}
}
// 1. Fetch sections
$arUserSections = CEventCalendar::GetCalendarList(array($iblockId, $sectionId, 0, $ownerType));
$calendarIndex = array();
foreach ($arUserSections as $section) {
$arUF = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFields($ent_id, $section['ID']);
if (isset($arUF["UF_CAL_CONVERTED"]) && strlen($arUF["UF_CAL_CONVERTED"]['VALUE']) > 0) {
continue;
}
$SectionAccess = array();
if ($bSetAccessFromCalendar && $ownerType == 'user') {
if ($section['PRIVATE_STATUS'] == 'private') {
$deniedTask = CCalendar::GetAccessTasksByName('calendar_section', 'calendar_denied');
$SectionAccess['G2'] = $deniedTask;
} elseif ($section['PRIVATE_STATUS'] == 'time') {
$viewTimeTask = CCalendar::GetAccessTasksByName('calendar_section', 'calendar_view_time');
$SectionAccess['G2'] = $viewTimeTask;
} elseif ($section['PRIVATE_STATUS'] == 'title') {
$viewTitleTask = CCalendar::GetAccessTasksByName('calendar_section', 'calendar_view_title');
$SectionAccess['G2'] = $viewTitleTask;
} else {
$SectionAccess = $Access;
// nested from common access settings from socnet
}
} else {
$SectionAccess = $Access;
// G2 => denied
}
$new_sect_id = CCalendarSect::Edit(array('arFields' => array("CAL_TYPE" => $ownerType, "NAME" => $section['NAME'], "OWNER_ID" => $ownerId, "CREATED_BY" => $createdBy, "DESCRIPTION" => $section['DESCRIPTION'], "COLOR" => $section["COLOR"], "ACCESS" => $SectionAccess)));
// Set converted property
$bs->Update($section['ID'], array('UF_CAL_CONVERTED' => 1));
$calendarIndex[$section['ID']] = $new_sect_id;
$sectCount++;
}
// 2. Create events
$arEvents = CEventCalendar::GetCalendarEventsList(array($iblockId, $sectionId, 0), array());
foreach ($arEvents as $event) {
if (!isset($calendarIndex[$event['IBLOCK_SECTION_ID']]) || $event['PROPERTY_PARENT'] > 0) {
continue;
}
$arFields = array("CAL_TYPE" => $ownerType, "OWNER_ID" => $ownerId, "CREATED_BY" => $event["CREATED_BY"], "DT_FROM" => $event['ACTIVE_FROM'], "DT_TO" => $event['ACTIVE_TO'], 'NAME' => htmlspecialcharsback($event['NAME']), 'DESCRIPTION' => CCalendar::ParseHTMLToBB(htmlspecialcharsback($event['DETAIL_TEXT'])), 'SECTIONS' => array($calendarIndex[$event['IBLOCK_SECTION_ID']]), 'ACCESSIBILITY' => $event['PROPERTY_ACCESSIBILITY'], 'IMPORTANCE' => $event['PROPERTY_IMPORTANCE'], 'PRIVATE_EVENT' => $event['PROPERTY_PRIVATE'] && $event['PROPERTY_PRIVATE'] == 'true' ? '1' : '', 'RRULE' => array(), 'LOCATION' => array('NEW' => $event['PROPERTY_LOCATION'], 'RE_RESERVE' => 'N'), "REMIND" => array(), "IS_MEETING" => $event['PROPERTY_IS_MEETING'] == 'Y');
if (!empty($event['PROPERTY_REMIND_SETTINGS'])) {
$ar = explode("_", $event["PROPERTY_REMIND_SETTINGS"]);
if (count($ar) == 2) {
$arFields["REMIND"][] = array('type' => $ar[1], 'count' => floatVal($ar[0]));
}
}
if (isset($event["PROPERTY_PERIOD_TYPE"]) && in_array($event["PROPERTY_PERIOD_TYPE"], array("DAILY", "WEEKLY", "MONTHLY", "YEARLY"))) {
$arFields['RRULE']['FREQ'] = $event["PROPERTY_PERIOD_TYPE"];
$arFields['RRULE']['INTERVAL'] = $event["PROPERTY_PERIOD_COUNT"];
if (!empty($event['PROPERTY_EVENT_LENGTH'])) {
$arFields['DT_LENGTH'] = intval($event['PROPERTY_EVENT_LENGTH']);
}
if (!$arFields['DT_LENGTH']) {
$arFields['DT_LENGTH'] = 86400;
}
if ($arFields['RRULE']['FREQ'] == "WEEKLY" && !empty($event['PROPERTY_PERIOD_ADDITIONAL'])) {
$arFields['RRULE']['BYDAY'] = array();
$bydays = explode(',', $event['PROPERTY_PERIOD_ADDITIONAL']);
foreach ($bydays as $day) {
$day = CCalendar::WeekDayByInd($day);
if ($day !== false) {
$arFields['RRULE']['BYDAY'][] = $day;
}
}
$arFields['RRULE']['BYDAY'] = implode(',', $arFields['RRULE']['BYDAY']);
}
$arFields['RRULE']['UNTIL'] = $event['ACTIVE_TO'];
}
if ($arFields['IS_MEETING']) {
if ($event['PROPERTY_PARENT'] > 0) {
continue;
}
$host = intVal($event['CREATED_BY']);
$arFields['ATTENDEES'] = array();
if ($event['PROPERTY_HOST_IS_ABSENT'] == 'N') {
$arFields['ATTENDEES'][] = $host;
}
$arGuests = CECEvent::GetGuests(self::$userIblockId, $event['ID']);
$attendeesStatuses = array();
foreach ($arGuests as $userId => $ev) {
$attendeesStatuses[$userId] = $ev['PROPERTY_VALUES']['CONFIRMED'];
$arFields['ATTENDEES'][] = $userId;
}
$arFields['MEETING_HOST'] = $host;
$arFields['MEETING'] = array('HOST_NAME' => CCalendar::GetUserName($host), 'TEXT' => is_array($event['PROPERTY_MEETING_TEXT']) && is_string($event['PROPERTY_MEETING_TEXT']['TEXT']) ? trim($event['PROPERTY_MEETING_TEXT']['TEXT']) : '', 'OPEN' => false, 'NOTIFY' => false, 'REINVITE' => false);
}
$new_event_id = CCalendar::SaveEvent(array('arFields' => $arFields, 'bAffectToDav' => false, 'attendeesStatuses' => $attendeesStatuses, 'bSendInvitations' => false));
$eventsCount++;
}
// 3. Set userfield
$bs->Update($sectionId, array('UF_CAL_CONVERTED' => 1));
return array('eventsCount' => $eventsCount, 'sectCount' => $sectCount);
}
示例2: UpdateListItems
//.........这里部分代码省略.........
elseif($arData['fRecurrence'] == -1 && $id > 0)
{
$arData['RRULE'] = -1;
}
if (isset($arData['EventDate']))
{
$skipTime = $arData['fAllDayEvent'] ? 'Y' : 'N';
$TZBias = $arData['fAllDayEvent'] ? 0 : $TZBias;
$arData['EventDate'] += $TZBias;
$arData['EndDate'] += $TZBias;
// $arData["DT_FROM"] = ConvertTimeStamp($arData['EventDate'], 'FULL');
// $arData["DT_TO"] = ConvertTimeStamp($arData['EndDate'], 'FULL');
}
else
{
$arData["DT_FROM"] = -1;
$arData["DT_TO"] = -1;
}
// fields
$arFields = array(
"ID" => $id,
'CAL_TYPE' => $calType,
'OWNER_ID' => $ownerId,
'CREATED_BY' => $userId,
'DT_FROM_TS' => $arData['EventDate'],
'DT_TO_TS' => $arData['EndDate'],
'DT_SKIP_TIME' => $skipTime,
// "DT_FROM" => $arData["DT_FROM"],
// "DT_TO" => $arData["DT_TO"],
'NAME' => $arData['Title'],
'DESCRIPTION' => CCalendar::ParseHTMLToBB($arData['Description']),
'SECTIONS' => array($arSection['ID']),
'ACCESSIBILITY' => $arStatusValues[$arData['MetaInfo_BusyStatus']],
'IMPORTANCE' => $arPriorityValues[$arData['MetaInfo_Priority']],
'RRULE' => $arData['RRULE'],
'LOCATION' => CCalendar::UnParseTextLocation($arData['Location'])
);
if (isset($arData['DT_LENGTH']) && $arData['DT_LENGTH'] > 0)
$arFields['DT_LENGTH'] = $arData['DT_LENGTH'];
$EventID = CCalendar::SaveEvent(
array(
'arFields' => $arFields,
'fromWebservice' => true
)
);
if ($EventID)
{
// dirty hack
$arReplicationIDs[$EventID] = $arData['MetaInfo_ReplicationID'];
$arResponseRows[$EventID] = new CXMLCreator('Result');
$arResponseRows[$EventID]->setAttribute('ID', $obMethod->getAttribute('ID').','.$arData['_command']);
$arResponseRows[$EventID]->setAttribute('List', $listName);
$arResponseRows[$EventID]->addChild($obNode = new CXMLCreator('ErrorCode'));
$obNode->setData('0x00000000');
//$arResponseRows[$EventID]->setAttribute('Version', 3);
}
}
}
示例3: AddEvent
public static function AddEvent($MEETING_ID, $arFields, $arParams = array())
{
global $USER;
$EventID = false;
if (self::IsNewCalendar()) {
$arEventFields = array('ID' => $arFields['EVENT_ID'], 'CAL_TYPE' => 'user', 'OWNER_ID' => $arFields['OWNER_ID'], 'DT_FROM' => $arFields['DATE_START'], 'DT_TO' => ConvertTimeStamp(MakeTimeStamp($arFields['DATE_START']) + $arFields['DURATION'], 'FULL'), 'NAME' => $arFields['TITLE'], 'DESCRIPTION' => CCalendar::ParseHTMLToBB($arFields['DESCRIPTION']), 'IS_MEETING' => true, 'MEETING_HOST' => $arFields['OWNER_ID'], 'MEETING' => array('HOST_NAME' => CCalendar::GetUserName($arFields['OWNER_ID'])), 'ATTENDEES' => array_keys($arFields['USERS']));
if ($arFields['CURRENT_STATE'] == CMeeting::STATE_CLOSED) {
$arEventFields['DT_TO'] = MakeTimeStamp($arFields['DATE_FINISH']) > MakeTimeStamp($arFields['DATE_START']) ? $arFields['DATE_FINISH'] : $arEventFields['DT_TO'];
}
$matches = array();
if (preg_match('/^mr_([\\d]+)_([\\d]+)$/', $arFields["PLACE"], $matches)) {
$arEventFields['LOCATION'] = 'ECMR_' . $matches[2];
if ($arFields['EVENT_ID'] > 0) {
$arCurrentEvent = CCalendarEvent::GetById($arFields['EVENT_ID']);
if ($arCurrentEvent['LOCATION']) {
$res = CCalendar::ParseLocation($arCurrentEvent['LOCATION']);
if ($res['mrevid']) {
$arEventFields['LOCATION'] .= '_' . $res['mrevid'];
}
}
}
} else {
$arEventFields['LOCATION'] = $arFields['PLACE'];
}
if (isset($arFields['REINVITE'])) {
$arEventFields['MEETING']['REINVITE'] = $arFields['REINVITE'];
} else {
$arEventFields['MEETING']['REINVITE'] = false;
}
if (isset($arFields['NOTIFY'])) {
$arEventFields['MEETING']['NOTIFY'] = $arFields['NOTIFY'];
}
$EventID = CCalendar::SaveEvent(array('arFields' => $arEventFields, 'userId' => $arFields['OWNER_ID'], 'autoDetectSection' => true, 'autoCreateSection' => true));
} elseif (!$arFields['EVENT_ID']) {
$iblockId = $arParams['CALENDAR_IBLOCK_ID'] ? $arParams['CALENDAR_IBLOCK_ID'] : COption::GetOptionInt('intranet', 'iblock_calendar', 0, SITE_ID);
$obCalendar = new CEventCalendar();
$obCalendar->Init(array('ownerType' => 'USER', 'ownerId' => $USER->GetID(), 'bOwner' => true, 'iblockId' => $iblockId, 'userIblockId' => $iblockId, 'bCache' => false, 'pathToUserCalendar' => '/company/personal/user/#user_id#/calendar/'));
$guestCalendarId = false;
$guestSection = $obCalendar->GetSectionIDByOwnerId($USER->GetID(), 'USER', $iblockId);
$arGuestCalendars = array();
if (!$guestSection) {
$guestSection = $obCalendar->CreateSectionForOwner($USER->GetID(), "USER", $iblockId);
}
$arGuestCalendars = $obCalendar->GetCalendars(array('sectionId' => $guestSection, 'iblockId' => $iblockId, 'ownerType' => 'USER', 'ownerId' => $USER->GetID(), 'bOwner' => 1, 'forExport' => true, 'bOnlyID' => true));
if (count($arGuestCalendars) > 0) {
$arUserSet = $obCalendar->GetUserSettings(array('static' => false, 'userId' => $USER->GetID()));
if ($arUserSet && isset($arUserSet['MeetCalId']) && in_array($arUserSet['MeetCalId'], $arGuestCalendars)) {
$guestCalendarId = intVal($arUserSet['MeetCalId']);
} else {
$guestCalendarId = $arGuestCalendars[0];
}
}
//$bGroup = $arParams['GROUP_ID'] > 0;
$arPermissions = $obCalendar->GetPermissions(array('setProperties' => true));
$arEventFields = array('iblockId' => $obCalendar->iblockId, 'ownerType' => $obCalendar->ownerType, 'ownerId' => $obCalendar->ownerId, 'RMiblockId' => self::__getRMIblockID(), 'allowResMeeting' => true, 'bNew' => true, 'fullUrl' => $obCalendar->fullUrl, 'userId' => $obCalendar->userId, 'pathToUserCalendar' => $obCalendar->pathToUserCalendar, 'pathToGroupCalendar' => $obCalendar->pathToGroupCalendar, 'userIblockId' => $obCalendar->iblockId, 'calendarId' => $guestCalendarId, 'sectionId' => $guestSection, 'dateFrom' => $arFields['DATE_START'], 'dateTo' => $arFields['DATE_FINISH'] ? $arFields['DATE_FINISH'] : ConvertTimeStamp(MakeTimeStamp($arFields['DATE_START']) + $arFields['DURATION'], 'FULL'), 'name' => $arFields['TITLE'], 'desc' => $arFields['DESCRIPTION'], 'prop' => array(), 'isMeeting' => true, 'guests' => array_keys($arFields['USERS']), 'notDisplayCalendar' => true);
if ($EventID = $obCalendar->SaveEvent($arEventFields)) {
CEventCalendar::ClearCache('/event_calendar/events/' . $arEventFields['iblockId'] . '/');
CEventCalendar::ClearCache('/event_calendar/events/' . $arEventFields['userIblockId'] . '/');
}
}
if ($EventID) {
self::Update($MEETING_ID, array('EVENT_ID' => $EventID));
}
return $EventID;
}