本文整理汇总了PHP中CSocNetLogTools::FormatEvent_FillTooltip方法的典型用法代码示例。如果您正苦于以下问题:PHP CSocNetLogTools::FormatEvent_FillTooltip方法的具体用法?PHP CSocNetLogTools::FormatEvent_FillTooltip怎么用?PHP CSocNetLogTools::FormatEvent_FillTooltip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSocNetLogTools
的用法示例。
在下文中一共展示了CSocNetLogTools::FormatEvent_FillTooltip方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: FormatEvent_FillTooltip
public static function FormatEvent_FillTooltip($arFields, $arParams)
{
return CSocNetLogTools::FormatEvent_FillTooltip($arFields, $arParams);
}
示例2: FormatEvent_System
function FormatEvent_System($arFields, $arParams, $bMail = false)
{
if ($bMail && strlen($arFields["MAIL_LANGUAGE_ID"]) > 0) {
IncludeModuleLangFile(__FILE__, $arFields["MAIL_LANGUAGE_ID"]);
}
$arResult = array("EVENT" => $arFields, "CREATED_BY" => array(), "ENTITY" => array(), "EVENT_FORMATTED" => array());
if (intval($arFields["ENTITY_ID"]) > 0) {
$suffix = is_array($GLOBALS["arExtranetGroupID"]) && in_array($arFields["ENTITY_ID"], $GLOBALS["arExtranetGroupID"]) ? GetMessage("SONET_LOG_EXTRANET_SUFFIX") : "";
if ($bMail) {
$arResult["ENTITY"]["FORMATTED"] = $arFields["GROUP_NAME"] . $suffix;
$arResult["ENTITY"]["TYPE_MAIL"] = GetMessage("SONET_GL_EVENT_ENTITY_G");
} elseif (strpos($arFields["MESSAGE"], ",") > 0) {
$arResult["ENTITY"] = CSocNetLogTools::FormatEvent_GetEntity($arFields, $arParams, false);
}
}
if (in_array($arFields["TITLE"], array("moderate", "unmoderate", "join", "unjoin"))) {
if (strpos($arFields["MESSAGE"], ",") !== false) {
$arResult["CREATED_BY"] = false;
$arGroup = array("IMAGE_ID" => $arFields["GROUP_IMAGE_ID"]);
$arResult["AVATAR_SRC"] = CSocNetLogTools::FormatEvent_CreateAvatarGroup($arGroup, $arParams);
// group avatar
} else {
$suffix = is_array($GLOBALS["arExtranetUserID"]) && in_array($arFields["MESSAGE"], $GLOBALS["arExtranetUserID"]) ? GetMessage("SONET_LOG_EXTRANET_SUFFIX") : "";
$dbUser = CUser::GetByID($arFields["MESSAGE"]);
if ($arUser = $dbUser->Fetch()) {
$arFieldsTooltip = array("ID" => $arUser["ID"], "NAME" => $arUser["NAME"], "LAST_NAME" => $arUser["LAST_NAME"], "SECOND_NAME" => $arUser["SECOND_NAME"], "LOGIN" => $arUser["LOGIN"]);
$oldNameTemplate = $arParams["NAME_TEMPLATE"];
$arParams["NAME_TEMPLATE"] .= $suffix;
$arResult["CREATED_BY"]["TOOLTIP_FIELDS"] = CSocNetLogTools::FormatEvent_FillTooltip($arFieldsTooltip, $arParams);
$arParams["NAME_TEMPLATE"] = $oldNameTemplate;
if (!$bMail) {
$arResult["AVATAR_SRC"] = CSocNetLogTools::FormatEvent_CreateAvatar($arUser, $arParams, "");
}
}
}
} else {
$suffix = is_array($GLOBALS["arExtranetUserID"]) && in_array($arFields["USER_ID"], $GLOBALS["arExtranetUserID"]) ? GetMessage("SONET_LOG_EXTRANET_SUFFIX") : "";
$arFieldsTooltip = array("ID" => $arFields["USER_ID"], "NAME" => $arFields["~CREATED_BY_NAME"], "LAST_NAME" => $arFields["~CREATED_BY_LAST_NAME"], "SECOND_NAME" => $arFields["~CREATED_BY_SECOND_NAME"], "LOGIN" => $arFields["~CREATED_BY_LOGIN"]);
$oldNameTemplate = $arParams["NAME_TEMPLATE"];
$arParams["NAME_TEMPLATE"] .= $suffix;
$arResult["CREATED_BY"]["TOOLTIP_FIELDS"] = CSocNetLogTools::FormatEvent_FillTooltip($arFieldsTooltip, $arParams);
$arParams["NAME_TEMPLATE"] = $oldNameTemplate;
if (!$bMail) {
$arResult["AVATAR_SRC"] = CSocNetLogTools::FormatEvent_CreateAvatar($arFields, $arParams, "CREATED_BY_");
}
}
if (strlen($arFields["MESSAGE"]) > 0) {
$arUsersID = explode(",", $arFields["MESSAGE"]);
$bFirst = true;
$count = 0;
$user_tmp = "";
if ($bMail) {
$dbUser = CUser::GetList($by = "last_name", $order = "asc", array("ID" => implode(" | ", $arUsersID)));
while ($arUser = $dbUser->Fetch()) {
$suffix = is_array($GLOBALS["arExtranetUserID"]) && in_array($arUser["ID"], $GLOBALS["arExtranetUserID"]) ? GetMessage("SONET_LOG_EXTRANET_SUFFIX") : "";
$count++;
if (!$bFirst) {
$user_tmp .= ", ";
}
if (strlen($arUser["NAME"]) > 0 || strlen($arUser["LAST_NAME"]) > 0) {
$user_tmp .= $arUser["NAME"] . " " . $arUser["LAST_NAME"] . $suffix;
} else {
$user_tmp .= $arUser["LOGIN"] . $suffix;
}
$bFirst = false;
}
} else {
$ajax_page = $GLOBALS["APPLICATION"]->GetCurPageParam("", array("bxajaxid", "logout"));
$dbUser = CUser::GetList($by = "last_name", $order = "asc", array("ID" => implode(" | ", $arUsersID)), array("FIELDS" => array("ID", "NAME", "LAST_NAME", "SECOND_NAME", "LOGIN", "PERSONAL_GENDER")));
while ($arUser = $dbUser->Fetch()) {
if (defined("BX_COMP_MANAGED_CACHE")) {
$GLOBALS["CACHE_MANAGER"]->RegisterTag("USER_NAME_" . intval($arUser["ID"]));
}
$suffix = is_array($GLOBALS["arExtranetUserID"]) && in_array($arUser["ID"], $GLOBALS["arExtranetUserID"]) ? GetMessage("SONET_LOG_EXTRANET_SUFFIX") : "";
$count++;
if (!$bFirst) {
$user_tmp .= ", ";
}
$oldNameTemplate = $arParams["NAME_TEMPLATE"];
$arParams["NAME_TEMPLATE"] .= $suffix;
$anchor_id = RandString(8);
if ($arParams["MOBILE"] == "Y") {
$user_tmp .= '<a href="' . str_replace(array("#user_id#", "#USER_ID#", "#id#", "#ID#"), $arUser["ID"], $arParams["~PATH_TO_USER"]) . '">' . CUser::FormatName($arParams["NAME_TEMPLATE"], $arUser, $arParams["SHOW_LOGIN"] != "N" ? true : false) . '</a>';
} else {
$user_tmp .= '<a class="" id="anchor_' . $anchor_id . '" href="' . str_replace(array("#user_id#", "#USER_ID#", "#id#", "#ID#"), $arUser["ID"], $arParams["~PATH_TO_USER"]) . '">' . CUser::FormatName($arParams["NAME_TEMPLATE"], $arUser, $arParams["SHOW_LOGIN"] != "N" ? true : false) . '</a>';
$user_tmp .= '<script type="text/javascript">';
$user_tmp .= 'BX.tooltip(' . $arUser["ID"] . ', "anchor_' . $anchor_id . '", "' . CUtil::JSEscape($ajax_page) . '");';
$user_tmp .= '</script>';
}
$arParams["NAME_TEMPLATE"] = $oldNameTemplate;
$bFirst = false;
$arLastUser = $arUser;
}
}
}
if ($bMail) {
$title_tmp = GetMessage("SONET_GL_EVENT_TITLE_SYSTEM_" . strtoupper($arFields["TITLE"]) . "_" . ($count > 1 ? "2" : "1") . "_MAIL");
} else {
if (in_array($arFields["TITLE"], array("moderate", "unmoderate", "join", "unjoin"))) {
if ($count == 1 && $arLastUser) {
//.........这里部分代码省略.........