本文整理汇总了PHP中CUtil::closetags方法的典型用法代码示例。如果您正苦于以下问题:PHP CUtil::closetags方法的具体用法?PHP CUtil::closetags怎么用?PHP CUtil::closetags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUtil
的用法示例。
在下文中一共展示了CUtil::closetags方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
}
if ($event['IS_MEETING'] == 'Y') {
$arGuests = array('Y' => array(), 'N' => array(), 'Q' => array());
foreach ($event['GUESTS'] as $key => $guest) {
$guest['url'] = str_replace(array('#ID#', '#USER_ID#'), $guest['id'], COption::GetOptionString('intranet', 'path_user', '/company/personal/user/#USER_ID#/', $_REQUEST['site_id']));
if ($guest['bHost']) {
$res['HOST'] = $guest;
} else {
$arGuests[$guest['status']][] = $guest;
}
}
$res['GUESTS'] = array_merge($arGuests['Y'], $arGuests['N'], $arGuests['Q']);
}
$res['DESCRIPTION'] = HTMLToTxt($res['DESCRIPTION']);
if (strlen($res['DESCRIPTION']) > 150) {
$res['DESCRIPTION'] = CUtil::closetags(substr($res['DESCRIPTION'], 0, 150)) . '...';
}
} else {
$APPLICATION->ThrowException('event not found', 'event_not_found');
}
break;
case 'calendar_add':
if (!CBXFeatures::IsFeatureEnabled('Calendar')) {
break;
}
$arParams = array('calendar_id' => $_REQUEST['cal'], 'site_id' => $_REQUEST['site_id'], 'from' => $_REQUEST['from'], 'to' => $_REQUEST['to'], 'name' => $_REQUEST['name'], 'absence' => $_REQUEST['absence'], 'cal_set_default' => $_REQUEST['cal_set_default']);
$res = CTimeManCalendar::Add($arParams);
$bReturnRes = is_array($res);
break;
case 'admin_data_report_full':
$bReturnRes = true;
示例2: plannerActionShow
protected static function plannerActionShow($arParams)
{
global $DB, $USER;
$res = false;
if ($arParams['ID'] > 0) {
$event = self::getEvent(array('ID' => $arParams['ID'], 'SITE_ID' => $arParams['SITE_ID']));
if ($event) {
$today = ConvertTimeStamp(time() + CTimeZone::GetOffset(), 'SHORT');
$now = time();
$res = array('ID' => $event['ID'], 'NAME' => $event['NAME'], 'DESCRIPTION' => CCalendarEvent::ParseText($event['DETAIL_TEXT'], $event['ID'], $event['UF_WEBDAV_CAL_EVENT']), 'URL' => '/company/personal/user/' . $USER->GetID() . '/calendar/?EVENT_ID=' . $event['ID'], 'DATE_FROM' => MakeTimeStamp($event['DATE_FROM']), 'DATE_TO' => MakeTimeStamp($event['DATE_TO']), 'STATUS' => $event['STATUS']);
$res['DATE_FROM_TODAY'] = ConvertTimeStamp(MakeTimeStamp($res['DATE_FROM']), 'SHORT') == $today;
$res['DATE_TO_TODAY'] = ConvertTimeStamp(MakeTimeStamp($res['DATE_TO']), 'SHORT') == $today;
if ($res['DATE_FROM_TODAY']) {
if (IsAmPmMode()) {
$res['DATE_F'] = FormatDate("today g:i a", $res['DATE_FROM']);
$res['DATE_T'] = FormatDate("g:i a", $res['DATE_TO']);
} else {
$res['DATE_F'] = FormatDate("today H:i", $res['DATE_FROM']);
$res['DATE_T'] = FormatDate("H:i", $res['DATE_TO']);
}
if ($res['DATE_TO_TODAY']) {
$res['DATE_F'] .= ' - ' . $res['DATE_T'];
}
if ($res['DATE_FROM'] > $now) {
$res['DATE_F_TO'] = GetMessage('TM_IN') . ' ' . FormatDate('Hdiff', time() * 2 - ($res['DATE_FROM'] - CTimeZone::GetOffset()));
}
} else {
if ($res['DATE_TO_TODAY']) {
$res['DATE_F'] = FormatDate(str_replace(array('#today#', '#time#'), array('today', 'H:i'), GetMessage('TM_TILL')), $res['DATE_TO']);
} else {
$fmt = preg_replace('/:s$/', '', $DB->DateFormatToPHP(CSite::GetDateFormat("FULL")));
$res['DATE_F'] = FormatDate($fmt, $res['DATE_FROM']);
$res['DATE_F_TO'] = FormatDate($fmt, $res['DATE_TO']);
}
}
if ($event['IS_MEETING'] == 'Y') {
$arGuests = array('Y' => array(), 'N' => array(), 'Q' => array());
foreach ($event['GUESTS'] as $key => $guest) {
$guest['url'] = str_replace(array('#ID#', '#USER_ID#'), $guest['id'], COption::GetOptionString('intranet', 'path_user', '/company/personal/user/#USER_ID#/', $arParams['SITE_ID']));
if ($guest['bHost']) {
$res['HOST'] = $guest;
} else {
$arGuests[$guest['status']][] = $guest;
}
}
$res['GUESTS'] = array_merge($arGuests['Y'], $arGuests['N'], $arGuests['Q']);
}
if (strlen($res['DESCRIPTION']) > 150) {
$res['DESCRIPTION'] = CUtil::closetags(substr($res['DESCRIPTION'], 0, 150)) . '...';
}
$res = array('EVENT' => $res);
}
} else {
$res = array('error' => 'event not found');
}
return $res;
}