本文整理汇总了PHP中CSocNetLogTools::processPath方法的典型用法代码示例。如果您正苦于以下问题:PHP CSocNetLogTools::processPath方法的具体用法?PHP CSocNetLogTools::processPath怎么用?PHP CSocNetLogTools::processPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSocNetLogTools
的用法示例。
在下文中一共展示了CSocNetLogTools::processPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDestinations
protected function getDestinations()
{
$isExtranetInstalled = Loader::includeModule("extranet");
$members = array();
if ($this->blogPostData["HAS_SOCNET_ALL"] != "Y") {
/** @noinspection PhpDynamicAsStaticMethodCallInspection */
$perm = \CBlogPost::getSocnetPermsName($this->entityId);
foreach ($perm as $type => $v) {
foreach ($v as $vv) {
if ($type == "SG") {
/** @noinspection PhpDynamicAsStaticMethodCallInspection */
if ($socNetGroup = \CSocNetGroup::getByID($vv["ENTITY_ID"])) {
$name = $socNetGroup["~NAME"];
$link = \CComponentEngine::makePathFromTemplate($this->getPathToGroup(), array("group_id" => $vv["ENTITY_ID"]));
$groupSiteID = false;
/** @noinspection PhpDynamicAsStaticMethodCallInspection */
$queryGroupSite = \CSocNetGroup::getSite($vv["ENTITY_ID"]);
while ($groupSite = $queryGroupSite->fetch()) {
/** @noinspection PhpDynamicAsStaticMethodCallInspection */
if (!$isExtranetInstalled || $groupSite["LID"] != \CExtranet::getExtranetSiteID()) {
$groupSiteID = $groupSite["LID"];
break;
}
}
if ($groupSiteID) {
/** @noinspection PhpDynamicAsStaticMethodCallInspection */
$tmp = \CSocNetLogTools::processPath(array("GROUP_URL" => $link), $this->getUser()->getId(), $groupSiteID);
// user_id is not important parameter
$link = strlen($tmp["URLS"]["GROUP_URL"]) > 0 ? $tmp["URLS"]["GROUP_URL"] : $link;
}
$isExtranet = is_array($GLOBALS["arExtranetGroupID"]) && in_array($vv["ENTITY_ID"], $GLOBALS["arExtranetGroupID"]);
$members[] = array("NAME" => $name, "LINK" => $link, 'AVATAR_SRC' => Ui\Avatar::getGroup($socNetGroup['IMAGE_ID']), "IS_EXTRANET" => $isExtranet ? "Y" : "N");
}
} elseif ($type == "U") {
if (in_array("US" . $vv["ENTITY_ID"], $vv["ENTITY"])) {
array_unshift($members, array("NAME" => Loc::getMessage('DISK_UF_BLOG_POST_CONNECTOR_MEMBERS_ALL'), "LINK" => null, 'AVATAR_SRC' => Ui\Avatar::getDefaultGroup(), "IS_EXTRANET" => "N"));
} else {
$name = \CUser::formatName('#NAME# #LAST_NAME#', array("NAME" => $vv["~U_NAME"], "LAST_NAME" => $vv["~U_LAST_NAME"], "SECOND_NAME" => $vv["~U_SECOND_NAME"], "LOGIN" => $vv["~U_LOGIN"], "NAME_LIST_FORMATTED" => ""), false);
$isExtranet = is_array($GLOBALS["arExtranetUserID"]) && in_array($vv["ENTITY_ID"], $GLOBALS["arExtranetUserID"]);
$members[] = array("NAME" => $name, "LINK" => \CComponentEngine::makePathFromTemplate($this->getPathToUser(), array("user_id" => $vv["ENTITY_ID"])), 'AVATAR_SRC' => Ui\Avatar::getPerson($vv['U_PERSONAL_PHOTO']), "IS_EXTRANET" => $isExtranet ? "Y" : "N");
}
} elseif ($type == "DR") {
$members[] = array("NAME" => $vv["EL_NAME"], "LINK" => null, 'AVATAR_SRC' => Ui\Avatar::getDefaultGroup(), "IS_EXTRANET" => "N");
}
}
}
} else {
$members[] = array("NAME" => Loc::getMessage('DISK_UF_BLOG_POST_CONNECTOR_MEMBERS_ALL'), "LINK" => null, 'AVATAR_SRC' => Ui\Avatar::getDefaultGroup(), "IS_EXTRANET" => "N");
}
return $members;
}
示例2: getDataToShow
public function getDataToShow($userId = 0)
{
$return = null;
if (($res = $this->getDataToCheck($this->entityId)) && !empty($res)) {
list($message, $topic, $forum) = $res;
$return = array('TITLE' => Loc::getMessage("DISK_UF_FORUM_MESSAGE_CONNECTOR_MESSAGE01"), 'DETAIL_URL' => \CForumNew::preparePath2Message($forum["PATH2FORUM_MESSAGE"], array("FORUM_ID" => $message["FORUM_ID"], "TOPIC_ID" => $message["TOPIC_ID"], "MESSAGE_ID" => $message["ID"], "SOCNET_GROUP_ID" => $topic["SOCNET_GROUP_ID"], "OWNER_ID" => $topic["OWNER_ID"], "PARAM1" => $message["PARAM1"], "PARAM2" => $message["PARAM2"])), 'DESCRIPTION' => $topic['TITLE'] == $topic['XML_ID'] ? '' : $topic["TITLE"], 'MEMBERS' => array(), 'DUPLICATE_TO_SOCNET' => "N");
if (($topic["SOCNET_GROUP_ID"] > 0 || $topic["OWNER_ID"] > 0) && $message["NEW_TOPIC"] == "Y" && Loader::includeModule("socialnetwork") && ($res = \CSocNetLog::getList(array("ID" => "DESC"), array("SOURCE_ID" => $message["ID"], "EVENT_ID" => "forum"), false, false, array("ID", "URL", "ENTITY_TYPE", "ENTITY_ID", "LOG_ID"))->fetch()) && $res) {
$return["TITLE"] = $topic["SOCNET_GROUP_ID"] > 0 ? Loc::getMessage("DISK_UF_FORUM_MESSAGE_CONNECTOR_MESSAGE08") : Loc::getMessage("DISK_UF_FORUM_MESSAGE_CONNECTOR_MESSAGE09");
$return["DETAIL_URL"] = empty($res["URL"]) ? \CComponentEngine::makePathFromTemplate(\COption::getOptionString("socialnetwork", "log_entry_page", false, SITE_ID), array("log_id" => $res["ID"])) : $res["URL"];
if (strpos($return["DETAIL_URL"], "#GROUPS_PATH#") !== false) {
$tmp = \CSocNetLogTools::processPath(array("URL" => $return["DETAIL_URL"]), $userId);
$return["DETAIL_URL"] = $tmp["URLS"]["URL"];
}
$return['DUPLICATE_TO_SOCNET'] = "Y";
$return["ENTITY_TYPE"] = $res["ENTITY_TYPE"];
$return["ENTITY_ID"] = $res["ENTITY_ID"];
$return["EVENT_ID"] = "forum";
$return["SOURCE_ID"] = $message["ID"];
$return["LOG_ID"] = $res["LOG_ID"];
$return["MODULE_ID"] = "forum";
} else {
if (!empty($topic["XML_ID"]) || $topic["SOCNET_GROUP_ID"] > 0 || $topic["OWNER_ID"] > 0) {
$entityId = substr($topic["XML_ID"], strrpos($topic["XML_ID"], "_") + 1);
$entityType = substr($topic["XML_ID"], 0, strrpos($topic["XML_ID"], "_"));
$return["TITLE"] = Loc::getMessage("DISK_UF_FORUM_MESSAGE_CONNECTOR_MESSAGE02");
if ((in_array($entityType, array("FORUM", "TASK", "EVENT", "IBLOCK", "TIMEMAN_ENTRY", "TIMEMAN", "TIMEMAN_REPORT")) || $topic["SOCNET_GROUP_ID"] > 0 || $topic["OWNER_ID"] > 0) && Loader::includeModule("socialnetwork") && ($res = \CSocNetLogComments::getList(array("ID" => "DESC"), array("SOURCE_ID" => $message["ID"], "EVENT_ID" => array("calendar_comment", "commondocs_comment", "files_comment", "forum", "news_comment", "photo_comment", "tasks_comment", "wiki_comment", "report_comment", "timeman_entry_comment")), false, false, array("ID", "SOURCE_ID", "LOG_ID", "EVENT_ID", "ENTITY_TYPE", "ENTITY_ID", "URL", "MODULE_ID"))->fetch()) && $res) {
$return["DETAIL_URL"] = empty($res["URL"]) ? \CComponentEngine::makePathFromTemplate(\COption::getOptionString("socialnetwork", "log_entry_page", false, SITE_ID), array("log_id" => $res["LOG_ID"])) . "?commentId=" . $res["ID"] : $res["URL"];
if (strpos($return["DETAIL_URL"], "#GROUPS_PATH#") !== false) {
$tmp = \CSocNetLogTools::processPath(array("URL" => $return["DETAIL_URL"]), $userId);
$return["DETAIL_URL"] = $tmp["URLS"]["URL"];
}
switch ($res["EVENT_ID"]) {
case "tasks_comment":
$return["TITLE"] = Loc::getMessage("DISK_UF_FORUM_MESSAGE_CONNECTOR_MESSAGE03");
if (Loader::includeModule("tasks")) {
$connector = new TaskConnector($entityId, $this->attachedObject);
$subData = $connector->getDataToShow();
if ($subData["MEMBERS"]) {
$return["MEMBERS"] = $subData["MEMBERS"];
}
}
break;
case "calendar_comment":
$return["TITLE"] = Loc::getMessage("DISK_UF_FORUM_MESSAGE_CONNECTOR_MESSAGE04");
$return["DETAIL_URL"] = null;
break;
case "commondocs_comment":
$return["TITLE"] = Loc::getMessage("DISK_UF_FORUM_MESSAGE_CONNECTOR_MESSAGE05");
break;
case "crm_activity_add_comment":
$return["TITLE"] = Loc::getMessage("DISK_UF_FORUM_MESSAGE_CONNECTOR_MESSAGE06");
break;
case "files_comment":
$return["TITLE"] = Loc::getMessage("DISK_UF_FORUM_MESSAGE_CONNECTOR_MESSAGE07");
break;
case "forum":
$return["TITLE"] = $topic["SOCNET_GROUP_ID"] > 0 ? Loc::getMessage("DISK_UF_FORUM_MESSAGE_CONNECTOR_MESSAGE08") : Loc::getMessage("DISK_UF_FORUM_MESSAGE_CONNECTOR_MESSAGE09");
break;
case "news_comment":
$return["TITLE"] = Loc::getMessage("DISK_UF_FORUM_MESSAGE_CONNECTOR_MESSAGE10");
break;
case "photo_comment":
$return["TITLE"] = Loc::getMessage("DISK_UF_FORUM_MESSAGE_CONNECTOR_MESSAGE11");
break;
case "wiki_comment":
$return["TITLE"] = Loc::getMessage("DISK_UF_FORUM_MESSAGE_CONNECTOR_MESSAGE12");
break;
case "report_comment":
$return["TITLE"] = Loc::getMessage("DISK_UF_FORUM_MESSAGE_CONNECTOR_MESSAGE13");
break;
case "timeman_entry_comment":
$return["TITLE"] = Loc::getMessage("DISK_UF_FORUM_MESSAGE_CONNECTOR_MESSAGE14");
break;
}
$return['DUPLICATE_TO_SOCNET'] = "Y";
$return["ENTITY_TYPE"] = $res["ENTITY_TYPE"];
$return["ENTITY_ID"] = $res["ENTITY_ID"];
$return["EVENT_ID"] = $res["EVENT_ID"];
$return["SOURCE_ID"] = $res["SOURCE_ID"];
$return["LOG_ID"] = $res["LOG_ID"];
$return["MODULE_ID"] = $res["MODULE_ID"];
} else {
$return["DETAIL_URL"] = \CForumNew::preparePath2Message($forum["PATH2FORUM_MESSAGE"], array("FORUM_ID" => $message["FORUM_ID"], "TOPIC_ID" => $message["TOPIC_ID"], "MESSAGE_ID" => $message["ID"], "SOCNET_GROUP_ID" => $topic["SOCNET_GROUP_ID"], "OWNER_ID" => $topic["OWNER_ID"], "PARAM1" => $message["PARAM1"], "PARAM2" => $entityId));
switch ($entityType) {
case "EVENT":
$return["TITLE"] = Loc::getMessage("DISK_UF_FORUM_MESSAGE_CONNECTOR_MESSAGE04");
break;
case "TASK":
$return["TITLE"] = Loc::getMessage("DISK_UF_FORUM_MESSAGE_CONNECTOR_MESSAGE03");
break;
case "IBLOCK":
$return["TITLE"] = Loc::getMessage("DISK_UF_FORUM_MESSAGE_CONNECTOR_MESSAGE15");
break;
case "TIMEMAN_ENTRY":
$return["TITLE"] = Loc::getMessage("DISK_UF_FORUM_MESSAGE_CONNECTOR_MESSAGE14");
break;
case "TIMEMAN":
case "TIMEMAN_REPORT":
$return["TITLE"] = Loc::getMessage("DISK_UF_FORUM_MESSAGE_CONNECTOR_MESSAGE13");
break;
//.........这里部分代码省略.........