本文整理汇总了PHP中CSocNetLogTools::GetAvailableGroups方法的典型用法代码示例。如果您正苦于以下问题:PHP CSocNetLogTools::GetAvailableGroups方法的具体用法?PHP CSocNetLogTools::GetAvailableGroups怎么用?PHP CSocNetLogTools::GetAvailableGroups使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSocNetLogTools
的用法示例。
在下文中一共展示了CSocNetLogTools::GetAvailableGroups方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __SLEGetLogRecord
//.........这里部分代码省略.........
$arEvent["FIELDS_FORMATTED"]["LOG_UPDATE_DAY"] = ConvertTimeStamp(MakeTimeStamp($arEvent["LOG_UPDATE"]), "SHORT");
$arEvent["FIELDS_FORMATTED"]["COMMENTS_COUNT"] = $arEvent["COMMENTS_COUNT"];
$arEvent["FIELDS_FORMATTED"]["TMP_ID"] = $arEvent["TMP_ID"];
$arEvent["FIELDS_FORMATTED"]["DATETIME_FORMATTED"] = $dateTimeFormated;
$arCommentEvent = CSocNetLogTools::FindLogCommentEventByLogEventID($arEvent["EVENT_ID"]);
if (!array_key_exists("HAS_COMMENTS", $arEvent["FIELDS_FORMATTED"]) || $arEvent["FIELDS_FORMATTED"]["HAS_COMMENTS"] != "N") {
$arEvent["FIELDS_FORMATTED"]["HAS_COMMENTS"] = $arCommentEvent && (!array_key_exists("ENABLE_COMMENTS", $arEvent) || $arEvent["ENABLE_COMMENTS"] != "N") ? "Y" : "N";
}
}
}
if (is_object($cache)) {
$arCacheData = array("FIELDS_FORMATTED" => $arEvent["FIELDS_FORMATTED"]);
$cache->EndDataCache($arCacheData);
if (defined("BX_COMP_MANAGED_CACHE")) {
$GLOBALS["CACHE_MANAGER"]->EndTagCache();
}
}
}
if ($bEmpty) {
return false;
}
$feature = CSocNetLogTools::FindFeatureByEventID($arEvent["FIELDS_FORMATTED"]["EVENT"]["EVENT_ID"]);
if ($feature && (!array_key_exists($feature, $arSocNetFeaturesSettings) || array_key_exists("allowed", $arSocNetFeaturesSettings[$feature]) && is_array($arSocNetFeaturesSettings[$feature]["allowed"]) && !in_array($arEvent["FIELDS_FORMATTED"]["EVENT"]["ENTITY_TYPE"], $arSocNetFeaturesSettings[$feature]["allowed"]))) {
return false;
}
if (!array_key_exists("COMMENTS_PARAMS", $arEvent["FIELDS_FORMATTED"])) {
$arForumMetaData = CSocNetLogTools::GetForumCommentMetaData($arEvent["FIELDS_FORMATTED"]["EVENT"]["EVENT_ID"]);
if ($arForumMetaData && $arEvent["FIELDS_FORMATTED"]["EVENT"]["SOURCE_ID"] > 0) {
$arEvent["FIELDS_FORMATTED"]["COMMENTS_PARAMS"] = array("ENTITY_TYPE" => $arForumMetaData[1], "ENTITY_XML_ID" => $arForumMetaData[0] . "_" . $arEvent["FIELDS_FORMATTED"]["EVENT"]["SOURCE_ID"], "NOTIFY_TAGS" => $arForumMetaData[2]);
} else {
$arEvent["FIELDS_FORMATTED"]["COMMENTS_PARAMS"] = array("ENTITY_TYPE" => substr(strtoupper($arEvent["FIELDS_FORMATTED"]["EVENT"]["EVENT_ID"]) . "_" . $arEvent["FIELDS_FORMATTED"]["EVENT"]["ID"], 0, 2), "ENTITY_XML_ID" => strtoupper($arEvent["FIELDS_FORMATTED"]["EVENT"]["EVENT_ID"]) . "_" . $arEvent["FIELDS_FORMATTED"]["EVENT"]["ID"], "NOTIFY_TAGS" => "");
}
}
foreach (GetModuleEvents("socialnetwork", "OnSonetLogEntryMenuCreate", true) as $arModuleEvent) {
if (!array_key_exists("FIELDS_FORMATTED", $arEvent)) {
$arEvent["FIELDS_FORMATTED"] = array();
}
if (!array_key_exists("MENU", $arEvent["FIELDS_FORMATTED"])) {
$arEvent["FIELDS_FORMATTED"]["MENU"] = array();
}
$arMenuItems = ExecuteModuleEventEx($arModuleEvent, array($arEvent));
if (!empty($arMenuItems)) {
$arEvent["FIELDS_FORMATTED"]["MENU"] = array_merge($arEvent["FIELDS_FORMATTED"]["MENU"], $arMenuItems);
}
}
if (is_array($arCurrentUserSubscribe)) {
$arEvent["FIELDS_FORMATTED"]["TRANSPORT"] = __SLEGetTransport($arEvent, $arCurrentUserSubscribe);
}
$arCommentEvent = CSocNetLogTools::FindLogCommentEventByLogEventID($arEvent["FIELDS_FORMATTED"]["EVENT"]["EVENT_ID"]);
if (!$GLOBALS["USER"]->IsAuthorized()) {
$arEvent["FIELDS_FORMATTED"]["CAN_ADD_COMMENTS"] = "N";
} elseif ($arCommentEvent && array_key_exists("OPERATION_ADD", $arCommentEvent) && $arCommentEvent["OPERATION_ADD"] == "log_rights") {
$arEvent["FIELDS_FORMATTED"]["CAN_ADD_COMMENTS"] = CSocNetLogRights::CheckForUser($arEvent["FIELDS_FORMATTED"]["EVENT"]["ID"], $GLOBALS["USER"]->GetID()) ? "Y" : "N";
} else {
$array_key = $arEvent["FIELDS_FORMATTED"]["EVENT"]["ENTITY_TYPE"] . "_" . $arEvent["FIELDS_FORMATTED"]["EVENT"]["ENTITY_ID"] . "_" . $arEvent["FIELDS_FORMATTED"]["EVENT"]["EVENT_ID"];
if (array_key_exists($array_key, $GLOBALS["CurUserCanAddComments"])) {
$arEvent["FIELDS_FORMATTED"]["CAN_ADD_COMMENTS"] = $GLOBALS["CurUserCanAddComments"][$array_key] == "Y" && $arEvent["FIELDS_FORMATTED"]["HAS_COMMENTS"] == "Y" ? "Y" : "N";
} else {
if ($feature && $arCommentEvent && array_key_exists("OPERATION_ADD", $arCommentEvent) && strlen($arCommentEvent["OPERATION_ADD"]) > 0) {
$GLOBALS["CurUserCanAddComments"][$array_key] = CSocNetFeaturesPerms::CanPerformOperation($GLOBALS["USER"]->GetID(), $arEvent["FIELDS_FORMATTED"]["EVENT"]["ENTITY_TYPE"], $arEvent["FIELDS_FORMATTED"]["EVENT"]["ENTITY_ID"], $feature == "microblog" ? "blog" : $feature, $arCommentEvent["OPERATION_ADD"], $bCurrentUserIsAdmin) ? "Y" : "N";
} else {
$GLOBALS["CurUserCanAddComments"][$array_key] = "Y";
}
$arEvent["FIELDS_FORMATTED"]["CAN_ADD_COMMENTS"] = $GLOBALS["CurUserCanAddComments"][$array_key] == "Y" && $arEvent["FIELDS_FORMATTED"]["HAS_COMMENTS"] == "Y" ? "Y" : "N";
}
}
$arEvent["FIELDS_FORMATTED"]["FAVORITES"] = $arParams["EVENT"]["FAVORITES"];
if ($arParams["USE_FOLLOW"] == "Y") {
$arEvent["FIELDS_FORMATTED"]["EVENT"]["FOLLOW"] = $arParams["EVENT"]["FOLLOW"];
$arEvent["FIELDS_FORMATTED"]["EVENT"]["DATE_FOLLOW_X1"] = $arParams["EVENT"]["DATE_FOLLOW_X1"];
$arEvent["FIELDS_FORMATTED"]["EVENT"]["DATE_FOLLOW"] = $arParams["EVENT"]["DATE_FOLLOW"];
}
if ($arParams["CHECK_PERMISSIONS_DEST"] == "N" && !$bCurrentUserIsAdmin && is_object($GLOBALS["USER"]) && is_array($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]) && (array_key_exists("DESTINATION", $arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]) && is_array($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["DESTINATION"]) || array_key_exists("DESTINATION_CODE", $arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]) && is_array($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["DESTINATION_CODE"]))) {
$arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["DESTINATION_HIDDEN"] = 0;
$arGroupID = CSocNetLogTools::GetAvailableGroups();
if (array_key_exists("DESTINATION", $arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]) && is_array($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["DESTINATION"])) {
foreach ($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["DESTINATION"] as $key => $arDestination) {
if (array_key_exists("TYPE", $arDestination) && array_key_exists("ID", $arDestination) && ($arDestination["TYPE"] == "SG" && !in_array(intval($arDestination["ID"]), $arGroupID) || in_array($arDestination["TYPE"], array("CRMCOMPANY", "CRMLEAD", "CRMCONTACT", "CRMDEAL")) && CModule::IncludeModule("crm") && !CCrmAuthorizationHelper::CheckReadPermission(CCrmLiveFeedEntity::ResolveEntityTypeID($arDestination["TYPE"]), $arDestination["ID"]) || in_array($arDestination["TYPE"], array("DR", "D")) && $isExtranetUser == "Y" || $arDestination["TYPE"] == "U" && isset($arUserIdVisible) && is_array($arUserIdVisible) && !in_array(intval($arDestination["ID"]), $arUserIdVisible) || $arDestination["TYPE"] == "U" && isset($arDestination["IS_EXTRANET"]) && $arDestination["IS_EXTRANET"] == "Y" && isset($arAvailableExtranetUserID) && is_array($arAvailableExtranetUserID) && !in_array(intval($arDestination["ID"]), $arAvailableExtranetUserID))) {
unset($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["DESTINATION"][$key]);
$arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["DESTINATION_HIDDEN"]++;
}
}
if (intval($arParams["DESTINATION_LIMIT_SHOW"]) > 0 && count($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["DESTINATION"]) > $arParams["DESTINATION_LIMIT_SHOW"]) {
$arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["DESTINATION_MORE"] = count($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["DESTINATION"]) - $arParams["DESTINATION_LIMIT_SHOW"];
$arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["DESTINATION"] = array_slice($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["DESTINATION"], 0, $arParams["DESTINATION_LIMIT_SHOW"]);
}
} elseif (array_key_exists("DESTINATION_CODE", $arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]) && is_array($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["DESTINATION_CODE"])) {
foreach ($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["DESTINATION_CODE"] as $key => $right_tmp) {
if (preg_match('/^SG(\\d+)$/', $right_tmp, $matches) && !in_array(intval($matches[1]), $arGroupID)) {
unset($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["DESTINATION_CODE"][$key]);
$arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["DESTINATION_HIDDEN"]++;
}
}
}
}
if ($arParams["SHOW_RATING"] == "Y" && strlen($arEvent["FIELDS_FORMATTED"]["EVENT"]["RATING_TYPE_ID"]) > 0 && intval($arEvent["FIELDS_FORMATTED"]["EVENT"]["RATING_ENTITY_ID"]) > 0) {
$arEvent["FIELDS_FORMATTED"]["RATING"] = CRatings::GetRatingVoteResult($arEvent["FIELDS_FORMATTED"]["EVENT"]["RATING_TYPE_ID"], $arEvent["FIELDS_FORMATTED"]["EVENT"]["RATING_ENTITY_ID"]);
}
return $arEvent["FIELDS_FORMATTED"];
}
示例2: elseif
}
} elseif ($action == "get_more_destination") {
$arResult["arDestinations"] = false;
$log_id = intval($_REQUEST["log_id"]);
$author_id = intval($_REQUEST["author_id"]);
$iDestinationLimit = intval($_REQUEST["dlim"]);
if ($log_id > 0) {
$dbRight = CSocNetLogRights::GetList(array(), array("LOG_ID" => $log_id));
while ($arRight = $dbRight->Fetch()) {
$arRights[] = $arRight["GROUP_CODE"];
}
$arParams = array("MOBILE" => "Y", "PATH_TO_USER" => $_REQUEST["p_user"], "PATH_TO_GROUP" => $_REQUEST["p_group"], "PATH_TO_CONPANY_DEPARTMENT" => $_REQUEST["p_dep"], "PATH_TO_CRMLEAD" => $_REQUEST["p_crmlead"], "PATH_TO_CRMDEAL" => $_REQUEST["p_crmdeal"], "PATH_TO_CRMCONTACT" => $_REQUEST["p_crmcontact"], "PATH_TO_CRMCOMPANY" => $_REQUEST["p_crmcompany"], "NAME_TEMPLATE" => $_REQUEST["nt"], "SHOW_LOGIN" => $_REQUEST["sl"], "DESTINATION_LIMIT" => 100, "CHECK_PERMISSIONS_DEST" => "N", "CREATED_BY" => $author_id);
$arDestinations = CSocNetLogTools::FormatDestinationFromRights($arRights, $arParams, $iMoreCount);
if (is_array($arDestinations)) {
$iDestinationsHidden = 0;
$arGroupID = CSocNetLogTools::GetAvailableGroups();
foreach ($arDestinations as $key => $arDestination) {
if (array_key_exists("TYPE", $arDestination) && array_key_exists("ID", $arDestination) && $arDestination["TYPE"] == "SG" && !in_array(intval($arDestination["ID"]), $arGroupID)) {
unset($arDestinations[$key]);
$iDestinationsHidden++;
}
}
$arResult["arDestinations"] = array_slice($arDestinations, $iDestinationLimit);
$arResult["iDestinationsHidden"] = $iDestinationsHidden;
}
}
} elseif ($action == "send_comment_writing" && CModule::IncludeModule("pull")) {
$arParams = array("ENTITY_XML_ID" => $_REQUEST["ENTITY_XML_ID"], "NAME_TEMPLATE" => $_REQUEST["nt"], "SHOW_LOGIN" => $_REQUEST["sl"], "AVATAR_SIZE_COMMENT" => intval($as));
$rsUser = CUser::GetList($by = "last_name", $order = "asc", array("ID" => intval($GLOBALS["USER"]->GetId())), array("FIELDS" => array("ID", "NAME", "LAST_NAME", "SECOND_NAME", "LOGIN", "PERSONAL_GENDER", "PERSONAL_PHOTO")));
if ($arUser = $rsUser->Fetch()) {
$arFileTmp = CFile::ResizeImageGet($arUser["PERSONAL_PHOTO"], array("width" => $arParams["AVATAR_SIZE_COMMENT"], "height" => $arParams["AVATAR_SIZE_COMMENT"]), BX_RESIZE_IMAGE_EXACT, false);
示例3: array
}
$arResult["arUser"]["urlToPostImportant"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_POST_IMPORTANT"], array("user_id" => $arPost["AUTHOR_ID"]));
$arResult["CanComment"] = $GLOBALS["USER"]->IsAuthorized();
$arResult["dest_users"] = array();
foreach ($arResult["Post"]["SPERM"] as $key => $value) {
foreach ($value as $kk => $vv) {
$arResult["PostSrc"]["SPERM"][$key][] = $kk;
if ($key == "U") {
$arResult["dest_users"][] = $kk;
}
}
}
$arResult["PostSrc"]["HAVE_ALL_IN_ADR"] = $arResult["Post"]["HAVE_ALL_IN_ADR"];
if ($arParams["CHECK_PERMISSIONS_DEST"] == "N" && !CSocNetUser::IsCurrentUserModuleAdmin() && is_object($GLOBALS["USER"])) {
$arResult["Post"]["SPERM_HIDDEN"] = 0;
$arGroupID = CSocNetLogTools::GetAvailableGroups($arResult["bExtranetUser"] ? "Y" : "N", $arResult["bExtranetSite"] ? "Y" : "N");
if (!$arResult["bExtranetUser"] && CModule::IncludeModule("extranet")) {
$arAvailableExtranetUserID = CExtranet::GetMyGroupsUsersSimple(CExtranet::GetExtranetSiteID());
}
foreach ($arResult["Post"]["SPERM"] as $group_code => $arBlogSPerm) {
foreach ($arBlogSPerm as $entity_id => $arBlogSPermDesc) {
if ($group_code == "SG" && !in_array($entity_id, $arGroupID) || $group_code == "DR" && $arResult["bExtranetUser"] || $group_code == "U" && isset($arUserIdVisible) && is_array($arUserIdVisible) && !in_array($entity_id, $arUserIdVisible) || $group_code == "U" && isset($arBlogSPermDesc["IS_EXTRANET"]) && $arBlogSPermDesc["IS_EXTRANET"] == "Y" && isset($arAvailableExtranetUserID) && is_array($arAvailableExtranetUserID) && !in_array($entity_id, $arAvailableExtranetUserID)) {
unset($arResult["Post"]["SPERM"][$group_code][$entity_id]);
$arResult["Post"]["SPERM_HIDDEN"]++;
$arResult["PostSrc"]["SPERM_HIDDEN"][] = $group_code . $entity_id;
}
}
}
}
$arResult["PostSrc"]["SPERM_NAME"] = $arResult["Post"]["SPERM"];
if ($arResult["PostPerm"] > BLOG_PERMS_MODERATE || $arResult["PostPerm"] >= BLOG_PERMS_WRITE && $arPost["AUTHOR_ID"] == $arResult["USER_ID"]) {
示例4: __SLMGetLogRecord
//.........这里部分代码省略.........
$GLOBALS["CACHE_MANAGER"]->EndTagCache();
}
}
}
if (!array_key_exists("COMMENTS_PARAMS", $arEvent["FIELDS_FORMATTED"])) {
$entities_xml_id = array("tasks" => array("TASK", "TK", "FORUM|COMMENT"), "forum" => array("FORUM", "FM", "FORUM|COMMENT"), "photo_photo" => array("PHOTO", "PH", "FORUM|COMMENT"), "sonet" => array("SOCNET", "SC", ""), "lists_new_element" => array("WF", "WF", ""));
if (array_key_exists($arEvent["FIELDS_FORMATTED"]["EVENT"]["EVENT_ID"], $entities_xml_id) && intval($arEvent["FIELDS_FORMATTED"]["EVENT"]["SOURCE_ID"]) > 0) {
$arEvent["FIELDS_FORMATTED"]["COMMENTS_PARAMS"] = array("ENTITY_TYPE" => $entities_xml_id[$arEvent["FIELDS_FORMATTED"]["EVENT"]["EVENT_ID"]][1], "ENTITY_XML_ID" => $entities_xml_id[$arEvent["FIELDS_FORMATTED"]["EVENT"]["EVENT_ID"]][0] . "_" . $arEvent["FIELDS_FORMATTED"]["EVENT"]["SOURCE_ID"], "NOTIFY_TAGS" => $entities_xml_id[$arEvent["FIELDS_FORMATTED"]["EVENT"]["EVENT_ID"]][2]);
} else {
$arEvent["FIELDS_FORMATTED"]["COMMENTS_PARAMS"] = array("ENTITY_TYPE" => substr(strtoupper($arEvent["FIELDS_FORMATTED"]["EVENT"]["EVENT_ID"]) . "_" . $arEvent["FIELDS_FORMATTED"]["EVENT"]["ID"], 0, 2), "ENTITY_XML_ID" => strtoupper($arEvent["FIELDS_FORMATTED"]["EVENT"]["EVENT_ID"]) . "_" . $arEvent["FIELDS_FORMATTED"]["EVENT"]["ID"], "NOTIFY_TAGS" => "");
}
}
$timestamp = MakeTimeStamp(isset($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]) && isset($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["LOG_DATE_FORMAT"]) ? $arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["LOG_DATE_FORMAT"] : (isset($arParams["FIELDS_FORMATTED"]["EVENT"]["LOG_DATE_FORMAT"]) ? $arEvent["FIELDS_FORMATTED"]["EVENT"]["LOG_DATE_FORMAT"] : $arParams["EVENT"]["LOG_DATE"]));
$timeFormated = FormatDate(GetMessage("SONET_SLM_FORMAT_TIME"), $timestamp);
if (strlen($arParams["DATE_TIME_FORMAT"]) <= 0) {
$dateTimeFormated = __SMLFormatDate($timestamp);
} else {
$dateTimeFormated = FormatDate($arParams["DATE_TIME_FORMAT"] == "FULL" ? $GLOBALS["DB"]->DateFormatToPHP(str_replace(":SS", "", FORMAT_DATETIME)) : $arParams["DATE_TIME_FORMAT"], $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);
}
$arEvent["FIELDS_FORMATTED"]["LOG_TIME_FORMAT"] = $timeFormated;
if (strlen($arParams["DATE_TIME_FORMAT"]) <= 0) {
if (array_key_exists("EVENT_FORMATTED", $arEvent["FIELDS_FORMATTED"]) && is_array($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]) && array_key_exists("LOG_DATE_FORMAT", $arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"])) {
$bToday = ConvertTimeStamp(MakeTimeStamp($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["LOG_DATE_FORMAT"]), "SHORT") == ConvertTimeStamp();
if ($bToday) {
$arEvent["FIELDS_FORMATTED"]["DATETIME_FORMATTED"] = $timeFormated;
} else {
$arEvent["FIELDS_FORMATTED"]["DATETIME_FORMATTED"] = $dateTimeFormated;
}
} else {
$bToday = $arEvent["FIELDS_FORMATTED"]["LOG_DATE_DAY"] == ConvertTimeStamp();
if ($bToday) {
$arEvent["FIELDS_FORMATTED"]["DATETIME_FORMATTED"] = $timeFormated;
} else {
$arEvent["FIELDS_FORMATTED"]["DATETIME_FORMATTED"] = $dateTimeFormated;
}
}
} else {
$arFormat = array("tommorow" => "tommorow, " . GetMessage("SONET_SLM_FORMAT_TIME"), "today" => "today, " . GetMessage("SONET_SLM_FORMAT_TIME"), "yesterday" => "yesterday, " . GetMessage("SONET_SLM_FORMAT_TIME"), "" => date("Y", $timestamp) == date("Y") ? GetMessage("SONET_SLM_FORMAT_DATE") : GetMessage("SONET_SLM_FORMAT_DATE_YEAR"));
$arEvent["FIELDS_FORMATTED"]["DATETIME_FORMATTED"] = FormatDate($arFormat, $timestamp);
}
if (is_array($arEvent["FIELDS_FORMATTED"]["EVENT"])) {
if ($arCommentEvent && array_key_exists("OPERATION_ADD", $arCommentEvent) && $arCommentEvent["OPERATION_ADD"] == "log_rights") {
$arEvent["FIELDS_FORMATTED"]["CAN_ADD_COMMENTS"] = CSocNetLogRights::CheckForUser($arEvent["FIELDS_FORMATTED"]["EVENT"]["ID"], $GLOBALS["USER"]->GetID()) ? "Y" : "N";
} else {
$array_key = $arEvent["FIELDS_FORMATTED"]["EVENT"]["ENTITY_TYPE"] . "_" . $arEvent["FIELDS_FORMATTED"]["EVENT"]["ENTITY_ID"] . "_" . $arEvent["FIELDS_FORMATTED"]["EVENT"]["EVENT_ID"];
if (array_key_exists($array_key, $GLOBALS["CurUserCanAddComments"])) {
$arEvent["FIELDS_FORMATTED"]["CAN_ADD_COMMENTS"] = $GLOBALS["CurUserCanAddComments"][$array_key] == "Y" && $arEvent["FIELDS_FORMATTED"]["HAS_COMMENTS"] == "Y" ? "Y" : "N";
} else {
$feature = CSocNetLogTools::FindFeatureByEventID($arEvent["FIELDS_FORMATTED"]["EVENT"]["EVENT_ID"]);
if ($feature && $arCommentEvent && array_key_exists("OPERATION_ADD", $arCommentEvent) && strlen($arCommentEvent["OPERATION_ADD"]) > 0) {
$GLOBALS["CurUserCanAddComments"][$array_key] = CSocNetFeaturesPerms::CanPerformOperation($GLOBALS["USER"]->GetID(), $arEvent["FIELDS_FORMATTED"]["EVENT"]["ENTITY_TYPE"], $arEvent["FIELDS_FORMATTED"]["EVENT"]["ENTITY_ID"], $feature == "microblog" ? "blog" : $feature, $arCommentEvent["OPERATION_ADD"]) ? "Y" : "N";
} else {
$GLOBALS["CurUserCanAddComments"][$array_key] = "Y";
}
$arEvent["FIELDS_FORMATTED"]["CAN_ADD_COMMENTS"] = $GLOBALS["CurUserCanAddComments"][$array_key] == "Y" && $arEvent["FIELDS_FORMATTED"]["HAS_COMMENTS"] == "Y" ? "Y" : "N";
}
}
}
$arEvent["FIELDS_FORMATTED"]["FAVORITES"] = $arParams["EVENT"]["FAVORITES"];
if ($arParams["USE_FOLLOW"] == "Y") {
$arEvent["FIELDS_FORMATTED"]["EVENT"]["FOLLOW"] = $arParams["EVENT"]["FOLLOW"];
$arEvent["FIELDS_FORMATTED"]["EVENT"]["DATE_FOLLOW_X1"] = $arParams["EVENT"]["DATE_FOLLOW_X1"];
$arEvent["FIELDS_FORMATTED"]["EVENT"]["DATE_FOLLOW"] = $arParams["EVENT"]["DATE_FOLLOW"];
}
if ($arParams["CHECK_PERMISSIONS_DEST"] == "N" && is_object($GLOBALS["USER"]) && (array_key_exists("DESTINATION", $arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]) && is_array($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["DESTINATION"]) || array_key_exists("DESTINATION_CODE", $arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]) && is_array($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["DESTINATION_CODE"]))) {
$arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["DESTINATION_HIDDEN"] = 0;
$bExtranetUser = CModule::IncludeModule("extranet") && !CExtranet::IsIntranetUser();
$arGroupID = CSocNetLogTools::GetAvailableGroups($bExtranetUser ? "Y" : "N");
if (array_key_exists("DESTINATION", $arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]) && is_array($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["DESTINATION"])) {
foreach ($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["DESTINATION"] as $key => $arDestination) {
if (array_key_exists("TYPE", $arDestination) && array_key_exists("ID", $arDestination) && ($arDestination["TYPE"] == "SG" && !in_array(intval($arDestination["ID"]), $arGroupID) || $arDestination["TYPE"] == "DR" && $bExtranetUser)) {
unset($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["DESTINATION"][$key]);
$arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["DESTINATION_HIDDEN"]++;
}
}
if (intval($arParams["DESTINATION_LIMIT_SHOW"]) > 0 && count($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["DESTINATION"]) > $arParams["DESTINATION_LIMIT_SHOW"]) {
$arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["DESTINATION_MORE"] = count($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["DESTINATION"]) + $arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["DESTINATION_HIDDEN"] - $arParams["DESTINATION_LIMIT_SHOW"];
$arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["DESTINATION"] = array_slice($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["DESTINATION"], 0, $arParams["DESTINATION_LIMIT_SHOW"]);
}
}
}
if ($arParams["SHOW_RATING"] == "Y" && strlen($arEvent["FIELDS_FORMATTED"]["EVENT"]["RATING_TYPE_ID"]) > 0 && intval($arEvent["FIELDS_FORMATTED"]["EVENT"]["RATING_ENTITY_ID"]) > 0) {
$arEvent["FIELDS_FORMATTED"]["RATING"] = CRatings::GetRatingVoteResult($arEvent["FIELDS_FORMATTED"]["EVENT"]["RATING_TYPE_ID"], $arEvent["FIELDS_FORMATTED"]["EVENT"]["RATING_ENTITY_ID"]);
}
if (array_key_exists("FAVORITES_USER_ID", $arEvent) && intval($arEvent["FAVORITES_USER_ID"]) > 0) {
$arEvent["FIELDS_FORMATTED"]["FAVORITES"] = "Y";
} else {
$arEvent["FIELDS_FORMATTED"]["FAVORITES"] = "N";
}
return $arEvent["FIELDS_FORMATTED"];
}