本文整理汇总了PHP中CSocNetLogTools::FormatEvent_GetCreatedBy方法的典型用法代码示例。如果您正苦于以下问题:PHP CSocNetLogTools::FormatEvent_GetCreatedBy方法的具体用法?PHP CSocNetLogTools::FormatEvent_GetCreatedBy怎么用?PHP CSocNetLogTools::FormatEvent_GetCreatedBy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSocNetLogTools
的用法示例。
在下文中一共展示了CSocNetLogTools::FormatEvent_GetCreatedBy方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: FormatTask4SocialNetwork
public static function FormatTask4SocialNetwork($arFields, $arParams, $bMail = false)
{
/** @global CMain $APPLICATION */
global $APPLICATION;
$task_datetime = null;
if (!CModule::IncludeModule('socialnetwork')) {
return false;
}
$APPLICATION->SetAdditionalCSS('/bitrix/js/tasks/css/tasks.css');
if (isset($arFields['~PARAMS']) && $arFields['~PARAMS']) {
$arFields['PARAMS'] = unserialize($arFields['~PARAMS']);
} elseif (isset($arFields['PARAMS']) && $arFields['PARAMS']) {
$arFields['PARAMS'] = unserialize($arFields['PARAMS']);
} else {
$arFields['PARAMS'] = array();
}
$arResult = array('EVENT' => $arFields, 'CREATED_BY' => CSocNetLogTools::FormatEvent_GetCreatedBy($arFields, $arParams, $bMail), 'ENTITY' => CSocNetLogTools::FormatEvent_GetEntity($arFields, $arParams, $bMail), 'EVENT_FORMATTED' => array(), 'CACHED_CSS_PATH' => '/bitrix/js/tasks/css/tasks.css');
if (!$bMail) {
$arResult["AVATAR_SRC"] = CSocNetLogTools::FormatEvent_CreateAvatar($arFields, $arParams);
}
if (!$bMail && $arParams["MOBILE"] != "Y" && array_key_exists("URL", $arFields) && strlen($arFields["URL"]) > 0) {
$taskHtmlTitle = '<a href="' . $arFields["URL"] . '" onclick="if (taskIFramePopup.isLeftClick(event)) {taskIFramePopup.view(' . $arFields["SOURCE_ID"] . '); return false;}">' . $arFields["TITLE"] . '</a>';
} else {
$taskHtmlTitle = $arFields["TITLE"];
}
$actorUserId = null;
$actorUserName = '';
$actorMaleSuffix = '';
$eventTitlePhraseSuffix = '_DEFAULT';
if (isset($arParams['NAME_TEMPLATE'])) {
$nameTemplate = $arParams['NAME_TEMPLATE'];
} else {
$nameTemplate = CSite::GetNameFormat();
}
if (isset($arFields["PARAMS"], $arFields['PARAMS']['TYPE'])) {
if ($arFields["PARAMS"]["TYPE"] === "create") {
$eventTitlePhraseSuffix = '_CREATE_24';
if (isset($arFields["PARAMS"]["CREATED_BY"])) {
$actorUserId = $arFields["PARAMS"]["CREATED_BY"];
}
} elseif ($arFields["PARAMS"]["TYPE"] === 'modify') {
$eventTitlePhraseSuffix = '_MODIFY_24';
if (isset($arFields["PARAMS"]["CHANGED_BY"])) {
$actorUserId = $arFields["PARAMS"]["CHANGED_BY"];
}
} elseif ($arFields["PARAMS"]["TYPE"] === 'status') {
$eventTitlePhraseSuffix = '_STATUS_24';
if (isset($arFields["PARAMS"]["CHANGED_BY"])) {
$actorUserId = $arFields["PARAMS"]["CHANGED_BY"];
}
} elseif ($arFields["PARAMS"]["TYPE"] === 'comment') {
$eventTitlePhraseSuffix = '';
}
}
if ($actorUserId) {
$rsUser = CUser::GetList($by = 'id', $order = 'asc', array('ID_EQUAL_EXACT' => (int) $actorUserId), array('FIELDS' => array('ID', 'NAME', 'LAST_NAME', 'SECOND_NAME', 'LOGIN', 'PERSONAL_GENDER')));
if ($arUser = $rsUser->fetch()) {
if (isset($arUser['PERSONAL_GENDER'])) {
switch ($arUser['PERSONAL_GENDER']) {
case "F":
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 = "";
}
//.........这里部分代码省略.........
示例4: FormatEvent_Task2
function FormatEvent_Task2($arFields, $arParams, $bMail = false)
{
if ($bMail && strlen($arFields["MAIL_LANGUAGE_ID"]) > 0) {
IncludeModuleLangFile(__FILE__, $arFields["MAIL_LANGUAGE_ID"]);
}
// Prevent module versions dependency between tasks and socialnetwork
if (CModule::IncludeModule('tasks') && method_exists('CTaskNotifications', 'FormatTask4SocialNetwork')) {
// Code moved out to tasks, use it
if ($bMail && strlen($arFields["MAIL_LANGUAGE_ID"]) > 0) {
IncludeModuleLangFile(__FILE__, LANGUAGE_ID);
}
return CTaskNotifications::FormatTask4SocialNetwork($arFields, $arParams, $bMail);
}
// Code wasn't moved out to tasks yet, use current function
$GLOBALS['APPLICATION']->SetAdditionalCSS("/bitrix/js/tasks/css/tasks.css");
$arFields["PARAMS"] = unserialize($arFields["~PARAMS"]);
$arResult = array("EVENT" => $arFields, "CREATED_BY" => CSocNetLogTools::FormatEvent_GetCreatedBy($arFields, $arParams, $bMail), "ENTITY" => CSocNetLogTools::FormatEvent_GetEntity($arFields, $arParams, $bMail), "EVENT_FORMATTED" => array());
if (!$bMail) {
$arResult["AVATAR_SRC"] = CSocNetLogTools::FormatEvent_CreateAvatar($arFields, $arParams);
}
if (!$bMail && $arParams["MOBILE"] != "Y" && array_key_exists("URL", $arFields) && strlen($arFields["URL"]) > 0) {
$task_tmp = '<a href="' . $arFields["URL"] . '" onclick="if (taskIFramePopup.isLeftClick(event)) {taskIFramePopup.view(' . $arFields["SOURCE_ID"] . '); return false;}">' . $arFields["TITLE"] . '</a>';
} else {
$task_tmp = $arFields["TITLE"];
}
$title_tmp = str_replace("#TITLE#", $task_tmp, GetMessage("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("SONET_LOG_EXTRANET_SUFFIX") : "";
$rsUser = CUser::GetByID(intval($arFields["PARAMS"]["CREATED_BY"]));
if ($arUser = $rsUser->Fetch()) {
$title_tmp .= " (" . str_replace("#USER_NAME#", CUser::FormatName(CSite::GetNameFormat(false), $arUser) . $suffix, GetMessage("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;
if (!is_array($arFields["PARAMS"]) || !array_key_exists("TYPE", $arFields["PARAMS"]) || strlen($arFields["PARAMS"]["TYPE"]) <= 0) {
$arFields["PARAMS"]["TYPE"] = "DEFAULT";
}
switch ($arFields["CREATED_BY_PERSONAL_GENDER"]) {
case "M":
$suffix = "_M";
break;
case "F":
$suffix = "_F";
break;
default:
$suffix = "";
}
$title_24 = str_replace("#TITLE#", $task_tmp, GetMessage("SONET_GL_EVENT_TITLE_TASK_" . strtoupper($arFields["PARAMS"]["TYPE"]) . "_24" . $suffix));
}
if (!$bMail && (in_array($arFields["PARAMS"]["TYPE"], array("create", "status")) || $arFields["PARAMS"]["TYPE"] == "modify" && is_array($arFields["PARAMS"]["CHANGED_FIELDS"])) && CModule::IncludeModule("tasks")) {
$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("SONET_GL_TASKS2_NEW_TASK_MESSAGE");
$message_24_1 = $task_tmp;
} else {
$message = $message_24_1 = GetMessage("SONET_GL_TASKS2_NEW_TASK_MESSAGE");
$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("SONET_GL_TASKS2_TASK_CHANGED_MESSAGE_24_1");
$message_24_1 = $task_tmp;
} else {
$message = str_replace("#CHANGES#", implode(", ", CTaskNotifications::__Fields2Names($arChangesFields)), GetMessage("SONET_GL_TASKS2_TASK_CHANGED_MESSAGE"));
$message_24_1 = GetMessage("SONET_GL_TASKS2_TASK_CHANGED_MESSAGE_24_1");
$message_24_2 = GetMessage("SONET_GL_TASKS2_TASK_CHANGED_MESSAGE_24_2");
}
} elseif ($arFields["PARAMS"]["TYPE"] == "status") {
$message = GetMessage("SONET_GL_TASKS2_TASK_STATUS_MESSAGE_" . $arTask["STATUS"]);
$message_24_1 = GetMessage("SONET_GL_TASKS2_TASK_STATUS_MESSAGE_" . $arTask["STATUS"] . "_24");
if ($arTask["STATUS"] == 7) {
$message = str_replace("#TASK_DECLINE_REASON#", $arTask["DECLINE_REASON"], $message);
$message_24_2 = GetMessage("SONET_GL_TASKS2_TASK_STATUS_MESSAGE_" . $arTask["STATUS"] . "_24_2");
$changes_24 = $arTask["DECLINE_REASON"];
} elseif ($arTask["STATUS"] == 4) {
$message_24_2 = GetMessage("SONET_GL_TASKS2_TASK_STATUS_MESSAGE_" . $arTask["STATUS"] . "_24_2");
$changes_24 = GetMessage("SONET_GL_TASKS2_TASK_STATUS_MESSAGE_4_24_CHANGES");
} else {
$message_24_2 = $changes_24 = "";
}
}
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"]), null, array("HIDE_ICONS" => "Y"));
$arFields["MESSAGE"] = ob_get_contents();
ob_end_clean();
}
}
if ($arParams["MOBILE"] == "Y") {
$arResult["EVENT_FORMATTED"] = array("TITLE" => $title, "TITLE_24" => $title_24, "MESSAGE" => htmlspecialcharsbx($arFields["MESSAGE"]), "DESCRIPTION" => $message_24_1, "DESCRIPTION_STYLE" => "task");
} else {
$arResult["EVENT_FORMATTED"] = array("TITLE" => $title, "TITLE_24" => $title_24, "MESSAGE" => $bMail ? str_replace(array("<nobr>", "</nobr>"), array("", ""), $arFields["TEXT_MESSAGE"]) : $arFields["MESSAGE"], "SHORT_MESSAGE" => $bMail ? str_replace(array("<nobr>", "</nobr>"), array("", ""), $arFields["TEXT_MESSAGE"]) : $arFields["~MESSAGE"], "IS_MESSAGE_SHORT" => true, "STYLE" => "tasks-info");
if (!$bMail && strlen($task_datetime) > 0) {
//.........这里部分代码省略.........
示例5: 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;
}