本文整理汇总了PHP中CSocNetLogTools::FormatEvent_GetURL方法的典型用法代码示例。如果您正苦于以下问题:PHP CSocNetLogTools::FormatEvent_GetURL方法的具体用法?PHP CSocNetLogTools::FormatEvent_GetURL怎么用?PHP CSocNetLogTools::FormatEvent_GetURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSocNetLogTools
的用法示例。
在下文中一共展示了CSocNetLogTools::FormatEvent_GetURL方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: FormatComment_Data
function FormatComment_Data($arFields, $arParams, $bMail = false, $arLog = array())
{
$arResult = array("EVENT_FORMATTED" => array());
if (!CModule::IncludeModule("socialnetwork")) {
return $arResult;
}
if (in_array($arLog["ENTITY_TYPE"], array(SONET_SUBSCRIBE_ENTITY_GROUP, SONET_SUBSCRIBE_ENTITY_USER))) {
$arResult["ENTITY"] = CSocNetLogTools::FormatEvent_GetEntity($arLog, $arParams, $bMail);
}
if (!$bMail && $arParams["USE_COMMENT"] != "Y") {
$arLog["ENTITY_ID"] = $arFields["ENTITY_ID"];
$arLog["ENTITY_TYPE"] = $arFields["ENTITY_TYPE"];
}
if (!$bMail && array_key_exists("URL", $arLog) && strlen($arLog["URL"]) > 0) {
$news_tmp = '<a href="' . $arLog["URL"] . '">' . $arLog["TITLE"] . '</a>';
} else {
$news_tmp = $arLog["TITLE"];
}
$title_tmp = $bMail ? GetMessage("LFP_SOCNET_LOG_DATA_COMMENT_" . $arLog["ENTITY_TYPE"] . "_TITLE_MAIL") : GetMessage("LFP_SOCNET_LOG_DATA_COMMENT_TITLE");
$title = str_replace(array("#TITLE#", "#ENTITY#"), array($news_tmp, $bMail ? $arResult["ENTITY"]["FORMATTED"] : $arResult["ENTITY"]["FORMATTED"]["NAME"]), $title_tmp);
$arResult["EVENT_FORMATTED"] = array("TITLE" => $bMail || $arParams["USE_COMMENT"] != "Y" ? "<a href=\"asdfasdf\">" . $title . "</a>" : "", "MESSAGE" => $bMail ? $arFields["TEXT_MESSAGE"] : $arFields["MESSAGE"]);
if ($bMail) {
$url = CSocNetLogTools::FormatEvent_GetURL($arLog, true);
if (strlen($url) > 0) {
$arResult["EVENT_FORMATTED"]["URL"] = $url;
}
} else {
$parserLog = new logTextParser(false, $arParams["PATH_TO_SMILE"]);
$arAllow = array("HTML" => "Y", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "LOG_IMG" => "N", "QUOTE" => "Y", "LOG_QUOTE" => "N", "CODE" => "Y", "LOG_CODE" => "N", "FONT" => "Y", "LOG_FONT" => "N", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "Y", "MULTIPLE_BR" => "N", "VIDEO" => "Y", "LOG_VIDEO" => "N");
$arAllow = array("HTML" => "Y", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "QUOTE" => "Y", "CODE" => "Y", "FONT" => "Y", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "N", "VIDEO" => "Y", "LOG_VIDEO" => "N");
$arResult["EVENT_FORMATTED"]["MESSAGE"] = htmlspecialcharsbx($parserLog->convert(htmlspecialcharsback($arResult["EVENT_FORMATTED"]["MESSAGE"]), array(), $arAllow));
if ($arParams["MOBILE"] != "Y" && $arParams["NEW_TEMPLATE"] != "Y") {
$arResult["EVENT_FORMATTED"]["SHORT_MESSAGE"] = $parserLog->html_cut($parserLog->convert(htmlspecialcharsback($arResult["EVENT_FORMATTED"]["MESSAGE"]), array(), $arAllow), 500);
$arResult["EVENT_FORMATTED"]["IS_MESSAGE_SHORT"] = CSocNetLogTools::FormatEvent_IsMessageShort($arResult["EVENT_FORMATTED"]["MESSAGE"], $arResult["EVENT_FORMATTED"]["SHORT_MESSAGE"]);
}
}
return $arResult;
}
示例2: FormatComment_Wiki
static function FormatComment_Wiki($arFields, $arParams, $bMail = false, $arLog = array())
{
$arResult = array("EVENT_FORMATTED" => array());
if ($bMail) {
$arResult['CREATED_BY'] = CSocNetLogTools::FormatEvent_GetCreatedBy($arFields, $arParams, $bMail);
$arResult['ENTITY'] = CSocNetLogTools::FormatEvent_GetEntity($arLog, $arParams, $bMail);
}
if (!$bMail && array_key_exists('URL', $arLog) && strlen($arLog['URL']) > 0) {
$wiki_tmp = '<a href="' . $arLog['URL'] . '">' . $arLog['TITLE'] . '</a>';
} else {
$wiki_tmp = $arLog['TITLE'];
}
$title = str_replace(array('#TITLE#', '#ENTITY#', '#CREATED_BY#'), array($wiki_tmp, $arResult['ENTITY']['FORMATTED'], $bMail ? $arResult['CREATED_BY']['FORMATTED'] : ''), $bMail ? GetMessage('WIKI_SOCNET_LOG_COMMENT_TITLE_MAIL') : GetMessage('WIKI_SOCNET_LOG_COMMENT_TITLE'));
$arResult["EVENT_FORMATTED"] = array("TITLE" => $title, "MESSAGE" => $bMail ? CSocNetTextParser::killAllTags($arFields['MESSAGE']) : $arFields['MESSAGE']);
if ($bMail) {
$url = CSocNetLogTools::FormatEvent_GetURL($arLog);
if (strlen($url) > 0) {
$arResult['EVENT_FORMATTED']['URL'] = $url;
}
} else {
static $parserLog = false;
if (CModule::IncludeModule("forum")) {
if (!$parserLog) {
$parserLog = new forumTextParser(LANGUAGE_ID);
}
$arAllow = array("HTML" => "N", "ALIGN" => "Y", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "QUOTE" => "Y", "CODE" => "Y", "FONT" => "Y", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "Y", "VIDEO" => "Y", "LOG_VIDEO" => "N", "SHORT_ANCHOR" => "Y", "USERFIELDS" => $arFields["UF"], "USER" => "Y");
$parserLog->pathToUser = $arParams["PATH_TO_USER"];
$parserLog->arUserfields = $arFields["UF"];
$arResult["EVENT_FORMATTED"]["MESSAGE"] = htmlspecialcharsbx($parserLog->convert(htmlspecialcharsback($arResult["EVENT_FORMATTED"]["MESSAGE"]), $arAllow));
} else {
if (!$parserLog) {
$parserLog = new logTextParser(false, $arParams["PATH_TO_SMILE"]);
}
$arAllow = array("HTML" => "Y", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "LOG_IMG" => "N", "QUOTE" => "Y", "LOG_QUOTE" => "N", "CODE" => "Y", "LOG_CODE" => "N", "FONT" => "Y", "LOG_FONT" => "N", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "Y", "MULTIPLE_BR" => "Y", "VIDEO" => "Y", "LOG_VIDEO" => "N");
$arResult["EVENT_FORMATTED"]["MESSAGE"] = htmlspecialcharsbx($parserLog->convert(htmlspecialcharsback($arResult["EVENT_FORMATTED"]["MESSAGE"]), array(), $arAllow));
}
if ($arParams["MOBILE"] != "Y" && $arParams["NEW_TEMPLATE"] != "Y") {
if (CModule::IncludeModule("forum")) {
$arResult["EVENT_FORMATTED"]["SHORT_MESSAGE"] = $parserLog->html_cut($parserLog->convert(htmlspecialcharsback($arResult["EVENT_FORMATTED"]["MESSAGE"]), $arAllow), 500);
} else {
$arResult["EVENT_FORMATTED"]["SHORT_MESSAGE"] = $parserLog->html_cut($parserLog->convert(htmlspecialcharsback($arResult["EVENT_FORMATTED"]["MESSAGE"]), array(), $arAllow), 500);
}
$arResult["EVENT_FORMATTED"]["IS_MESSAGE_SHORT"] = CSocNetLogTools::FormatEvent_IsMessageShort($arResult["EVENT_FORMATTED"]["MESSAGE"], $arResult["EVENT_FORMATTED"]["SHORT_MESSAGE"]);
}
}
return $arResult;
}
示例3: FormatComment_Report
public static function FormatComment_Report($arFields, $arParams, $bMail = false, $arLog = array())
{
$arResult = array("EVENT_FORMATTED" => array());
if (!CModule::IncludeModule("socialnetwork")) {
return $arResult;
}
if (!$bMail && $arParams["USE_COMMENT"] != "Y") {
$arLog["ENTITY_ID"] = $arFields["ENTITY_ID"];
$arLog["ENTITY_TYPE"] = $arFields["ENTITY_TYPE"];
}
$news_tmp = $arLog["TITLE"];
$title_tmp = GetMessage("REPORT_NEW_COMMENT") . '"' . $arLog["TITLE"] . '"' . "\n";
$title_tmp .= GetMessage("COMMENT_AUTHOR") . CUser::FormatName(CSite::GetNameFormat(false), array("NAME" => $arFields["CREATED_BY_NAME"], "LAST_NAME" => $arFields["CREATED_BY_LAST_NAME"], "SECOND_NAME" => $arFields["CREATED_BY_SECOND_NAME"], "LOGIN" => $arFields["CREATED_BY_LOGIN"]), true) . "\n";
$title_tmp .= GetMessage("COMMENT_TEXT");
$title = str_replace(array("#TITLE#", "#ENTITY#"), array($news_tmp, $bMail ? $arResult["ENTITY"]["FORMATTED"] : $arResult["ENTITY"]["FORMATTED"]["NAME"]), $title_tmp);
$arResult["EVENT_FORMATTED"] = array("TITLE" => $bMail || $arParams["USE_COMMENT"] != "Y" ? $title : "", "MESSAGE" => $bMail ? $arFields["TEXT_MESSAGE"] : $arFields["MESSAGE"]);
$arResult["ENTITY"]["TYPE_MAIL"] = GetMessage("REPORT_TITLE_FOR_MAIL");
if ($bMail) {
$reportURL = COption::GetOptionString("timeman", "WORK_REPORT_PATH", "/company/work_report.php");
if (strlen($reportURL) == 0) {
$reportURL = "/company/work_report.php";
}
$reportURL = CSocNetLogTools::FormatEvent_GetURL(array("URL" => $reportURL, "SITE_ID" => $arFields["LOG_SITE_ID"]));
if (strlen($reportURL) > 0) {
$arResult["EVENT_FORMATTED"]["URL"] = $reportURL . "#user_id=" . $arLog["ENTITY_ID"] . "&report=" . $arLog["SOURCE_ID"];
}
} else {
static $parserLog = false;
if (CModule::IncludeModule("forum")) {
$arAllow = array("HTML" => "N", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "LOG_IMG" => "N", "QUOTE" => "Y", "LOG_QUOTE" => "N", "CODE" => "Y", "LOG_CODE" => "N", "FONT" => "Y", "LOG_FONT" => "N", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "Y", "MULTIPLE_BR" => "N", "VIDEO" => "Y", "LOG_VIDEO" => "N", "USERFIELDS" => $arFields["UF"], "USER" => "Y");
if (!$parserLog) {
$parserLog = new forumTextParser(LANGUAGE_ID);
}
$parserLog->pathToUser = $parserLog->userPath = $arParams["PATH_TO_USER"];
$parserLog->bMobile = $arParams["MOBILE"] == "Y";
$arResult["EVENT_FORMATTED"]["MESSAGE"] = htmlspecialcharsbx($parserLog->convert(htmlspecialcharsback($arResult["EVENT_FORMATTED"]["MESSAGE"]), $arAllow));
} else {
$arAllow = array("HTML" => "N", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "N", "LOG_IMG" => "N", "QUOTE" => "Y", "LOG_QUOTE" => "N", "CODE" => "Y", "LOG_CODE" => "N", "FONT" => "Y", "LOG_FONT" => "N", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "Y", "MULTIPLE_BR" => "N", "VIDEO" => "Y", "LOG_VIDEO" => "N", "USERFIELDS" => $arFields["UF"]);
if (!$parserLog) {
$parserLog = new logTextParser(false, $arParams["PATH_TO_SMILE"]);
}
$arResult["EVENT_FORMATTED"]["MESSAGE"] = htmlspecialcharsbx($parserLog->convert(htmlspecialcharsback($arResult["EVENT_FORMATTED"]["MESSAGE"]), array(), $arAllow));
}
if ($arParams["MOBILE"] != "Y" && $arParams["NEW_TEMPLATE"] != "Y") {
if (CModule::IncludeModule("forum")) {
$arResult["EVENT_FORMATTED"]["SHORT_MESSAGE"] = $parserLog->html_cut($parserLog->convert(htmlspecialcharsback($arResult["EVENT_FORMATTED"]["MESSAGE"]), $arAllow), 500);
} else {
$arResult["EVENT_FORMATTED"]["SHORT_MESSAGE"] = $parserLog->html_cut($parserLog->convert(htmlspecialcharsback($arResult["EVENT_FORMATTED"]["MESSAGE"]), array(), $arAllow), 500);
}
$arResult["EVENT_FORMATTED"]["IS_MESSAGE_SHORT"] = CSocNetLogTools::FormatEvent_IsMessageShort($arResult["EVENT_FORMATTED"]["MESSAGE"], $arResult["EVENT_FORMATTED"]["SHORT_MESSAGE"]);
}
}
return $arResult;
}
示例4: FormatComment_News
function FormatComment_News($arFields, $arParams, $bMail = false, $arLog = array())
{
$arResult = array("EVENT_FORMATTED" => array());
if (!CModule::IncludeModule("socialnetwork")) {
return $arResult;
}
if ($bMail) {
$arResult["CREATED_BY"] = CSocNetLogTools::FormatEvent_GetCreatedBy($arFields, $arParams, $bMail);
$arResult["ENTITY"] = CIntranetEventHandlers::GetEntity_News($arLog, $bMail);
} elseif ($arParams["USE_COMMENT"] != "Y") {
$arLog["ENTITY_ID"] = $arFields["ENTITY_ID"];
$arLog["ENTITY_TYPE"] = $arFields["ENTITY_TYPE"];
$arResult["ENTITY"] = CIntranetEventHandlers::GetEntity_News($arLog, false);
}
if (!$bMail && array_key_exists("URL", $arLog) && strlen($arLog["URL"]) > 0) {
$news_tmp = '<a href="' . $arLog["URL"] . '">' . $arLog["TITLE"] . '</a>';
} else {
$news_tmp = $arLog["TITLE"];
}
$title_tmp = $bMail ? GetMessage("INTR_SOCNET_LOG_NEWS_COMMENT_TITLE_MAIL") : GetMessage("INTR_SOCNET_LOG_NEWS_COMMENT_TITLE");
$title = str_replace(array("#TITLE#", "#ENTITY#", "#CREATED_BY#"), array($news_tmp, $arResult["ENTITY"]["FORMATTED"], $bMail ? $arResult["CREATED_BY"]["FORMATTED"] : ""), $title_tmp);
$arResult["EVENT_FORMATTED"] = array("TITLE" => $bMail || $arParams["USE_COMMENT"] != "Y" ? $title : "", "MESSAGE" => $bMail ? $arFields["TEXT_MESSAGE"] : $arFields["MESSAGE"]);
if ($bMail) {
$url = CSocNetLogTools::FormatEvent_GetURL($arLog);
if (strlen($url) > 0) {
$arResult["EVENT_FORMATTED"]["URL"] = $url;
}
} else {
static $parserLog = false;
if (CModule::IncludeModule("forum")) {
if (!$parserLog) {
$parserLog = new forumTextParser(LANGUAGE_ID);
}
$arAllow = array("HTML" => "N", "ALIGN" => "Y", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "QUOTE" => "Y", "CODE" => "Y", "FONT" => "Y", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "Y", "VIDEO" => "Y", "LOG_VIDEO" => "N", "SHORT_ANCHOR" => "Y", "USERFIELDS" => $arFields["UF"], "USER" => "Y");
$parserLog->pathToUser = $parserLog->userPath = $arParams["PATH_TO_USER"];
$parserLog->arUserfields = $arFields["UF"];
$parserLog->bMobile = $arParams["MOBILE"] == "Y";
$arResult["EVENT_FORMATTED"]["MESSAGE"] = htmlspecialcharsbx($parserLog->convert(htmlspecialcharsback($arResult["EVENT_FORMATTED"]["MESSAGE"]), $arAllow));
} else {
if (!$parserLog) {
$parserLog = new logTextParser(false, $arParams["PATH_TO_SMILE"]);
}
$arAllow = array("HTML" => "Y", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "LOG_IMG" => "N", "QUOTE" => "Y", "LOG_QUOTE" => "N", "CODE" => "Y", "LOG_CODE" => "N", "FONT" => "Y", "LOG_FONT" => "N", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "Y", "MULTIPLE_BR" => "N", "VIDEO" => "Y", "LOG_VIDEO" => "N");
$arResult["EVENT_FORMATTED"]["MESSAGE"] = htmlspecialcharsbx($parserLog->convert(htmlspecialcharsback($arResult["EVENT_FORMATTED"]["MESSAGE"]), array(), $arAllow));
}
if ($arParams["MOBILE"] != "Y" && $arParams["NEW_TEMPLATE"] != "Y") {
if (CModule::IncludeModule("forum")) {
$arResult["EVENT_FORMATTED"]["SHORT_MESSAGE"] = $parserLog->html_cut($parserLog->convert(htmlspecialcharsback($arResult["EVENT_FORMATTED"]["MESSAGE"]), $arAllow), 500);
} else {
$arResult["EVENT_FORMATTED"]["SHORT_MESSAGE"] = $parserLog->html_cut($parserLog->convert(htmlspecialcharsback($arResult["EVENT_FORMATTED"]["MESSAGE"]), array(), $arAllow), 500);
}
$arResult["EVENT_FORMATTED"]["IS_MESSAGE_SHORT"] = CSocNetLogTools::FormatEvent_IsMessageShort($arResult["EVENT_FORMATTED"]["MESSAGE"], $arResult["EVENT_FORMATTED"]["SHORT_MESSAGE"]);
}
}
return $arResult;
}
示例5: FormatEvent_SystemFriends
function FormatEvent_SystemFriends($arFields, $arParams, $bMail = false)
{
if ($bMail && strlen($arFields["MAIL_LANGUAGE_ID"]) > 0) {
IncludeModuleLangFile(__FILE__, $arFields["MAIL_LANGUAGE_ID"]);
}
$arResult = array();
$bActiveUsers = false;
if (intval($arFields["MESSAGE"]) > 0) {
$dbUser = CUser::GetByID($arFields["MESSAGE"]);
if ($arUser = $dbUser->Fetch()) {
if (defined("BX_COMP_MANAGED_CACHE")) {
$GLOBALS["CACHE_MANAGER"]->RegisterTag("USER_NAME_" . intval($arUser["ID"]));
}
$messageUserID = $arFields["MESSAGE"];
if ($arFields["ENTITY_TYPE"] == SONET_SUBSCRIBE_ENTITY_USER && intval($arFields["ENTITY_ID"]) > 0) {
$dbUser2 = CUser::GetByID($arFields["ENTITY_ID"]);
if ($arUser2 = $dbUser2->Fetch()) {
if (defined("BX_COMP_MANAGED_CACHE")) {
$GLOBALS["CACHE_MANAGER"]->RegisterTag("USER_NAME_" . intval($arUser2["ID"]));
}
$secondUserID = $arFields["ENTITY_ID"];
$bActiveUsers = true;
}
}
}
}
if ($bActiveUsers) {
$arResult = array("EVENT" => $arFields, "CREATED_BY" => array(), "ENTITY" => array(), "EVENT_FORMATTED" => array());
$suffix = is_array($GLOBALS["arExtranetUserID"]) && in_array($secondUserID, $GLOBALS["arExtranetUserID"]) ? GetMessage("SONET_LOG_EXTRANET_SUFFIX") : "";
if ($bMail) {
if (strlen($arFields["USER_NAME"]) > 0 || strlen($arFields["USER_LAST_NAME"]) > 0) {
$arResult["ENTITY"]["FORMATTED"] = $arFields["USER_NAME"] . " " . $arFields["USER_LAST_NAME"] . $suffix;
} else {
$arResult["ENTITY"]["FORMATTED"] = $arFields["USER_LOGIN"] . $suffix;
}
$arResult["ENTITY"]["TYPE_MAIL"] = GetMessage("SONET_GL_EVENT_ENTITY_U");
} else {
$arFieldsTooltip = array("ID" => $secondUserID, "NAME" => $arFields["~USER_NAME"], "LAST_NAME" => $arFields["~USER_LAST_NAME"], "SECOND_NAME" => $arFields["~USER_SECOND_NAME"], "LOGIN" => $arFields["~USER_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, "USER_");
}
}
$suffix = is_array($GLOBALS["arExtranetUserID"]) && in_array($messageUserID, $GLOBALS["arExtranetUserID"]) ? GetMessage("SONET_LOG_EXTRANET_SUFFIX") : "";
$user_tmp = '';
if ($bMail) {
$user_tmp .= strlen($arUser["NAME"]) > 0 || strlen($arUser["LAST_NAME"]) > 0 ? $arUser["NAME"] . " " . $arUser["LAST_NAME"] . $suffix : $arUser["LOGIN"] . $suffix;
} else {
$ajax_page = $GLOBALS["APPLICATION"]->GetCurPageParam("", array("bxajaxid", "logout"));
$suffix = is_array($GLOBALS["arExtranetUserID"]) && in_array($messageUserID, $GLOBALS["arExtranetUserID"]) ? GetMessage("SONET_LOG_EXTRANET_SUFFIX") : "";
$oldNameTemplate = $arParams["NAME_TEMPLATE"];
$arParams["NAME_TEMPLATE"] .= $suffix;
$anchor_id = RandString(8);
$user_tmp .= '<span class="" id="anchor_' . $anchor_id . '">' . CUser::FormatName($arParams["NAME_TEMPLATE"], $arUser, $arParams["SHOW_LOGIN"] != "N" ? true : false) . '</span>';
$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;
}
if ($bMail) {
$title_tmp = GetMessage("SONET_GL_EVENT_TITLE_SYSTEM_FRIENDS_" . strtoupper($arFields["TITLE"]) . "_MAIL");
} else {
$title_tmp = GetMessage("SONET_GL_EVENT_TITLE_SYSTEM_FRIENDS_" . strtoupper($arFields["TITLE"]) . (strlen(trim($arFields["USER_PERSONAL_GENDER"])) > 0 ? "_" . $arFields["USER_PERSONAL_GENDER"] : ""));
$title_tmp_24 = GetMessage("SONET_GL_EVENT_TITLE_SYSTEM_FRIENDS_" . strtoupper($arFields["TITLE"]) . "_24" . (strlen(trim($arFields["USER_PERSONAL_GENDER"])) > 0 ? "_" . $arFields["USER_PERSONAL_GENDER"] : ""));
}
$title = str_replace(array("#USER_NAME#", "#ENTITY#"), array($user_tmp, $arResult["ENTITY"]["FORMATTED"]), $title_tmp);
if ($bMail) {
$arResult["EVENT_FORMATTED"] = array("TITLE" => $title, "MESSAGE" => false);
$friends_page = COption::GetOptionString("socialnetwork", "friends_page", false, SITE_ID);
if (strlen($friends_page) > 0) {
$arFields["URL"] = str_replace(array("#user_id#", "#USER_ID#"), $secondUserID, $friends_page);
$arResult["EVENT_FORMATTED"]["URL"] = CSocNetLogTools::FormatEvent_GetURL($arFields);
}
} else {
switch ($arFields["TITLE"]) {
case "friend":
$classname = "join-group";
break;
case "unfriend":
$classname = "leave-group";
break;
default:
$classname = "";
}
$arResult["EVENT_FORMATTED"] = array("TITLE" => false, "TITLE_24" => $title_tmp_24, "MESSAGE" => $title, "IS_MESSAGE_SHORT" => true, "DESTINATION" => array(array("STYLE" => "users", "TITLE" => $user_tmp, "URL" => str_replace(array("#user_id#", "#USER_ID#", "#id#", "#ID#"), $arFields["MESSAGE"], $arParams["~PATH_TO_USER"]))), "STYLE" => $classname);
}
}
if ($bMail && strlen($arFields["MAIL_LANGUAGE_ID"]) > 0) {
IncludeModuleLangFile(__FILE__, LANGUAGE_ID);
}
return $arResult;
}
示例6: FormatTask4SocialNetwork
//.........这里部分代码省略.........
case "M":
$actorMaleSuffix = '_' . $arUser['PERSONAL_GENDER'];
break;
}
}
$actorUserName = CUser::FormatName($nameTemplate, $arUser);
}
}
$eventTitleTemplate = GetMessage('TASKS_SONET_GL_EVENT_TITLE_TASK' . $eventTitlePhraseSuffix . $actorMaleSuffix);
$eventTitle = str_replace(array('#USER_NAME#', '#TITLE#'), array($actorUserName, $taskHtmlTitle), $eventTitleTemplate);
$eventTitleWoTaskName = str_replace(array('#USER_NAME#', '#TITLE#'), array($actorUserName, ''), $eventTitleTemplate);
$title_tmp = str_replace("#TITLE#", $taskHtmlTitle, GetMessage("TASKS_SONET_GL_EVENT_TITLE_TASK"));
if ($arFields["PARAMS"] && $arFields["PARAMS"]["CREATED_BY"]) {
$suffix = is_array($GLOBALS["arExtranetUserID"]) && in_array($arFields["PARAMS"]["CREATED_BY"], $GLOBALS["arExtranetUserID"]) ? GetMessage("TASKS_SONET_LOG_EXTRANET_SUFFIX") : "";
$rsUser = CUser::GetList($by = 'id', $order = 'asc', array('ID_EQUAL_EXACT' => (int) $arFields['PARAMS']['CREATED_BY']), array('FIELDS' => array('PERSONAL_GENDER', 'ID', 'NAME', 'LAST_NAME', 'SECOND_NAME', 'LOGIN')));
if ($arUser = $rsUser->Fetch()) {
$title_tmp .= " (" . str_replace("#USER_NAME#", CUser::FormatName(CSite::GetNameFormat(false), $arUser) . $suffix, GetMessage("TASKS_SONET_GL_EVENT_TITLE_TASK_CREATED")) . ")";
}
}
if ($bMail) {
$title = str_replace(array("#TASK#", "#ENTITY#", "#CREATED_BY#"), array($title_tmp, $arResult["ENTITY"]["FORMATTED"], $bMail ? $arResult["CREATED_BY"]["FORMATTED"] : ""), GetMessage("SONET_GL_EVENT_TITLE_" . ($arFields["ENTITY_TYPE"] == SONET_SUBSCRIBE_ENTITY_GROUP ? "GROUP" : "USER") . "_TASK_MAIL"));
} else {
$title = $title_tmp;
$title_24 = $eventTitle;
}
if (!$bMail && in_array($arFields["PARAMS"]["TYPE"], array("create", "status", 'modify', 'comment'), true)) {
if (!(isset($arFields['PARAMS']['CHANGED_FIELDS']) && is_array($arFields['PARAMS']['CHANGED_FIELDS']))) {
$arFields['PARAMS']['CHANGED_FIELDS'] = array();
}
$rsTask = CTasks::GetByID($arFields["SOURCE_ID"], false);
if ($arTask = $rsTask->Fetch()) {
$task_datetime = $arTask["CHANGED_DATE"];
if ($arFields["PARAMS"]["TYPE"] == "create") {
if ($arParams["MOBILE"] == "Y") {
$title_24 = GetMessage("TASKS_SONET_GL_TASKS2_NEW_TASK_MESSAGE");
$message_24_1 = $taskHtmlTitle;
} else {
$message = $message_24_1 = $eventTitle;
$message_24_2 = $changes_24 = "";
}
} elseif ($arFields["PARAMS"]["TYPE"] == "modify") {
$arChangesFields = $arFields["PARAMS"]["CHANGED_FIELDS"];
$changes_24 = implode(", ", CTaskNotifications::__Fields2Names($arChangesFields));
if ($arParams["MOBILE"] == "Y") {
$title_24 = GetMessage("TASKS_SONET_GL_TASKS2_TASK_CHANGED_MESSAGE_24_1");
$message_24_1 = $taskHtmlTitle;
} else {
$message = str_replace("#CHANGES#", implode(", ", CTaskNotifications::__Fields2Names($arChangesFields)), GetMessage("TASKS_SONET_GL_TASKS2_TASK_CHANGED_MESSAGE"));
$message_24_1 = $eventTitle;
$message_24_2 = GetMessage("TASKS_SONET_GL_TASKS2_TASK_CHANGED_MESSAGE_24_2");
}
} elseif ($arFields["PARAMS"]["TYPE"] == "status") {
$message = GetMessage("TASKS_SONET_GL_TASKS2_TASK_STATUS_MESSAGE_" . $arTask["STATUS"]);
$message_24_1 = $eventTitle;
if ($arTask["STATUS"] == CTasks::STATE_DECLINED) {
$message = str_replace("#TASK_DECLINE_REASON#", $arTask["DECLINE_REASON"], $message);
$message_24_2 = GetMessage("TASKS_SONET_GL_TASKS2_TASK_STATUS_MESSAGE_" . $arTask["STATUS"] . "_24_2");
$changes_24 = $arTask["DECLINE_REASON"];
} else {
$message_24_2 = $changes_24 = $message;
}
} elseif ($arFields['PARAMS']['TYPE'] === 'comment') {
$message_24_1 = $eventTitle;
$message_24_2 = $changes_24 = $message = '';
}
$prevRealStatus = false;
if (isset($arFields['PARAMS']['PREV_REAL_STATUS'])) {
$prevRealStatus = $arFields['PARAMS']['PREV_REAL_STATUS'];
}
ob_start();
$GLOBALS['APPLICATION']->IncludeComponent("bitrix:tasks.task.livefeed", $arParams["MOBILE"] == "Y" ? 'mobile' : '', array("MOBILE" => $arParams["MOBILE"] == "Y" ? "Y" : "N", "TASK" => $arTask, "MESSAGE" => $message, "MESSAGE_24_1" => $message_24_1, "MESSAGE_24_2" => $message_24_2, "CHANGES_24" => $changes_24, "NAME_TEMPLATE" => $arParams["NAME_TEMPLATE"], "PATH_TO_USER" => $arParams["PATH_TO_USER"], 'TYPE' => $arFields["PARAMS"]["TYPE"], 'task_tmp' => $taskHtmlTitle, 'taskHtmlTitle' => $taskHtmlTitle, 'PREV_REAL_STATUS' => $prevRealStatus), null, array("HIDE_ICONS" => "Y"));
$arFields["MESSAGE"] = ob_get_contents();
ob_end_clean();
}
}
if ($arParams["MOBILE"] == "Y") {
$arResult["EVENT_FORMATTED"] = array("TITLE" => '', "TITLE_24" => $eventTitleWoTaskName, "MESSAGE" => htmlspecialcharsbx($arFields['MESSAGE']), "DESCRIPTION" => $arFields['TITLE'], "DESCRIPTION_STYLE" => 'task');
} else {
$strMessage = $strShortMessage = '';
if ($bMail) {
$strMessage = $strShortMessage = str_replace(array('<nobr>', '</nobr>'), array('', ''), $arFields['TEXT_MESSAGE']);
} else {
$strMessage = $arFields['MESSAGE'];
$strShortMessage = $arFields['~MESSAGE'];
}
$arResult["EVENT_FORMATTED"] = array("TITLE" => $title, "MESSAGE" => $strMessage, "SHORT_MESSAGE" => $strShortMessage, "IS_MESSAGE_SHORT" => true, "STYLE" => 'tasks-info', "COMMENT_URL" => !$bMail ? $arFields['~URL'] . (strpos($arFields['~URL'], '?') > 0 ? '&' : '?') . 'MID=#ID##com#ID#' : '');
}
if ($bMail) {
$url = CSocNetLogTools::FormatEvent_GetURL($arFields);
if (strlen($url) > 0) {
$arResult["EVENT_FORMATTED"]["URL"] = $url;
}
} elseif ($arFields["ENTITY_TYPE"] == SONET_SUBSCRIBE_ENTITY_GROUP) {
$arResult["EVENT_FORMATTED"]["DESTINATION"] = array(array("STYLE" => "sonetgroups", "TITLE" => $arResult["ENTITY"]["FORMATTED"]["NAME"], "URL" => $arResult["ENTITY"]["FORMATTED"]["URL"], "IS_EXTRANET" => is_array($GLOBALS["arExtranetGroupID"]) && in_array($arFields["ENTITY_ID"], $GLOBALS["arExtranetGroupID"])));
}
if (!$bMail && strlen($task_datetime) > 0) {
$arResult["EVENT_FORMATTED"]["LOG_DATE_FORMAT"] = $task_datetime;
}
return $arResult;
}
示例7: FormatComment_Files
static function FormatComment_Files($arFields, $arParams, $bMail = false, $arLog = array())
{
$arResult = array("EVENT_FORMATTED" => array());
if (!CModule::IncludeModule("socialnetwork")) {
return $arResult;
}
if ($bMail) {
$arResult["CREATED_BY"] = CSocNetLogTools::FormatEvent_GetCreatedBy($arFields, $arParams, $bMail);
$arResult["ENTITY"] = self::GetEntity_Files($arLog, $bMail);
} elseif ($arParams["USE_COMMENT"] != "Y") {
$arLog["ENTITY_ID"] = $arFields["ENTITY_ID"];
$arLog["ENTITY_TYPE"] = $arFields["ENTITY_TYPE"];
$arResult["ENTITY"] = self::GetEntity_Files($arLog, false);
}
if (!$bMail && array_key_exists("URL", $arLog) && strlen($arLog["URL"]) > 0) {
$file_tmp = '<a href="' . $arLog["URL"] . '">' . $arLog["TITLE"] . '</a>';
} else {
$file_tmp = $arLog["TITLE"];
}
$title_tmp = $bMail ? GetMessage("WEBDAV_SOCNET_LOG_FILES_COMMENT_TITLE_MAIL") : GetMessage("WEBDAV_SOCNET_LOG_FILES_COMMENT_TITLE");
$title = str_replace(array("#TITLE#", "#ENTITY#", "#CREATED_BY#"), array($file_tmp, $arResult["ENTITY"]["FORMATTED"], $bMail ? $arResult["CREATED_BY"]["FORMATTED"] : ""), $title_tmp);
$arResult["EVENT_FORMATTED"] = array("TITLE" => $bMail || $arParams["USE_COMMENT"] != "Y" ? $title : "", "MESSAGE" => $bMail ? $arFields["TEXT_MESSAGE"] : $arFields["MESSAGE"]);
if ($bMail) {
$url = CSocNetLogTools::FormatEvent_GetURL($arLog);
if (strlen($url) > 0) {
$arResult["EVENT_FORMATTED"]["URL"] = $url;
}
}
return $arResult;
}
示例8: FormatComment_Data
function FormatComment_Data($arFields, $arParams, $bMail = false, $arLog = array())
{
$arResult = array("EVENT_FORMATTED" => array());
if (!CModule::IncludeModule("socialnetwork")) {
return $arResult;
}
if ($arLog["ENTITY_TYPE"] == SONET_SUBSCRIBE_ENTITY_PROVIDER) {
$arResult["ENTITY"] = CXDILFEventHandlers::GetEntity_Data($arLog, $bMail);
} elseif (in_array($arLog["ENTITY_TYPE"], array(SONET_SUBSCRIBE_ENTITY_GROUP, SONET_SUBSCRIBE_ENTITY_USER))) {
$arResult["ENTITY"] = CSocNetLogTools::FormatEvent_GetEntity($arLog, $arParams, $bMail);
}
if (!$bMail && $arParams["USE_COMMENT"] != "Y") {
$arLog["ENTITY_ID"] = $arFields["ENTITY_ID"];
$arLog["ENTITY_TYPE"] = $arFields["ENTITY_TYPE"];
}
if (!$bMail && array_key_exists("URL", $arLog) && strlen($arLog["URL"]) > 0) {
$news_tmp = '<a href="' . $arLog["URL"] . '">' . $arLog["TITLE"] . '</a>';
} else {
$news_tmp = $arLog["TITLE"];
}
$title_tmp = $bMail ? GetMessage("LFP_SOCNET_LOG_DATA_COMMENT_" . $arLog["ENTITY_TYPE"] . "_TITLE_MAIL") : GetMessage("LFP_SOCNET_LOG_DATA_COMMENT_TITLE");
$title = str_replace(array("#TITLE#", "#ENTITY#"), array($news_tmp, $bMail ? $arResult["ENTITY"]["FORMATTED"] : $arResult["ENTITY"]["FORMATTED"]["NAME"]), $title_tmp);
$arResult["EVENT_FORMATTED"] = array("TITLE" => $bMail || $arParams["USE_COMMENT"] != "Y" ? $title : "", "MESSAGE" => $bMail ? $arFields["TEXT_MESSAGE"] : $arFields["MESSAGE"]);
if ($bMail) {
$url = CSocNetLogTools::FormatEvent_GetURL($arLog, true);
if (strlen($url) > 0) {
$arResult["EVENT_FORMATTED"]["URL"] = $url;
}
} else {
static $parserLog = false;
if (CModule::IncludeModule("forum")) {
$arAllow = array("HTML" => "N", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "LOG_IMG" => "N", "QUOTE" => "Y", "LOG_QUOTE" => "N", "CODE" => "Y", "LOG_CODE" => "N", "FONT" => "Y", "LOG_FONT" => "N", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "Y", "MULTIPLE_BR" => "N", "VIDEO" => "Y", "LOG_VIDEO" => "N", "USERFIELDS" => $arFields["UF"], "USER" => $arParams["IM"] == "Y" ? "N" : "Y");
if (!$parserLog) {
$parserLog = new forumTextParser(LANGUAGE_ID);
}
$parserLog->pathToUser = $arParams["PATH_TO_USER"];
$parserLog->arUserfields = $arFields["UF"];
$arResult["EVENT_FORMATTED"]["MESSAGE"] = htmlspecialcharsbx($parserLog->convert(htmlspecialcharsback($arResult["EVENT_FORMATTED"]["MESSAGE"]), $arAllow));
$arResult["EVENT_FORMATTED"]["MESSAGE"] = preg_replace("/\\[user\\s*=\\s*([^\\]]*)\\](.+?)\\[\\/user\\]/is" . BX_UTF_PCRE_MODIFIER, "\\2", $arResult["EVENT_FORMATTED"]["MESSAGE"]);
} else {
$arAllow = array("HTML" => "Y", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "LOG_IMG" => "N", "QUOTE" => "Y", "LOG_QUOTE" => "N", "CODE" => "Y", "LOG_CODE" => "N", "FONT" => "Y", "LOG_FONT" => "N", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "Y", "MULTIPLE_BR" => "N", "VIDEO" => "Y", "LOG_VIDEO" => "N", "USERFIELDS" => $arFields["UF"], "USER" => "Y");
if (!$parserLog) {
$parserLog = new logTextParser(false, $arParams["PATH_TO_SMILE"]);
}
$arResult["EVENT_FORMATTED"]["MESSAGE"] = htmlspecialcharsbx($parserLog->convert(htmlspecialcharsback($arResult["EVENT_FORMATTED"]["MESSAGE"]), array(), $arAllow));
}
if ($arParams["MOBILE"] != "Y" && $arParams["NEW_TEMPLATE"] != "Y") {
if (CModule::IncludeModule("forum")) {
$arResult["EVENT_FORMATTED"]["SHORT_MESSAGE"] = $parserLog->html_cut($parserLog->convert(htmlspecialcharsback($arResult["EVENT_FORMATTED"]["MESSAGE"]), $arAllow), 500);
} else {
$arResult["EVENT_FORMATTED"]["SHORT_MESSAGE"] = $parserLog->html_cut($parserLog->convert(htmlspecialcharsback($arResult["EVENT_FORMATTED"]["MESSAGE"]), array(), $arAllow), 500);
}
$arResult["EVENT_FORMATTED"]["IS_MESSAGE_SHORT"] = CSocNetLogTools::FormatEvent_IsMessageShort($arResult["EVENT_FORMATTED"]["MESSAGE"], $arResult["EVENT_FORMATTED"]["SHORT_MESSAGE"]);
}
}
return $arResult;
}