本文整理汇总了PHP中FormatDateFromDB函数的典型用法代码示例。如果您正苦于以下问题:PHP FormatDateFromDB函数的具体用法?PHP FormatDateFromDB怎么用?PHP FormatDateFromDB使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FormatDateFromDB函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: FormatDate
// Don't format time, if it's 00:00
if (date('H:i', $arData['FROM_VALUE']) == '00:00') {
$strDateFrom = FormatDate(CDatabase::DateFormatToPHP(FORMAT_DATE), $arData['FROM_VALUE']);
} else {
$strDateFrom = FormatDate(CDatabase::DateFormatToPHP(FORMAT_DATETIME), $arData['FROM_VALUE']);
}
}
if ($arData['TO_VALUE']) {
// Don't format time, if it's 00:00
if (date('H:i', $arData['TO_VALUE']) == '00:00') {
$strDateTo = FormatDate(CDatabase::DateFormatToPHP(FORMAT_DATE), $arData['TO_VALUE']);
} else {
$strDateTo = FormatDate(CDatabase::DateFormatToPHP(FORMAT_DATETIME), $arData['TO_VALUE']);
}
}
$arResult = array('td1' => '<span class="task-log-date">' . FormatDateFromDB($arData['CREATED_DATE']) . '</span>', 'td2' => '<a class="task-log-author" target="_top" href="' . CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_USER_PROFILE'], array('user_id' => $authorUserId)) . '">' . htmlspecialcharsbx(tasksFormatNameShort($arCurUserData["NAME"], $arCurUserData["LAST_NAME"], $arCurUserData["LOGIN"], $arCurUserData["SECOND_NAME"], $arParams["NAME_TEMPLATE"])) . '</a>', 'td3' => '<span class="task-log-where">' . GetMessage("TASKS_LOG_DEADLINE") . '</span>', 'td4' => '<span class="task-log-what">' . $strDateFrom . '<span class="task-log-arrow">→</span>' . $strDateTo . '</span>');
header('Content-Type: application/x-javascript; charset=' . LANG_CHARSET);
echo CUtil::PhpToJsObject($arResult);
}
} elseif ($action === 'remove_file') {
try {
CTaskAssert::log('remove_file: fileId=' . $_POST['fileId'] . ', taskId=' . $_POST['taskId'] . ', userId=' . $loggedInUserId, CTaskAssert::ELL_INFO);
CTaskAssert::assert(isset($_POST['fileId'], $_POST['taskId']));
$oTaskItem = new CTaskItem($_POST['taskId'], $loggedInUserId);
$oTaskItem->removeAttachedFile($_POST['fileId']);
echo 'Success';
} catch (Exception $e) {
echo 'Error occured';
CTaskAssert::logWarning('Unable to remove_file: fileId=' . $_POST['fileId'] . ', taskId=' . $_POST['taskId'] . ', userId=' . $loggedInUserId);
}
} elseif ($action === 'render_task_detail_part') {
示例2: while
$arResult["Requests"]["List"] = false;
while ($arRequests = $dbRequests->GetNext()) {
if ($arResult["Requests"]["List"] == false) {
$arResult["Requests"]["List"] = array();
}
$pu = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arRequests["USER_ID"]));
$canViewProfile = CSocNetUserPerms::CanPerformOperation($USER->GetID(), $arRequests["USER_ID"], "viewprofile", CSocNetUser::IsCurrentUserModuleAdmin());
if (intval($arRequests["USER_PERSONAL_PHOTO"]) <= 0) {
switch ($arRequests["USER_PERSONAL_GENDER"]) {
case "M":
$suffix = "male";
break;
case "F":
$suffix = "female";
break;
default:
$suffix = "unknown";
}
$arRequests["USER_PERSONAL_PHOTO"] = COption::GetOptionInt("socialnetwork", "default_user_picture_" . $suffix, false, SITE_ID);
}
$arImage = CSocNetTools::InitImage($arRequests["USER_PERSONAL_PHOTO"], 150, "/bitrix/images/socialnetwork/nopic_user_150.gif", 150, $pu, $canViewProfile);
$arResult["Requests"]["List"][] = array("ID" => $arRequests["ID"], "USER_ID" => $arRequests["USER_ID"], "USER_NAME" => $arRequests["USER_NAME"], "USER_LAST_NAME" => $arRequests["USER_LAST_NAME"], "USER_SECOND_NAME" => $arRequests["USER_SECOND_NAME"], "USER_LOGIN" => $arRequests["USER_LOGIN"], "USER_PERSONAL_PHOTO" => $arRequests["USER_PERSONAL_PHOTO"], "USER_PERSONAL_PHOTO_FILE" => $arImage["FILE"], "USER_PERSONAL_PHOTO_IMG" => $arImage["IMG"], "USER_PROFILE_URL" => $pu, "SHOW_PROFILE_LINK" => $canViewProfile, "DATE_CREATE" => FormatDateFromDB($arRequests["DATE_CREATE"]), "MESSAGE" => $parser->convert($arRequests["~MESSAGE"], false, array(), array("HTML" => "N", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "LIST" => "Y", "QUOTE" => "Y", "CODE" => "Y", "FONT" => "Y", "SMILES" => "Y", "UPLOAD" => "N", "NL2BR" => "N")));
}
$arResult["NAV_STRING"] = $dbRequests->GetPageNavStringEx($navComponentObject, GetMessage("SONET_C12_NAV"), "", false);
}
}
}
}
}
}
$this->IncludeComponentTemplate();
示例3: __SLEGetLogCommentRecord
function __SLEGetLogCommentRecord($arComments, $arParams, &$arAssets)
{
// for the same post log_update - time only, if not - date and time
$timestamp = MakeTimeStamp(array_key_exists("LOG_DATE_FORMAT", $arComments) ? $arComments["LOG_DATE_FORMAT"] : $arComments["LOG_DATE"]);
$timeFormated = FormatDateFromDB($arComments["LOG_DATE"], stripos($arParams["DATE_TIME_FORMAT"], 'a') || ($arParams["DATE_TIME_FORMAT"] == 'FULL' && IsAmPmMode()) !== false ? strpos(FORMAT_DATETIME, 'TT') !== false ? 'G:MI TT' : 'G:MI T' : 'HH:MI');
$dateTimeFormated = FormatDate(!empty($arParams['DATE_TIME_FORMAT']) ? $arParams['DATE_TIME_FORMAT'] == 'FULL' ? $GLOBALS['DB']->DateFormatToPHP(str_replace(':SS', '', FORMAT_DATETIME)) : $arParams['DATE_TIME_FORMAT'] : $GLOBALS['DB']->DateFormatToPHP(FORMAT_DATETIME), $timestamp);
if (strcasecmp(LANGUAGE_ID, 'EN') !== 0 && strcasecmp(LANGUAGE_ID, 'DE') !== 0) {
$dateTimeFormated = ToLower($dateTimeFormated);
}
// strip current year
if (!empty($arParams['DATE_TIME_FORMAT']) && ($arParams['DATE_TIME_FORMAT'] == 'j F Y G:i' || $arParams['DATE_TIME_FORMAT'] == 'j F Y g:i a')) {
$dateTimeFormated = ltrim($dateTimeFormated, '0');
$curYear = date('Y');
$dateTimeFormated = str_replace(array('-' . $curYear, '/' . $curYear, ' ' . $curYear, '.' . $curYear), '', $dateTimeFormated);
}
$path2Entity = $arComments["ENTITY_TYPE"] == SONET_ENTITY_GROUP ? CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_GROUP"], array("group_id" => $arComments["ENTITY_ID"])) : CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arComments["ENTITY_ID"]));
if (intval($arComments["USER_ID"]) > 0) {
$suffix = is_array($GLOBALS["arExtranetUserID"]) && in_array($arComments["USER_ID"], $GLOBALS["arExtranetUserID"]) ? GetMessage("SONET_LOG_EXTRANET_SUFFIX") : "";
$arTmpUser = array("NAME" => $arComments["~CREATED_BY_NAME"], "LAST_NAME" => $arComments["~CREATED_BY_LAST_NAME"], "SECOND_NAME" => $arComments["~CREATED_BY_SECOND_NAME"], "LOGIN" => $arComments["~CREATED_BY_LOGIN"]);
$bUseLogin = $arParams["SHOW_LOGIN"] != "N" ? true : false;
$arCreatedBy = array("FORMATTED" => CUser::FormatName($arParams["NAME_TEMPLATE"], $arTmpUser, $bUseLogin) . $suffix, "URL" => CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arComments["USER_ID"], "id" => $arComments["USER_ID"])));
$arCreatedBy["TOOLTIP_FIELDS"] = array("ID" => $arComments["USER_ID"], "NAME" => $arComments["~CREATED_BY_NAME"], "LAST_NAME" => $arComments["~CREATED_BY_LAST_NAME"], "SECOND_NAME" => $arComments["~CREATED_BY_SECOND_NAME"], "LOGIN" => $arComments["~CREATED_BY_LOGIN"], "USE_THUMBNAIL_LIST" => "N", "PATH_TO_SONET_MESSAGES_CHAT" => $arParams["PATH_TO_MESSAGES_CHAT"], "PATH_TO_SONET_USER_PROFILE" => $arParams["PATH_TO_USER"], "PATH_TO_VIDEO_CALL" => $arParams["PATH_TO_VIDEO_CALL"], "DATE_TIME_FORMAT" => $arParams["DATE_TIME_FORMAT"], "SHOW_YEAR" => $arParams["SHOW_YEAR"], "CACHE_TYPE" => $arParams["CACHE_TYPE"], "CACHE_TIME" => $arParams["CACHE_TIME"], "NAME_TEMPLATE" => $arParams["NAME_TEMPLATE"] . $suffix, "SHOW_LOGIN" => $arParams["SHOW_LOGIN"], "PATH_TO_CONPANY_DEPARTMENT" => $arParams["PATH_TO_CONPANY_DEPARTMENT"], "INLINE" => "Y");
} else {
$arCreatedBy = array("FORMATTED" => GetMessage("SONET_C73_CREATED_BY_ANONYMOUS"));
}
$arTmpUser = array("NAME" => $arComments["~USER_NAME"], "LAST_NAME" => $arComments["~USER_LAST_NAME"], "SECOND_NAME" => $arComments["~USER_SECOND_NAME"], "LOGIN" => $arComments["~USER_LOGIN"]);
$arParamsTmp = $arParams;
$arParamsTmp["AVATAR_SIZE"] = isset($arParams["AVATAR_SIZE_COMMON"]) ? $arParams["AVATAR_SIZE_COMMON"] : $arParams["AVATAR_SIZE"];
$arTmpCommentEvent = array("EVENT" => $arComments, "LOG_DATE" => $arComments["LOG_DATE"], "LOG_DATE_TS" => MakeTimeStamp($arComments["LOG_DATE"]), "LOG_DATE_DAY" => ConvertTimeStamp(MakeTimeStamp($arComments["LOG_DATE"]), "SHORT"), "LOG_TIME_FORMAT" => $timeFormated, "LOG_DATETIME_FORMAT" => $dateTimeFormated, "TITLE_TEMPLATE" => "", "TITLE" => "", "TITLE_FORMAT" => "", "ENTITY_NAME" => $arComments["ENTITY_TYPE"] == SONET_ENTITY_GROUP ? $arComments["GROUP_NAME"] : CUser::FormatName($arParams['NAME_TEMPLATE'], $arTmpUser, $bUseLogin), "ENTITY_PATH" => $path2Entity, "CREATED_BY" => $arCreatedBy, "AVATAR_SRC" => CSocNetLogTools::FormatEvent_CreateAvatar($arComments, $arParamsTmp));
$arEvent = CSocNetLogTools::FindLogCommentEventByID($arComments["EVENT_ID"]);
if ($arEvent && array_key_exists("CLASS_FORMAT", $arEvent) && array_key_exists("METHOD_FORMAT", $arEvent)) {
$arLog = $arParams["USER_COMMENTS"] == "Y" ? array() : array("TITLE" => $arComments["~LOG_TITLE"], "URL" => $arComments["~LOG_URL"], "PARAMS" => $arComments["~LOG_PARAMS"]);
$arFIELDS_FORMATTED = call_user_func(array($arEvent["CLASS_FORMAT"], $arEvent["METHOD_FORMAT"]), $arComments, $arParams, false, $arLog);
if ($arParams["USE_COMMENTS"] != "Y") {
if (array_key_exists("CREATED_BY", $arFIELDS_FORMATTED) && isset($arFIELDS_FORMATTED["CREATED_BY"]["TOOLTIP_FIELDS"])) {
$arTmpCommentEvent["CREATED_BY"]["TOOLTIP_FIELDS"] = $arFIELDS_FORMATTED["CREATED_BY"]["TOOLTIP_FIELDS"];
}
}
}
$message = $arFIELDS_FORMATTED && array_key_exists("EVENT_FORMATTED", $arFIELDS_FORMATTED) && array_key_exists("MESSAGE", $arFIELDS_FORMATTED["EVENT_FORMATTED"]) ? $arFIELDS_FORMATTED["EVENT_FORMATTED"]["MESSAGE"] : $arTmpCommentEvent["EVENT"]["MESSAGE"];
if (strlen($message) > 0) {
$arFIELDS_FORMATTED["EVENT_FORMATTED"]["FULL_MESSAGE_CUT"] = CSocNetTextParser::closetags(htmlspecialcharsback($message));
}
if (is_array($arTmpCommentEvent)) {
$arFIELDS_FORMATTED["EVENT_FORMATTED"]["DATETIME"] = $arTmpCommentEvent["LOG_DATE_DAY"] == ConvertTimeStamp() ? $timeFormated : $dateTimeFormated;
$arTmpCommentEvent["EVENT_FORMATTED"] = $arFIELDS_FORMATTED["EVENT_FORMATTED"];
if (isset($arComments["UF"]["UF_SONET_COM_URL_PRV"]) && !empty($arComments["UF"]["UF_SONET_COM_URL_PRV"]["VALUE"])) {
$arCss = $GLOBALS["APPLICATION"]->sPath2css;
$arJs = $GLOBALS["APPLICATION"]->arHeadScripts;
ob_start();
$GLOBALS["APPLICATION"]->IncludeComponent("bitrix:system.field.view", $arComments["UF"]["UF_SONET_COM_URL_PRV"]["USER_TYPE_ID"], array("arUserField" => $arComments["UF"]["UF_SONET_COM_URL_PRV"], "arAddField" => array("NAME_TEMPLATE" => $arParams["NAME_TEMPLATE"], "PATH_TO_USER" => $arParams["~PATH_TO_USER"])), null, array("HIDE_ICONS" => "Y"));
$urlPreviewText = ob_get_clean();
$arTmpCommentEvent["EVENT_FORMATTED"]["FULL_MESSAGE_CUT"] .= $urlPreviewText;
$arAssets["CSS"] = array_merge($arAssets["CSS"], array_diff($GLOBALS["APPLICATION"]->sPath2css, $arCss));
$arAssets["JS"] = array_merge($arAssets["JS"], array_diff($GLOBALS["APPLICATION"]->arHeadScripts, $arJs));
unset($arComments["UF"]["UF_SONET_COM_URL_PRV"]);
}
$arTmpCommentEvent["UF"] = $arComments["UF"];
if (isset($arTmpCommentEvent["EVENT_FORMATTED"]) && is_array($arTmpCommentEvent["EVENT_FORMATTED"])) {
$arFields2Cache = array("DATETIME", "MESSAGE", "FULL_MESSAGE_CUT", "ERROR_MSG");
foreach ($arTmpCommentEvent["EVENT_FORMATTED"] as $field => $value) {
if (!in_array($field, $arFields2Cache)) {
unset($arTmpCommentEvent["EVENT_FORMATTED"][$field]);
}
}
}
if (isset($arTmpCommentEvent["EVENT"]) && is_array($arTmpCommentEvent["EVENT"])) {
if (!empty($arTmpCommentEvent["EVENT"]["URL"])) {
$arTmpCommentEvent["EVENT"]["URL"] = str_replace("#GROUPS_PATH#", COption::GetOptionString("socialnetwork", "workgroups_page", "/workgroups/", SITE_ID), $arTmpCommentEvent["EVENT"]["URL"]);
}
$arFields2Cache = array("ID", "SOURCE_ID", "EVENT_ID", "USER_ID", "LOG_DATE", "RATING_TYPE_ID", "RATING_ENTITY_ID", "URL");
foreach ($arTmpCommentEvent["EVENT"] as $field => $value) {
if (!in_array($field, $arFields2Cache)) {
unset($arTmpCommentEvent["EVENT"][$field]);
}
}
}
if (isset($arTmpCommentEvent["CREATED_BY"]) && is_array($arTmpCommentEvent["CREATED_BY"])) {
$arFields2Cache = array("TOOLTIP_FIELDS", "FORMATTED", "URL");
foreach ($arTmpCommentEvent["CREATED_BY"] as $field => $value) {
if (!in_array($field, $arFields2Cache)) {
unset($arTmpCommentEvent["CREATED_BY"][$field]);
}
}
if (isset($arTmpCommentEvent["CREATED_BY"]["TOOLTIP_FIELDS"]) && is_array($arTmpCommentEvent["CREATED_BY"]["TOOLTIP_FIELDS"])) {
$arFields2Cache = array("ID", "PATH_TO_SONET_USER_PROFILE", "NAME", "LAST_NAME", "SECOND_NAME", "LOGIN", "EMAIL");
foreach ($arTmpCommentEvent["CREATED_BY"]["TOOLTIP_FIELDS"] as $field => $value) {
if (!in_array($field, $arFields2Cache)) {
unset($arTmpCommentEvent["CREATED_BY"]["TOOLTIP_FIELDS"][$field]);
}
}
}
}
}
foreach ($arTmpCommentEvent["EVENT"] as $key => $value) {
if (strpos($key, "~") === 0) {
unset($arTmpCommentEvent["EVENT"][$key]);
}
}
return $arTmpCommentEvent;
//.........这里部分代码省略.........
示例4: urlencode
$arRecord[$key] .= '<a href="/bitrix/tools/bizproc_show_file.php?bp_id=' . $arParams['BP_ID'] . '&iblock_id=' . $arParams['BLOCK_ID'] . '&f=' . urlencode($key) . '&i=' . $file['ID'] . '">' . htmlspecialcharsbx($file['ORIGINAL_NAME']) . '</a>';
}
}
}
if (is_array($arRecord[$key])) {
$ar = $arRecord[$key];
$arRecord[$key] = "";
foreach ($ar as $val) {
if (strlen($arRecord[$key]) > 0) {
$arRecord[$key] .= ", ";
}
$arRecord[$key] .= $val;
}
}
if (CheckDateTime($arRecord[$key])) {
$arRecord[$key] = FormatDateFromDB($arRecord[$key]);
}
}
$arResult["BP"] = $arRecord;
} else {
$arResult["FatalErrorMessage"] .= GetMessage("BPWC_WLC_WRONG_BP") . ". ";
}
}
if (strlen($arResult["FatalErrorMessage"]) <= 0) {
$arCurrentUserGroups = $GLOBALS["USER"]->GetUserGroupArray();
if ("user_" . $GLOBALS["USER"]->GetID() == $arResult["BP"]["CREATED_BY"]) {
$arCurrentUserGroups[] = "author";
}
$documentId = array("bizproc", "CBPVirtualDocument", $arResult["BP"]["ID"]);
$arDocumentStates = CBPDocument::GetDocumentStates($documentType, $documentId);
foreach ($arDocumentStates as $arDocumentState) {
示例5: FormatDateFromDB
$data["CREATED_BY"] = "[" . $data["CREATED_BY"] . "] " . $data["CREATED_USER_NAME"];
}
if (isset($data["MODIFIED_BY"])) {
$data["MODIFIED_BY"] = "[" . $data["MODIFIED_BY"] . "] " . $data["USER_NAME"];
}
if (isset($data["ACTIVE_FROM"])) {
$data['ACTIVE_FROM'] = FormatDateFromDB($data['ACTIVE_FROM']);
}
if (isset($data["ACTIVE_TO"])) {
$data['ACTIVE_TO'] = FormatDateFromDB($data['ACTIVE_TO']);
}
if (isset($data["DATE_CREATE"])) {
$data['DATE_CREATE'] = FormatDateFromDB($data['DATE_CREATE']);
}
if (isset($data["TIMESTAMP_X"])) {
$data['TIMESTAMP_X'] = FormatDateFromDB($data['TIMESTAMP_X']);
}
if (CModule::IncludeModule("bizproc")) {
$documentStates = CBPDocument::GetDocumentStates(BizProcDocument::generateDocumentComplexType($arIBlock["IBLOCK_TYPE_ID"], $arIBlock["ID"]), BizProcDocument::getDocumentComplexId($arIBlock["IBLOCK_TYPE_ID"], $data["ID"]));
if ($arResult["PROCESSES"] && $arResult["USE_COMMENTS"]) {
if (!empty($documentStates)) {
$stateTemporary = current($documentStates);
$data["WORKFLOW_ID"] = $stateTemporary["ID"];
} else {
$data["WORKFLOW_ID"] = '';
}
}
}
$arUserGroupsForBPTmp = $arUserGroupsForBP;
if ($USER->GetID() == $data["CREATED_BY"]) {
$arUserGroupsForBPTmp[] = "Author";
示例6: GetMessage
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
$bHasTitle = true;
if (strlen($arResult['MEETING']['TITLE']) <= 0) {
$arResult['MEETING']['TITLE'] = GetMessage('ME_TITLE_DEFAULT');
$bHasTitle = false;
}
$tdef = htmlspecialcharsbx(CUtil::JSEscape(GetMessage('ME_TITLE_DEFAULT')));
if ($arResult['MEETING']['DATE_START'] && MakeTimeStamp($arResult['MEETING']['DATE_START']) > 0) {
$date = MakeTimeStamp($arResult['MEETING']['DATE_START']);
$date_date = FormatDateFromDB(ConvertTimeStamp($date, 'SHORT'), 'SHORT');
$date_time = FormatDate(IsAmPmMode() ? 'h:i a' : 'H:i', $date);
} else {
$date = $date_date = $date_time = '';
}
$duration = intval($arResult['MEETING']['DURATION']);
$duration_coef = 60;
if ($duration % 3600 == 0) {
$duration_coef = 3600;
}
$duration = intval($duration / $duration_coef);
$keeper = 0;
foreach ($arResult['MEETING']['USERS'] as $USER_ID => $USER_ROLE) {
if ($USER_ROLE == CMeeting::ROLE_KEEPER) {
$keeper = $USER_ID;
}
}
$this->SetViewTarget('pagetitle', 100);
示例7: while
$dbRecordsList = CBPTaskService::GetList($gridSort["sort"], $arFilter, false, $gridOptions->GetNavParams(), $arSelectFields);
while ($arRecord = $dbRecordsList->GetNext()) {
$arRecord['MODIFIED'] = FormatDateFromDB($arRecord['MODIFIED']);
$arRecord["DOCUMENT_URL"] = CBPDocument::GetDocumentAdminPage($arRecord["PARAMETERS"]["DOCUMENT_ID"]);
$arRecord["MODULE_ID"] = $arRecord["PARAMETERS"]["DOCUMENT_ID"][0];
$arRecord["ENTITY"] = $arRecord["PARAMETERS"]["DOCUMENT_ID"][1];
$arRecord["DOCUMENT_ID"] = $arRecord["PARAMETERS"]["DOCUMENT_ID"][2];
$arRecord["URL"] = array("~TASK" => CComponentEngine::MakePathFromTemplate($arParams["~TASK_EDIT_URL"], $arRecord), "TASK" => CComponentEngine::MakePathFromTemplate($arParams["TASK_EDIT_URL"], $arRecord));
if (array_key_exists("DESCRIPTION", $arRecord)) {
$arRecord["DESCRIPTION"] = nl2br($arRecord["DESCRIPTION"]);
}
if (count(array_intersect($arSelectFields, array("WORKFLOW_NAME", "WORKFLOW_STATE", "WORKFLOW_STARTED", "WORKFLOW_STARTED_BY"))) > 0) {
$arState = CBPStateService::GetWorkflowState($arRecord["WORKFLOW_ID"]);
$arRecord["WORKFLOW_NAME"] = $arState["TEMPLATE_NAME"];
$arRecord["WORKFLOW_STATE"] = $arState["STATE_TITLE"];
$arRecord["WORKFLOW_STARTED"] = FormatDateFromDB($arState["STARTED_FORMATTED"]);
$arRecord["WORKFLOW_STARTED_BY"] = "";
if (intval($arState["STARTED_BY"]) > 0) {
$dbUserTmp = CUser::GetByID($arState["STARTED_BY"]);
$arUserTmp = $dbUserTmp->GetNext();
$arRecord["WORKFLOW_STARTED_BY"] = CUser::FormatName($arParams["NAME_TEMPLATE"], $arUserTmp, true);
$arRecord["WORKFLOW_STARTED_BY"] .= " [" . $arState["STARTED_BY"] . "]";
}
}
$aActions = array(array("ICONCLASS" => "edit", "DEFAULT" => true, "TEXT" => GetMessage("BPTL_C_DETAIL"), "ONCLICK" => "window.location='" . $arRecord["URL"]["TASK"] . "';"));
if (strlen($arRecord["DOCUMENT_URL"]) > 0) {
$aActions[] = array("ICONCLASS" => "", "DEFAULT" => false, "TEXT" => GetMessage("BPTL_C_DOCUMENT"), "ONCLICK" => "window.open('" . $arRecord["DOCUMENT_URL"] . "');");
}
$arResult["RECORDS"][] = array("data" => $arRecord, "actions" => $aActions, "columns" => $aCols, "editable" => false);
}
$arResult["ROWS_COUNT"] = $dbRecordsList->SelectedRowsCount();
示例8: foreach
<ul class="bx-mylist-form-results">
<?php
$i = 0;
foreach ($arResult['RESULTS'][$FORM_ID] as $arRes) {
?>
<li class="bx-mylist-row-<?php
echo $i++ % 2;
?>
"><div class="bx-mylist-form-status"><span class="<?php
echo $arRes["STATUS_CSS"];
?>
"><?php
echo $arRes["STATUS_TITLE"];
?>
</span></div> <div class="bx-mylist-form-data"><span class="bx-mylist-form-date intranet-date"><?php
echo FormatDateFromDB($arRes['DATE_CREATE'], 'SHORT');
?>
</span> <a href="<?php
echo $arRes['__LINK'];
?>
"><?php
echo GetMessage('FRLM_RESULT') . $arRes['ID'];
echo $arRes['__TITLE'] ? ': ' . htmlspecialcharsbx($arRes['__TITLE']) : '';
?>
</a></div></li>
<?php
}
?>
</ul>
<?php
if ($arForm['__LINK']) {
示例9: trim
if (array_key_exists("NAME_LIST_FORMATTED", $arParams) && strlen(trim($arParams['NAME_LIST_FORMATTED'])) > 0) {
$arResult["User"]["NAME_FORMATTED"] = trim($arParams['NAME_LIST_FORMATTED']);
} else {
$arResult["User"]["NAME_FORMATTED"] = CUser::FormatName($arParams['NAME_TEMPLATE'], $arResult["User"], $bUseLogin);
}
if ($bSocialNetwork) {
$arResult["User"]["HTML_ID"] = $arParams["HTML_ID"];
}
if (strlen($arParams["HREF"]) > 0) {
$arResult["User"]["HREF"] = $arParams["~HREF"];
}
$arResult["bSocialNetwork"] = $bSocialNetwork;
if (strlen($arParams["DESCRIPTION"]) > 0) {
$arResult["User"]["NAME_DESCRIPTION"] = $arParams["~DESCRIPTION"];
if (CheckDateTime($arResult["User"]["NAME_DESCRIPTION"])) {
$arResult["User"]["NAME_DESCRIPTION"] = FormatDateFromDB($arResult["User"]["NAME_DESCRIPTION"]);
}
}
} elseif ($arParams['AJAX_CALL'] == 'INFO') {
$APPLICATION->RestartBuffer();
while (@ob_end_clean()) {
}
header('Content-Type: application/x-javascript; charset=' . LANG_CHARSET);
echo CUtil::PhpToJsObject(array('RESULT' => $arResult));
die;
}
if ($arParams["AJAX_ONLY"] != "Y") {
ob_start();
$this->IncludeComponentTemplate();
$sReturn = ob_get_contents();
if ($arParams["DO_RETURN"] == "Y") {
示例10: formatDate
public function formatDate($rawDate, $format = 'FULL')
{
return FormatDateFromDB($rawDate, $format);
}
示例11: addLiveComment
/**
* Use component main.post.list to work with LiveFeed
* @param int $commentId Comment ID which needs to send.
* @param array $arParams Array of settings (DATE_TIME_FORMAT, SHOW_RATING, PATH_TO_USER, AVATAR_SIZE, NAME_TEMPLATE, SHOW_LOGIN)
* @return string
*/
public static function addLiveComment($commentId = 0, $arParams = array())
{
$res = "";
if ($commentId > 0 && CModule::IncludeModule("pull") && \CPullOptions::GetNginxStatus() && ($comment = CBlogComment::GetByID($commentId)) && ($arPost = CBlogPost::GetByID($comment["POST_ID"]))) {
global $DB, $APPLICATION;
$arParams["DATE_TIME_FORMAT"] = isset($arParams["DATE_TIME_FORMAT"]) ? $arParams["DATE_TIME_FORMAT"] : $DB->DateFormatToPHP(CSite::GetDateFormat("FULL"));
$arParams["SHOW_RATING"] = $arParams["SHOW_RATING"] == "N" ? "N" : "Y";
$arParams["PATH_TO_USER"] = isset($arParams["PATH_TO_USER"]) ? $arParams["PATH_TO_USER"] : '';
$arParams["AVATAR_SIZE_COMMENT"] = $arParams["AVATAR_SIZE_COMMENT"] > 0 ? $arParams["AVATAR_SIZE_COMMENT"] : ($arParams["AVATAR_SIZE"] > $arParams["AVATAR_SIZE"] ? $arParams["AVATAR_SIZE"] : 58);
$arParams["NAME_TEMPLATE"] = isset($arParams["NAME_TEMPLATE"]) ? $arParams["NAME_TEMPLATE"] : CSite::GetNameFormat();
$arParams["SHOW_LOGIN"] = $arParams["SHOW_LOGIN"] == "N" ? "N" : "Y";
$comment["DateFormated"] = FormatDateFromDB($comment["DATE_CREATE"], $arParams["DATE_TIME_FORMAT"], true);
$timestamp = MakeTimeStamp($comment["DATE_CREATE"]);
if (strcasecmp(LANGUAGE_ID, 'EN') !== 0 && strcasecmp(LANGUAGE_ID, 'DE') !== 0) {
$comment["DateFormated"] = ToLower($comment["DateFormated"]);
}
$comment["UF"] = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFields("BLOG_COMMENT", $commentId, LANGUAGE_ID);
$arAuthor = CBlogUser::GetUserInfo($comment["AUTHOR_ID"], $arParams["PATH_TO_USER"], array("AVATAR_SIZE_COMMENT" => $arParams["AVATAR_SIZE_COMMENT"]));
if (intval($arAuthor["PERSONAL_PHOTO"]) > 0) {
$image_resize = CFile::ResizeImageGet($arAuthor["PERSONAL_PHOTO"], array("width" => $arParams["AVATAR_SIZE_COMMENT"], "height" => $arParams["AVATAR_SIZE_COMMENT"]), BX_RESIZE_IMAGE_EXACT);
$arAuthor["PERSONAL_PHOTO_RESIZED"] = array("src" => $image_resize["src"]);
}
$p = new blogTextParser(false, '');
$ufCode = "UF_BLOG_COMMENT_FILE";
if (is_array($comment["UF"][$ufCode])) {
$p->arUserfields = array($ufCode => array_merge($comment["UF"][$ufCode], array("TAG" => "DOCUMENT ID")));
}
$arAllow = array("HTML" => "N", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "QUOTE" => "Y", "CODE" => "Y", "FONT" => "Y", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "N", "VIDEO" => "Y", "SHORT_ANCHOR" => "Y");
$arParserParams = array("imageWidth" => 800, "imageHeight" => 800);
$comment["TextFormated"] = $p->convert($comment["POST_TEXT"], false, array(), $arAllow, $arParserParams);
$p->bMobile = true;
$comment["TextFormatedMobile"] = $p->convert($comment["POST_TEXT"], false, array(), $arAllow, $arParserParams);
$comment["TextFormatedJS"] = CUtil::JSEscape(htmlspecialcharsBack($comment["POST_TEXT"]));
$comment["TITLE"] = CUtil::JSEscape(htmlspecialcharsBack($comment["TITLE"]));
$eventHandlerID = AddEventHandler("main", "system.field.view.file", array("CSocNetLogTools", "logUFfileShow"));
$res = $APPLICATION->IncludeComponent("bitrix:main.post.list", "", array("TEMPLATE_ID" => 'BLOG_COMMENT_BG_', "RATING_TYPE_ID" => $arParams["SHOW_RATING"] == "Y" ? "BLOG_COMMENT" : "", "ENTITY_XML_ID" => "BLOG_" . $arPost["ID"], "RECORDS" => array($commentId => array("ID" => $comment["ID"], "NEW" => $arParams["FOLLOW"] != "N" && $comment["NEW"] == "Y" ? "Y" : "N", "APPROVED" => $comment["PUBLISH_STATUS"] == BLOG_PUBLISH_STATUS_PUBLISH ? "Y" : "N", "POST_TIMESTAMP" => $timestamp, "POST_TIME" => $comment["DATE_CREATE_TIME"], "POST_DATE" => $comment["DateFormated"], "AUTHOR" => array("ID" => $arAuthor["ID"], "NAME" => $arAuthor["~NAME"], "LAST_NAME" => $arAuthor["~LAST_NAME"], "SECOND_NAME" => $arAuthor["~SECOND_NAME"], "AVATAR" => $arAuthor["PERSONAL_PHOTO_resized"]["src"]), "FILES" => false, "UF" => $comment["UF"], "~POST_MESSAGE_TEXT" => $comment["POST_TEXT"], "WEB" => array("POST_TIME" => $comment["DATE_CREATE_TIME"], "POST_DATE" => $comment["DateFormated"], "CLASSNAME" => "", "POST_MESSAGE_TEXT" => $comment["TextFormated"], "AFTER" => <<<HTML
<script>top.text{$commentId} = text{$commentId} = '{$comment["TextFormatedJS"]}';top.title{$commentId} = title{$commentId} = '{$comment["TITLE"]}';top.arComFiles{$commentId} = [];</script>
HTML
), "MOBILE" => array("POST_TIME" => $comment["DATE_CREATE_TIME"], "POST_DATE" => $comment["DateFormated"], "CLASSNAME" => "", "POST_MESSAGE_TEXT" => $comment["TextFormatedMobile"]))), "NAV_STRING" => "", "NAV_RESULT" => "", "PREORDER" => "N", "RIGHTS" => array("MODERATE" => "N", "EDIT" => "N", "DELETE" => "N"), "VISIBLE_RECORDS_COUNT" => 1, "ERROR_MESSAGE" => "", "OK_MESSAGE" => "", "RESULT" => $commentId, "PUSH&PULL" => array("ACTION" => "REPLY", "ID" => $commentId), "MODE" => "PULL_MESSAGE", "VIEW_URL" => "", "EDIT_URL" => "", "MODERATE_URL" => "", "DELETE_URL" => "", "AUTHOR_URL" => "", "AVATAR_SIZE" => $arParams["AVATAR_SIZE_COMMENT"], "NAME_TEMPLATE" => $arParams["NAME_TEMPLATE"], "SHOW_LOGIN" => $arParams["SHOW_LOGIN"], "DATE_TIME_FORMAT" => "", "LAZYLOAD" => "", "NOTIFY_TAG" => "", "NOTIFY_TEXT" => "", "SHOW_MINIMIZED" => "Y", "SHOW_POST_FORM" => "", "IMAGE_SIZE" => "", "mfi" => ""), array(), null);
if ($eventHandlerID !== false && intval($eventHandlerID) > 0) {
RemoveEventHandler('main', 'system.field.view.file', $eventHandlerID);
}
}
return $res;
}
示例12: FormatDateFromDB
}
?>
></span>
<span class="timeman-comment-body">
<div class="timeman-comment-header">
<span class="timeman-comment-createdby">
<a href="<?php
echo $res["AUTHOR_URL"];
?>
"><?php
echo $res["AUTHOR_NAME"];
?>
</a>
</span>
<span class="timeman-comment-time"><?php
echo FormatDateFromDB($res["POST_DATE"]);
?>
</span>
</div>
<div class="timeman-comment-content">
<div class="timeman-message-full timeman-message-show">
<?php
echo $res["POST_MESSAGE_HTML"];
?>
</div>
</div>
</span>
</div>
<?php
}
?>
示例13: GetMessage
$arRecord["MODULE_ID"] = $arRecord["PARAMETERS"]["DOCUMENT_ID"][0];
$arRecord["ENTITY"] = $arRecord["PARAMETERS"]["DOCUMENT_ID"][1];
$arRecord["DOCUMENT_ID"] = $arRecord["PARAMETERS"]["DOCUMENT_ID"][2];
if (empty($arRecord['DOCUMENT_NAME'])) {
$arRecord['DOCUMENT_NAME'] = GetMessage("BPATL_DOCUMENT_NAME");
}
$arRecord["URL"] = array("~TASK" => CComponentEngine::MakePathFromTemplate($arParams["~TASK_EDIT_URL"], $arRecord), "TASK" => CComponentEngine::MakePathFromTemplate($arParams["TASK_EDIT_URL"], $arRecord));
if (array_key_exists("DESCRIPTION", $arRecord)) {
$arRecord["DESCRIPTION"] = nl2br($arRecord["DESCRIPTION"]);
}
if (isset($arRecord['WORKFLOW_TEMPLATE_NAME'])) {
$arRecord["WORKFLOW_NAME"] = $arRecord["WORKFLOW_TEMPLATE_NAME"];
}
// compatibility
if (isset($arRecord['WORKFLOW_STARTED'])) {
$arRecord["WORKFLOW_STARTED"] = FormatDateFromDB($arRecord["WORKFLOW_STARTED"]);
}
if (!empty($arRecord['WORKFLOW_STARTED_BY'])) {
$tmpUserId = (int) $arRecord['WORKFLOW_STARTED_BY'];
$arRecord["WORKFLOW_STARTED_BY"] = "";
if ($tmpUserId > 0) {
$dbUserTmp = CUser::GetByID($tmpUserId);
$arUserTmp = $dbUserTmp->fetch();
$arRecord["WORKFLOW_STARTED_BY"] = CUser::FormatName($arParams["NAME_TEMPLATE"], $arUserTmp, true);
$arRecord["WORKFLOW_STARTED_BY"] .= " [" . $tmpUserId . "]";
}
}
if (!$arRecord["IS_MY"]) {
$arRecord["URL"]["TASK"] = CHTTP::urlAddParams($arRecord["URL"]["TASK"], array('USER_ID' => $targetUserId));
if (isset($arRecord['PARAMETERS']['AccessControl']) && $arRecord['PARAMETERS']['AccessControl'] == 'Y') {
$arRecord["DESCRIPTION"] = '';
示例14: GetMessage
</div>
</div>
</div>
</div>
</div>
</div><?php
}
?>
<table cellspacing="0" class="bx-group-layout">
<tr>
<td class="bx-group-layout-column bx-group-layout-left-column"><?php
echo GetMessage("SONET_C6_CREATED");
?>
:</td>
<td class="bx-group-layout-column bx-group-layout-right-column"><?php
echo FormatDateFromDB($arResult["Group"]["DATE_CREATE"], $arParams["DATE_TIME_FORMAT"], true);
?>
</td>
</tr>
<tr>
<td class="bx-group-layout-column bx-group-layout-left-column"><?php
echo GetMessage("SONET_C6_NMEM");
?>
:</td>
<td class="bx-group-layout-column bx-group-layout-right-column"><?php
echo $arResult["Group"]["NUMBER_OF_MEMBERS"];
?>
</td>
</tr>
<tr>
<td class="bx-group-layout-column bx-group-layout-left-column"><?php
示例15: foreach
if (!empty($arNextHistory)) {
$iNextHistoryId = $arNextHistory['ID'];
}
$arResult['ELEMENT'] = $arHistoryResult['DOCUMENT']['FIELDS'];
$arResult['ELEMENT']['~DETAIL_TEXT'] = $arResult['ELEMENT']['DETAIL_TEXT'];
if (is_array($arHistoryResult['DOCUMENT']['PROPERTIES']['IMAGES']['VALUE'])) {
foreach ($arHistoryResult['DOCUMENT']['PROPERTIES']['IMAGES']['VALUE'] as $_sImg) {
$arResult['ELEMENT']['IMAGES'][strtolower(bx_basename($_sImg))] = $_sImg;
}
}
$arParams['ELEMENT_ID'] = $arHistoryResult['DOCUMENT']['FIELDS']['ID'];
$rsUser = CUser::GetByID($arHistoryResult['USER_ID']);
$arUser = $rsUser->Fetch();
$arResult['VERSION'] = array();
$arResult['VERSION']['USER_LOGIN'] = CWikiUtils::GetUserLogin($arUser, $arParams["NAME_TEMPLATE"]);
$arResult['VERSION']['MODIFIED'] = FormatDateFromDB($arHistoryResult['MODIFIED']);
if ($iCurHistoryId != $historyId) {
$arResult['VERSION']['CUR_LINK'] = CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_POST'], array('wiki_name' => urlencode($arParams['ELEMENT_NAME']), 'group_id' => CWikiSocnet::$iSocNetId)), array('oldid' => $iCurHistoryId));
}
if (!empty($iPrevHistoryId)) {
$arResult['VERSION']['PREV_LINK'] = CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_POST'], array('wiki_name' => urlencode($arParams['ELEMENT_NAME']), 'group_id' => CWikiSocnet::$iSocNetId)), array('oldid' => $iPrevHistoryId));
}
if (!empty($iNextHistoryId)) {
$arResult['VERSION']['NEXT_LINK'] = CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_POST'], array('wiki_name' => urlencode($arParams['ELEMENT_NAME']), 'group_id' => CWikiSocnet::$iSocNetId)), array('oldid' => $iNextHistoryId));
}
$arHp = array('oldid' => $historyId, 'sessid' => bitrix_sessid());
if ($arParams['IN_COMPLEX'] == 'Y' && $arParams['SEF_MODE'] == 'N') {
$arHp[$arParams['OPER_VAR']] = 'history';
}
$arResult['VERSION']['CANCEL_LINK'] = CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_HISTORY'], array('wiki_name' => urlencode($arParams['ELEMENT_NAME']), 'group_id' => CWikiSocnet::$iSocNetId)), $arHp);
}