本文整理汇总了PHP中CSocNetFeatures::GetActiveFeaturesNames方法的典型用法代码示例。如果您正苦于以下问题:PHP CSocNetFeatures::GetActiveFeaturesNames方法的具体用法?PHP CSocNetFeatures::GetActiveFeaturesNames怎么用?PHP CSocNetFeatures::GetActiveFeaturesNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSocNetFeatures
的用法示例。
在下文中一共展示了CSocNetFeatures::GetActiveFeaturesNames方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$arGadgetParams["TEMPLATE_NAME"] = $arGadgetParams["TEMPLATE_NAME"] ? $arGadgetParams["TEMPLATE_NAME"] : "main";
$arGadgetParams["SHOW_TITLE"] = $arGadgetParams["SHOW_TITLE"] ? $arGadgetParams["SHOW_TITLE"] : "N";
$arGadgetParams["GROUP_ID"] = $arGadgetParams["GROUP_ID"] ? $arGadgetParams["GROUP_ID"] : false;
if (!in_array($arGadgetParams["EVENT_ID"], array("system", "forum", "photo", "blog", "tasks", "files", "calendar"))) {
$arGadgetParams["EVENT_ID"] = false;
}
$arGadgetParams["USER_VAR"] = $arGadgetParams["USER_VAR"] ? $arGadgetParams["USER_VAR"] : "user_id";
$arGadgetParams["GROUP_VAR"] = $arGadgetParams["GROUP_VAR"] ? $arGadgetParams["GROUP_VAR"] : "group_id";
$arGadgetParams["PAGE_VAR"] = $arGadgetParams["PAGE_VAR"] ? $arGadgetParams["PAGE_VAR"] : "page";
$arGadgetParams["PATH_TO_USER"] = $arGadgetParams["PATH_TO_USER"] ? $arGadgetParams["PATH_TO_USER"] : "/company/personal/user/#user_id#/";
$arGadgetParams["PATH_TO_GROUP"] = $arGadgetParams["PATH_TO_GROUP"] ? $arGadgetParams["PATH_TO_GROUP"] : "/workgroups/group/#group_id#/";
$arGadgetParams["LIST_URL"] = $arGadgetParams["LIST_URL"] ? $arGadgetParams["LIST_URL"] : (IsModuleInstalled("intranet") ? "/company/personal/log/" : "/club/log/");
$arGadgetParams["SUBSCRIBE_ONLY"] = $arGadgetParams["SUBSCRIBE_ONLY"] != "Y" ? "N" : "Y";
$arGadgetParams["LOG_CNT"] = $arGadgetParams["LOG_CNT"] ? $arGadgetParams["LOG_CNT"] : 7;
if ($arGadgetParams["GROUP_ID"]) {
$arResult["ActiveFeatures"] = CSocNetFeatures::GetActiveFeaturesNames(SONET_ENTITY_GROUP, $arGadgetParams["GROUP_ID"]);
} else {
$arResult["ActiveFeatures"] = array();
}
if ($arGadgetParams["EVENT_ID"] == "system") {
$sTitle = GetMessage('GD_UPDATES_ENTITY_SYSTEM');
} elseif ($arGadgetParams["EVENT_ID"] == "forum") {
$sTitle = array_key_exists("forum", $arResult["ActiveFeatures"]) && strlen($arResult["ActiveFeatures"]["forum"]) > 0 ? $arResult["ActiveFeatures"]["forum"] : GetMessage('GD_UPDATES_ENTITY_FORUM');
} elseif ($arGadgetParams["EVENT_ID"] == "blog") {
$sTitle = array_key_exists("blog", $arResult["ActiveFeatures"]) && strlen($arResult["ActiveFeatures"]["blog"]) > 0 ? $arResult["ActiveFeatures"]["blog"] : GetMessage('GD_UPDATES_ENTITY_BLOG');
} elseif ($arGadgetParams["EVENT_ID"] == "tasks") {
$sTitle = array_key_exists("tasks", $arResult["ActiveFeatures"]) && strlen($arResult["ActiveFeatures"]["tasks"]) > 0 ? $arResult["ActiveFeatures"]["tasks"] : GetMessage('GD_UPDATES_ENTITY_TASKS');
} elseif ($arGadgetParams["EVENT_ID"] == "calendar") {
$sTitle = array_key_exists("calendar", $arResult["ActiveFeatures"]) && strlen($arResult["ActiveFeatures"]["calendar"]) > 0 ? $arResult["ActiveFeatures"]["calendar"] : GetMessage('GD_UPDATES_ENTITY_CALENDAR');
} elseif ($arGadgetParams["EVENT_ID"] == "photo") {
$sTitle = array_key_exists("photo", $arResult["ActiveFeatures"]) && strlen($arResult["ActiveFeatures"]["photo"]) > 0 ? $arResult["ActiveFeatures"]["photo"] : GetMessage('GD_UPDATES_ENTITY_PHOTO');
示例2: htmlspecialcharsex
$arResult["~IBLOCK"] = $arIBlock;
$arResult["IBLOCK"] = htmlspecialcharsex($arIBlock);
$arResult["IBLOCK_ID"] = intval($arIBlock["ID"]);
if (isset($arParams["SOCNET_GROUP_ID"]) && $arParams["SOCNET_GROUP_ID"] > 0) {
$arParams["SOCNET_GROUP_ID"] = intval($arParams["SOCNET_GROUP_ID"]);
} else {
$arParams["SOCNET_GROUP_ID"] = "";
}
if ($arParams["ADD_NAVCHAIN_GROUP"] === "Y" && $arParams["SOCNET_GROUP_ID"]) {
$arResult["~LISTS_URL"] = str_replace(array("#group_id#"), array($arParams["SOCNET_GROUP_ID"]), $arParams["~LISTS_URL"]);
$arResult["LISTS_URL"] = htmlspecialcharsbx($arResult["~LISTS_URL"]);
$arGroup = CSocNetGroup::GetByID($arParams["SOCNET_GROUP_ID"]);
if (!empty($arGroup)) {
$APPLICATION->AddChainItem($arGroup["NAME"], str_replace(array("#group_id#"), array($arParams["SOCNET_GROUP_ID"]), $arParams["~PATH_TO_GROUP"]));
$feature = "group_lists";
$arEntityActiveFeatures = CSocNetFeatures::GetActiveFeaturesNames(SONET_ENTITY_GROUP, $arGroup["ID"]);
$strFeatureTitle = array_key_exists($feature, $arEntityActiveFeatures) && StrLen($arEntityActiveFeatures[$feature]) > 0 ? $arEntityActiveFeatures[$feature] : GetMessage("CC_BLEN_BREADCRUMB_LISTS");
$APPLICATION->AddChainItem($strFeatureTitle, $arResult["~LISTS_URL"]);
}
}
if ($arParams["ADD_NAVCHAIN_LIST"] !== "N") {
$arResult["~LIST_URL"] = CHTTP::urlAddParams(str_replace(array("#list_id#", "#section_id#", "#group_id#"), array($arResult["IBLOCK_ID"], 0, $arParams["SOCNET_GROUP_ID"]), $arParams["~LIST_URL"]), array("list_section_id" => ""));
$arResult["LIST_URL"] = htmlspecialcharsbx($arResult["~LIST_URL"]);
$APPLICATION->AddChainItem($arResult["IBLOCK"]["NAME"], $arResult["~LIST_URL"]);
}
if ($arParams["ADD_NAVCHAIN_SECTIONS"] !== "N") {
$arResult["~LIST_SECTION_URL"] = str_replace(array("#list_id#", "#section_id#", "#group_id#"), array($arResult["IBLOCK_ID"], intval($arParams["~SECTION_ID"]), $arParams["SOCNET_GROUP_ID"]), $arParams["~LIST_URL"]);
$arResult["LIST_SECTION_URL"] = htmlspecialcharsbx($arResult["~LIST_SECTION_URL"]);
$rsElement = CIBlockElement::GetList(array(), array("IBLOCK_ID" => $arResult["IBLOCK_ID"], "=ID" => $arParams["ELEMENT_ID"], "CHECK_PERMISSIONS" => $lists_perm >= CListPermissions::CAN_READ ? "N" : "Y"), false, false, array("ID", "NAME", "IBLOCK_SECTION_ID"));
$arResult["ELEMENT"] = $rsElement->GetNext();
if (is_array($arResult["ELEMENT"])) {
示例3: GetMessage
}
/********************************************************************
Permission
********************************************************************/
if ($object == "user" && !CSocNetFeaturesPerms::CanPerformOperation($USER->GetID(), SONET_ENTITY_USER, $arResult["VARIABLES"]["user_id"], "photo", "view", CSocNetUser::IsCurrentUserModuleAdmin()) || $object == "group" && !CSocNetFeaturesPerms::CanPerformOperation($USER->GetID(), SONET_ENTITY_GROUP, $arResult["VARIABLES"]["group_id"], "photo", "view", CSocNetUser::IsCurrentUserModuleAdmin())) {
$arParams["ERROR_MESSAGE"] = GetMessage("SONET_ACCESS_DENIED");
return -1;
}
/********************************************************************
/Permission
********************************************************************/
/************** Navigation *****************************************/
$strTitle = "";
if ($arParams["SET_NAV_CHAIN"] == "Y" || $arParams["SET_TITLE"] == "Y") {
$feature = "photo";
$arEntityActiveFeatures = CSocNetFeatures::GetActiveFeaturesNames($object == 'group' ? SONET_ENTITY_GROUP : SONET_ENTITY_USER, $object == 'group' ? $arResult["VARIABLES"]["group_id"] : $arResult["VARIABLES"]["user_id"]);
$strFeatureTitle = array_key_exists($feature, $arEntityActiveFeatures) && StrLen($arEntityActiveFeatures[$feature]) > 0 ? $arEntityActiveFeatures[$feature] : GetMessage("SONET_PHOTO");
if ($object == "group") {
$arGroup = CSocNetGroup::GetByID($arResult["VARIABLES"]["group_id"]);
if ($arParams["SET_NAV_CHAIN"] == "Y") {
$APPLICATION->AddChainItem($arGroup["NAME"], CComponentEngine::MakePathFromTemplate($arResult["PATH_TO_GROUP"], array("group_id" => $arGroup["ID"])));
$APPLICATION->AddChainItem($strFeatureTitle, CComponentEngine::MakePathFromTemplate($arResult["PATH_TO_GROUP_PHOTO"], array("group_id" => $arGroup["ID"], "path" => "")));
}
$strTitle = $arGroup["NAME"] . ": " . $strFeatureTitle;
$arResult["GROUP"] = $arGroup;
} else {
if (strlen($arParams["NAME_TEMPLATE"]) <= 0) {
$arParams["NAME_TEMPLATE"] = CSite::GetNameFormat();
}
$arParams["TITLE_NAME_TEMPLATE"] = str_replace(array("#NOBR#", "#/NOBR#"), array("", ""), $arParams["NAME_TEMPLATE"]);
$bUseLogin = $arParams['SHOW_LOGIN'] != "N" ? true : false;
示例4: array
break;
default:
$suffix = "unknown";
}
$arMembers["USER_PERSONAL_PHOTO"] = COption::GetOptionInt("socialnetwork", "default_user_picture_" . $suffix, false, SITE_ID);
}
$arImage = CSocNetTools::InitImage($arMembers["USER_PERSONAL_PHOTO"], $arParams["THUMBNAIL_LIST_SIZE"], "/bitrix/images/socialnetwork/nopic_30x30.gif", 30, $pu, $canViewProfile);
} else {
// old
$arImage = CSocNetTools::InitImage($arMembers["USER_PERSONAL_PHOTO"], 50, "/bitrix/images/socialnetwork/nopic_user_50.gif", 50, $pu, $canViewProfile);
}
$arResult["Members"]["List"][] = array("ID" => $arMembers["ID"], "USER_ID" => $arMembers["USER_ID"], "USER_NAME" => $arMembers["USER_NAME"], "USER_LAST_NAME" => $arMembers["USER_LAST_NAME"], "USER_SECOND_NAME" => $arMembers["USER_SECOND_NAME"], "USER_WORK_POSITION" => $arMembers["USER_WORK_POSITION"], "USER_LOGIN" => $arMembers["USER_LOGIN"], "USER_PERSONAL_PHOTO" => $arMembers["USER_PERSONAL_PHOTO"], "USER_PERSONAL_PHOTO_FILE" => $arImage["FILE"], "USER_PERSONAL_PHOTO_IMG" => $arImage["IMG"], "USER_PROFILE_URL" => $pu, "SHOW_PROFILE_LINK" => $canViewProfile, "USER_IS_EXTRANET" => $arExtranetUserID && in_array($arMembers["USER_ID"], $arExtranetUserID) ? "Y" : "N");
}
}
//Blog
$arResult["ActiveFeatures"] = CSocNetFeatures::GetActiveFeaturesNames(SONET_ENTITY_GROUP, $arResult["Group"]["ID"]);
$arResult["BLOG"] = array("SHOW" => false, "TITLE" => GetMessage("SONET_C6_BLOG_T"));
if (array_key_exists("blog", $arResult["ActiveFeatures"]) && (CSocNetFeaturesPerms::CanPerformOperation($USER->GetID(), SONET_ENTITY_GROUP, $arResult["Group"]["ID"], "blog", "view_post", CSocNetUser::IsCurrentUserModuleAdmin()) || $APPLICATION->GetGroupRight("forum") >= "W") && CModule::IncludeModule("blog")) {
$arResult["BLOG"]["SHOW"] = true;
if (StrLen($arResult["ActiveFeatures"]["blog"]) > 0) {
$arResult["BLOG"]["TITLE"] = $arResult["ActiveFeatures"]["blog"];
}
}
$arResult["forum"] = array("SHOW" => false, "TITLE" => GetMessage("SONET_C6_FORUM_T"));
if (array_key_exists("forum", $arResult["ActiveFeatures"]) && (CSocNetFeaturesPerms::CanPerformOperation($USER->GetID(), SONET_ENTITY_GROUP, $arResult["Group"]["ID"], "forum", "view", CSocNetUser::IsCurrentUserModuleAdmin()) || $APPLICATION->GetGroupRight("forum") >= "W") && CModule::IncludeModule("forum")) {
$arResult["forum"]["SHOW"] = true;
if (StrLen($arResult["ActiveFeatures"]["forum"]) > 0) {
$arResult["forum"]["TITLE"] = $arResult["ActiveFeatures"]["forum"];
}
}
$arResult["tasks"] = array("SHOW" => false, "TITLE" => GetMessage("SONET_C6_TASKS_T"));
示例5: array
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
if (!CModule::IncludeModule("socialnetwork")) {
return;
}
$arResult = CSocNetFeatures::GetActiveFeaturesNames(SONET_ENTITY_USER, $USER->GetID());
$p = array("user_id" => $USER->GetID());
$arGadgetParams["PATH_TO_GENERAL"] = isset($arGadgetParams["PATH_TO_GENERAL"]) ? $arGadgetParams["PATH_TO_GENERAL"] : "/company/personal/user/#user_id#/";
$arGadgetParams["PATH_TO_PROFILE_EDIT"] = isset($arGadgetParams["PATH_TO_PROFILE_EDIT"]) ? $arGadgetParams["PATH_TO_PROFILE_EDIT"] : "/company/personal/user/#user_id#/edit/";
$arGadgetParams["PATH_TO_LOG"] = isset($arGadgetParams["PATH_TO_LOG"]) ? $arGadgetParams["PATH_TO_LOG"] : "/company/personal/log/";
$arGadgetParams["PATH_TO_SUBSCR"] = isset($arGadgetParams["PATH_TO_SUBSCR"]) ? $arGadgetParams["PATH_TO_SUBSCR"] : "/company/personal/subscribe/";
$arGadgetParams["PATH_TO_MSG"] = isset($arGadgetParams["PATH_TO_MSG"]) ? $arGadgetParams["PATH_TO_MSG"] : "/company/personal/messages/";
$arGadgetParams["PATH_TO_GROUPS"] = isset($arGadgetParams["PATH_TO_GROUPS"]) ? $arGadgetParams["PATH_TO_GROUPS"] : "/company/personal/user/#user_id#/groups/";
$arGadgetParams["PATH_TO_GROUP_NEW"] = isset($arGadgetParams["PATH_TO_GROUP_NEW"]) ? $arGadgetParams["PATH_TO_GROUP_NEW"] : "/company/personal/user/#user_id#/groups/create/";
$arGadgetParams["PATH_TO_PHOTO"] = isset($arGadgetParams["PATH_TO_PHOTO"]) ? $arGadgetParams["PATH_TO_PHOTO"] : "/company/personal/user/#user_id#/photo/";
$arGadgetParams["PATH_TO_PHOTO_NEW"] = isset($arGadgetParams["PATH_TO_PHOTO_NEW"]) ? $arGadgetParams["PATH_TO_PHOTO_NEW"] : "/company/personal/user/#user_id#/photo/photo/0/action/upload/";
$arGadgetParams["PATH_TO_FORUM"] = isset($arGadgetParams["PATH_TO_FORUM"]) ? $arGadgetParams["PATH_TO_FORUM"] : "/company/personal/user/#user_id#/forum/";
$arGadgetParams["PATH_TO_BLOG"] = isset($arGadgetParams["PATH_TO_BLOG"]) ? $arGadgetParams["PATH_TO_BLOG"] : "/company/personal/user/#user_id#/blog/";
$arGadgetParams["PATH_TO_BLOG_NEW"] = isset($arGadgetParams["PATH_TO_BLOG_NEW"]) ? $arGadgetParams["PATH_TO_BLOG_NEW"] : "/company/personal/user/#user_id#/blog/edit/new/";
$arGadgetParams["PATH_TO_CAL"] = isset($arGadgetParams["PATH_TO_CAL"]) ? $arGadgetParams["PATH_TO_CAL"] : "/company/personal/user/#user_id#/calendar/";
$arGadgetParams["PATH_TO_TASK"] = isset($arGadgetParams["PATH_TO_TASK"]) ? $arGadgetParams["PATH_TO_TASK"] : "/company/personal/user/#user_id#/tasks/";
$arGadgetParams["PATH_TO_TASK_NEW"] = isset($arGadgetParams["PATH_TO_TASK_NEW"]) ? $arGadgetParams["PATH_TO_TASK_NEW"] : "/company/personal/user/#user_id#/tasks/task/edit/0/";
$arGadgetParams["PATH_TO_LIB"] = isset($arGadgetParams["PATH_TO_LIB"]) ? $arGadgetParams["PATH_TO_LIB"] : "/company/personal/user/#user_id#/files/lib/";
?>
<ul>
<?php
if ($arGadgetParams["SHOW_GENERAL"] != "N") {
示例6: ShowError
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
$pageId = "group_content_search";
include "util_group_menu.php";
include "util_group_profile.php";
$arGroupFields = $arGroup;
if (!CSocNetFeaturesPerms::CanPerformOperation($GLOBALS["USER"]->GetID(), SONET_ENTITY_GROUP, $arResult["VARIABLES"]["group_id"], "search", "view", CSocNetUser::IsCurrentUserModuleAdmin())) {
ShowError(GetMessage("GROUP_CONTENT_SEARCH_DISABLED"));
return false;
}
if (is_array($arGroupFields) && array_key_exists("NAME", $arGroupFields) && strlen(trim($arGroupFields["NAME"])) > 0) {
$feature = "search";
$arEntityActiveFeatures = CSocNetFeatures::GetActiveFeaturesNames(SONET_ENTITY_GROUP, $arResult["VARIABLES"]["group_id"]);
$strFeatureTitle = array_key_exists($feature, $arEntityActiveFeatures) && StrLen($arEntityActiveFeatures[$feature]) > 0 ? $arEntityActiveFeatures[$feature] : GetMessage("GROUP_CONTENT_SEARCH_TITLE");
$GLOBALS["APPLICATION"]->SetTitle($arGroupFields["NAME"] . ": " . $strFeatureTitle);
}
$APPLICATION->IncludeComponent("bitrix:search.page", "tags_icons", array("RESTART" => $arParams["SEARCH_RESTART"], "USE_LANGUAGE_GUESS" => $arParams["SEARCH_USE_LANGUAGE_GUESS"], "CHECK_DATES" => "N", "USE_TITLE_RANK" => "N", "FILTER_NAME" => $arParams["SEARCH_FILTER_NAME"], "FILTER_DATE_NAME" => $arParams["SEARCH_FILTER_DATE_NAME"], "arrFILTER" => array(0 => "socialnetwork"), "arrFILTER_socialnetwork" => array(0 => $arResult["VARIABLES"]["group_id"]), "SHOW_WHERE" => "N", "arrWHERE_SONET" => array(0 => "forum", 1 => "blog", 2 => "tasks", 3 => "photo", 4 => "files"), "DEFAULT_SORT" => strlen($_REQUEST["tags"]) > 0 ? "date" : $arParams["SEARCH_DEFAULT_SORT"], "PAGE_RESULT_COUNT" => $arParams["SEARCH_PAGE_RESULT_COUNT"], "AJAX_MODE" => "N", "AJAX_OPTION_SHADOW" => "Y", "AJAX_OPTION_JUMP" => "N", "AJAX_OPTION_STYLE" => "Y", "AJAX_OPTION_HISTORY" => "N", "CACHE_TYPE" => "A", "CACHE_TIME" => "3600", "PAGER_TITLE" => GetMessage("GROUP_CONTENT_SEARCH_RESULTS"), "PAGER_SHOW_ALWAYS" => "N", "PAGER_TEMPLATE" => "", "TAGS_SORT" => "NAME", "TAGS_PAGE_ELEMENTS" => $arParams["SEARCH_TAGS_PAGE_ELEMENTS"], "TAGS_PERIOD" => $arParams["SEARCH_TAGS_PERIOD"], "TAGS_URL_SEARCH" => CComponentEngine::MakePathFromTemplate($arParams["~PATH_TO_GROUP_CONTENT_SEARCH"], array("group_id" => $arResult["VARIABLES"]["group_id"])), "TAGS_INHERIT" => "Y", "FONT_MAX" => $arParams["SEARCH_TAGS_FONT_MAX"], "FONT_MIN" => $arParams["SEARCH_TAGS_FONT_MIN"], "COLOR_NEW" => $arParams["SEARCH_TAGS_COLOR_NEW"], "COLOR_OLD" => $arParams["SEARCH_TAGS_COLOR_OLD"], "PERIOD_NEW_TAGS" => "", "SHOW_CHAIN" => "Y", "COLOR_TYPE" => "Y", "WIDTH" => "100%", "AJAX_OPTION_ADDITIONAL" => "", "SHOW_RATING" => $arParams["SHOW_RATING"], "RATING_TYPE" => $arParams["RATING_TYPE"], "PATH_TO_USER" => $arResult["PATH_TO_USER"], "PATH_TO_GROUP_BLOG" => $arResult["PATH_TO_GROUP_BLOG"], "PATH_TO_GROUP_FORUM" => $arResult["PATH_TO_GROUP_FORUM"], "PATH_TO_GROUP_FILES" => $arResult["PATH_TO_GROUP_FILES"], "PATH_TO_GROUP_FILES_SECTION" => $arResult["PATH_TO_GROUP_FILES"], "PATH_TO_GROUP_TASKS" => $arResult["PATH_TO_GROUP_TASKS"], "PATH_TO_GROUP_TASKS_SECTION" => $arResult["PATH_TO_GROUP_TASKS"], "PATH_TO_GROUP_PHOTO" => $arResult["PATH_TO_GROUP_PHOTO"], "PATH_TO_GROUP_PHOTO_SECTION" => $arResult["PATH_TO_GROUP_PHOTO_SECTION"], "PATH_TO_GROUP_CALENDAR" => $arResult["PATH_TO_GROUP_CALENDAR"], "SOCNET_GROUP_ID" => $arResult["VARIABLES"]["group_id"], "FILES_GROUP_IBLOCK_ID" => $arParams["FILES_GROUP_IBLOCK_ID"], "CALENDAR_GROUP_IBLOCK_ID" => $arParams["CALENDAR_GROUP_IBLOCK_ID"], "TASKS_GROUP_IBLOCK_ID" => $arParams["TASK_IBLOCK_ID"], "PHOTO_GROUP_IBLOCK_ID" => $arParams["PHOTO_GROUP_IBLOCK_ID"]), $component);
示例7: array
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
if (!CModule::IncludeModule("socialnetwork")) {
return false;
}
if (intval($arGadgetParams["USER_ID"]) > 0) {
$arActiveFeatures = CSocNetFeatures::GetActiveFeaturesNames(SONET_ENTITY_USER, $arGadgetParams["USER_ID"]);
$bSearch = array_key_exists("search", $arActiveFeatures);
}
if ($bSearch) {
?>
<?php
$GLOBALS["APPLICATION"]->IncludeComponent("bitrix:search.tags.cloud", "gadget", array("PAGE_ELEMENTS" => $arGadgetParams["PAGE_ELEMENTS"], "PERIOD" => $arGadgetParams["PERIOD"], "URL_SEARCH" => CComponentEngine::MakePathFromTemplate($arGadgetParams["PATH_TO_USER_CONTENT_SEARCH"], array("user_id" => $arGadgetParams["USER_ID"])), "FONT_MAX" => $arGadgetParams["FONT_MAX"], "FONT_MIN" => $arGadgetParams["FONT_MIN"], "COLOR_NEW" => $arGadgetParams["COLOR_NEW"], "COLOR_OLD" => $arParams["COLOR_OLD"], "WIDTH" => "100%", "SORT" => "NAME", "CACHE_TIME" => $arParams["CACHE_TIME"], "CACHE_TYPE" => $arParams["CACHE_TYPE"], "arrFILTER" => array(0 => "socialnetwork_user"), "arrFILTER_socialnetwork_user" => array(0 => $arGadgetParams["USER_ID"])), false, array("HIDE_ICONS" => "Y"));
?>
<?php
} else {
echo GetMessage('GD_SONET_USER_TAGS_FEATURE_INACTIVE');
}
示例8: preg_replace
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
$sPageName = $arResult['ELEMENT']['NAME'] = CWikiUtils::htmlspecialcharsback($arResult['ELEMENT']['NAME'], false);
$sCatName = '';
if (CWikiUtils::IsCategoryPage($sPageName, $sCatName)) {
$sPageName = preg_replace('/^category:/i' . BX_UTF_PCRE_MODIFIER, GetMessage('CATEGORY_NAME') . ':', $sPageName);
}
if (CWikiSocnet::IsSocNet()) {
if (intval($arParams["SOCNET_GROUP_ID"]) > 0 && (empty($arParams['SET_TITLE']) || $arParams['SET_TITLE'] != 'N' || $this->GetParent()->arResult['SET_NAV_CHAIN'] == 'Y')) {
$arGroup = CSocNetGroup::GetByID($arParams["SOCNET_GROUP_ID"]);
$arActiveFeatures = CSocNetFeatures::GetActiveFeaturesNames(SONET_ENTITY_GROUP, $arParams["SOCNET_GROUP_ID"]);
$sFeatureName = array_key_exists("wiki", $arActiveFeatures) && strlen($arActiveFeatures["wiki"]) > 0 ? $arActiveFeatures["wiki"] : GetMessage("WIKI_SOCNET_TAB");
}
if (empty($arParams['SET_TITLE']) || $arParams['SET_TITLE'] != 'N') {
$APPLICATION->SetTitle($arGroup["NAME"] . ": " . $sFeatureName . (!empty($sPageName) ? ": " . $sPageName : ''));
}
if ($this->GetParent()->arResult['SET_NAV_CHAIN'] == 'Y') {
$APPLICATION->AddChainItem($arGroup["NAME"], CComponentEngine::MakePathFromTemplate($this->GetParent()->arResult['PATH_TO_GROUP'], array('group_id' => CWikiSocnet::$iSocNetId)));
$APPLICATION->AddChainItem($sFeatureName, CComponentEngine::MakePathFromTemplate($this->GetParent()->arResult['PATH_TO_GROUP_WIKI_INDEX'], array('group_id' => CWikiSocnet::$iSocNetId, 'wiki_name' => urlencode($arResult['ELEMENT']['NAME']))));
}
} else {
if ($arParams['IN_COMPLEX'] == 'Y') {
$sNavItem = $this->GetParent()->arParams['NAV_ITEM'];
$sSefFolder = $this->GetParent()->arParams['SEF_FOLDER'];
if (!empty($sNavItem)) {
$APPLICATION->AddChainItem($sNavItem, $sSefFolder);
}
}
示例9: array
if ($this->__component->__parent && $this->__component->__parent->arResult && array_key_exists("PATH_TO_USER_CALENDAR", $this->__component->__parent->arResult)) {
$arResult["Urls"]["Calendar"] = CComponentEngine::MakePathFromTemplate($this->__component->__parent->arResult["PATH_TO_USER_CALENDAR"], array("user_id" => $GLOBALS["USER"]->GetID()));
}
if ($this->__component->__parent && $this->__component->__parent->arResult && array_key_exists("PATH_TO_USER_TASKS", $this->__component->__parent->arResult)) {
$arResult["Urls"]["Tasks"] = CComponentEngine::MakePathFromTemplate($this->__component->__parent->arResult["PATH_TO_USER_TASKS"], array("user_id" => $GLOBALS["USER"]->GetID()));
}
if ($this->__component->__parent && $this->__component->__parent->arResult && array_key_exists("PATH_TO_USER_FILES", $this->__component->__parent->arResult)) {
$arResult["Urls"]["Files"] = CComponentEngine::MakePathFromTemplate($this->__component->__parent->arResult["PATH_TO_USER_FILES"], array("user_id" => $GLOBALS["USER"]->GetID(), "path" => ""));
}
if ($this->__component->__parent && $this->__component->__parent->arResult && array_key_exists("PATH_TO_USER_CONTENT_SEARCH", $this->__component->__parent->arResult)) {
$arResult["Urls"]["content_search"] = CComponentEngine::MakePathFromTemplate($this->__component->__parent->arResult["PATH_TO_USER_CONTENT_SEARCH"], array("user_id" => $GLOBALS["USER"]->GetID()));
}
$arResult["Urls"]["Settings"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_SETTINGS_EDIT"], array("user_id" => $GLOBALS["USER"]->GetID()));
$arResult["Urls"]["Features"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_FEATURES"], array("user_id" => $GLOBALS["USER"]->GetID()));
// $arResult["Urls"]["Subscribe"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_SUBSCRIBE"], array("user_id" => $GLOBALS["USER"]->GetID()));
$arResult["ActiveFeatures"] = CSocNetFeatures::GetActiveFeaturesNames(SONET_ENTITY_USER, $GLOBALS["USER"]->GetID());
$arResult["CanView"]["blog"] = array_key_exists("blog", $arResult["ActiveFeatures"]) && CSocNetFeaturesPerms::CanPerformOperation($GLOBALS["USER"]->GetID(), SONET_ENTITY_USER, $GLOBALS["USER"]->GetID(), "blog", "view_post", CSocNetUser::IsCurrentUserModuleAdmin());
$arResult["CanView"]["microblog"] = array_key_exists("microblog", $arResult["ActiveFeatures"]) && CSocNetFeaturesPerms::CanPerformOperation($GLOBALS["USER"]->GetID(), SONET_ENTITY_USER, $GLOBALS["USER"]->GetID(), "blog", "view_post", CSocNetUser::IsCurrentUserModuleAdmin());
$arResult["CanView"]["photo"] = array_key_exists("photo", $arResult["ActiveFeatures"]) && CSocNetFeaturesPerms::CanPerformOperation($GLOBALS["USER"]->GetID(), SONET_ENTITY_USER, $GLOBALS["USER"]->GetID(), "photo", "view", CSocNetUser::IsCurrentUserModuleAdmin());
$arResult["CanView"]["forum"] = array_key_exists("forum", $arResult["ActiveFeatures"]) && CSocNetFeaturesPerms::CanPerformOperation($GLOBALS["USER"]->GetID(), SONET_ENTITY_USER, $GLOBALS["USER"]->GetID(), "forum", "view", CSocNetUser::IsCurrentUserModuleAdmin());
$arResult["CanView"]["calendar"] = array_key_exists("calendar", $arResult["ActiveFeatures"]) && CSocNetFeaturesPerms::CanPerformOperation($GLOBALS["USER"]->GetID(), SONET_ENTITY_USER, $GLOBALS["USER"]->GetID(), "calendar", "view", CSocNetUser::IsCurrentUserModuleAdmin());
$arResult["CanView"]["tasks"] = array_key_exists("tasks", $arResult["ActiveFeatures"]) && CSocNetFeaturesPerms::CanPerformOperation($GLOBALS["USER"]->GetID(), SONET_ENTITY_USER, $GLOBALS["USER"]->GetID(), "tasks", "view", CSocNetUser::IsCurrentUserModuleAdmin());
$arResult["CanView"]["files"] = array_key_exists("files", $arResult["ActiveFeatures"]) && CSocNetFeaturesPerms::CanPerformOperation($GLOBALS["USER"]->GetID(), SONET_ENTITY_USER, $GLOBALS["USER"]->GetID(), "files", "view", CSocNetUser::IsCurrentUserModuleAdmin());
$arResult["CanView"]["content_search"] = array_key_exists("search", $arResult["ActiveFeatures"]) && CSocNetFeaturesPerms::CanPerformOperation($GLOBALS["USER"]->GetID(), SONET_ENTITY_USER, $GLOBALS["USER"]->GetID(), "search", "view", CSocNetUser::IsCurrentUserModuleAdmin());
$arResult["Title"]["blog"] = array_key_exists("blog", $arResult["ActiveFeatures"]) && StrLen($arResult["ActiveFeatures"]["blog"]) > 0 ? $arResult["ActiveFeatures"]["blog"] : GetMessage("SONET_UM_BLOG");
$arResult["Title"]["microblog"] = array_key_exists("microblog", $arResult["ActiveFeatures"]) && StrLen($arResult["ActiveFeatures"]["microblog"]) > 0 ? $arResult["ActiveFeatures"]["microblog"] : GetMessage("SONET_UM_MICROBLOG");
$arResult["Title"]["photo"] = array_key_exists("photo", $arResult["ActiveFeatures"]) && StrLen($arResult["ActiveFeatures"]["photo"]) > 0 ? $arResult["ActiveFeatures"]["photo"] : GetMessage("SONET_UM_PHOTO");
$arResult["Title"]["forum"] = array_key_exists("forum", $arResult["ActiveFeatures"]) && StrLen($arResult["ActiveFeatures"]["forum"]) > 0 ? $arResult["ActiveFeatures"]["forum"] : GetMessage("SONET_UM_FORUM");
$arResult["Title"]["calendar"] = array_key_exists("calendar", $arResult["ActiveFeatures"]) && StrLen($arResult["ActiveFeatures"]["calendar"]) > 0 ? $arResult["ActiveFeatures"]["calendar"] : GetMessage("SONET_UM_CALENDAR");
$arResult["Title"]["tasks"] = array_key_exists("tasks", $arResult["ActiveFeatures"]) && StrLen($arResult["ActiveFeatures"]["tasks"]) > 0 ? $arResult["ActiveFeatures"]["tasks"] : GetMessage("SONET_UM_TASKS");
$arResult["Title"]["files"] = array_key_exists("files", $arResult["ActiveFeatures"]) && StrLen($arResult["ActiveFeatures"]["files"]) > 0 ? $arResult["ActiveFeatures"]["files"] : GetMessage("SONET_UM_FILES");
示例10: trim
// Set title and navigation
$arParams["SET_TITLE"] = $arParams["SET_TITLE"] == "Y" ? "Y" : "N";
$arParams["SET_NAV_CHAIN"] = $arParams["SET_NAV_CHAIN"] == "Y" ? "Y" : "N";
//Turn OFF by default
if ($arParams["STR_TITLE"]) {
$arParams["STR_TITLE"] = trim($arParams["STR_TITLE"]);
} else {
if (!$arParams['OWNER_ID'] && $arParams['CALENDAR_TYPE'] == "group") {
return ShowError(GetMessage('EC_GROUP_ID_NOT_FOUND'));
}
if (!$arParams['OWNER_ID'] && $arParams['CALENDAR_TYPE'] == "user") {
return ShowError(GetMessage('EC_USER_ID_NOT_FOUND'));
}
if ($arParams['CALENDAR_TYPE'] == "group" || $arParams['CALENDAR_TYPE'] == "user") {
$feature = "calendar";
$arEntityActiveFeatures = CSocNetFeatures::GetActiveFeaturesNames($arParams['CALENDAR_TYPE'] == "group" ? SONET_ENTITY_GROUP : SONET_ENTITY_USER, $arParams['OWNER_ID']);
$strFeatureTitle = array_key_exists($feature, $arEntityActiveFeatures) && StrLen($arEntityActiveFeatures[$feature]) > 0 ? $arEntityActiveFeatures[$feature] : GetMessage("EC_SONET_CALENDAR");
$arParams["STR_TITLE"] = $strFeatureTitle;
} else {
$arParams["STR_TITLE"] = GetMessage("EC_SONET_CALENDAR");
}
}
$bOwner = $arParams["CALENDAR_TYPE"] == 'user' || $arParams["CALENDAR_TYPE"] == 'group';
if ($arParams["SET_TITLE"] == "Y" || $bOwner && $arParams["SET_NAV_CHAIN"] == "Y") {
$ownerName = '';
if ($bOwner) {
$ownerName = CCalendar::GetOwnerName($arParams["CALENDAR_TYPE"], $arParams["OWNER_ID"]);
}
if ($arParams["SET_TITLE"] == "Y") {
$title_short = empty($arParams["STR_TITLE"]) ? GetMessage("WD_TITLE") : $arParams["STR_TITLE"];
$title = ($ownerName ? $ownerName . ': ' : '') . $title_short;
示例11: SetGroup
function SetGroup($entityID, $bSetFeatures = false)
{
global $APPLICATION, $DB;
$entityID = IntVal($entityID);
if ($entityID <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_EUV_EMPTY_ENTITY_ID"), "ERROR_EMPTY_ENTITY_ID");
return false;
}
$arGroup = CSocNetGroup::GetByID($entityID);
if (!$arGroup) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_EUV_NO_ENTITY"), "SONET_EUV_NO_ENTITY");
return false;
}
$arLogEvent = array();
$arSocNetLogEvents = CSocNetAllowed::GetAllowedLogEvents();
foreach ($arSocNetLogEvents as $event_tmp_id => $arLogEventTmp) {
if (!array_key_exists("ENTITIES", $arLogEventTmp) || !array_key_exists(SONET_SUBSCRIBE_ENTITY_GROUP, $arLogEventTmp["ENTITIES"])) {
continue;
}
if (array_key_exists("NO_SET", $arLogEventTmp) && $arLogEventTmp["NO_SET"]) {
continue;
}
$arLogEvent[] = $event_tmp_id;
if (array_key_exists("COMMENT_EVENT", $arLogEventTmp) && is_array($arLogEventTmp["COMMENT_EVENT"]) && array_key_exists("EVENT_ID", $arLogEventTmp["COMMENT_EVENT"]) && strlen($arLogEventTmp["COMMENT_EVENT"]["EVENT_ID"]) > 0) {
$arLogEvent[] = $arLogEventTmp["COMMENT_EVENT"]["EVENT_ID"];
}
}
$arLogEvent = array_unique($arLogEvent);
foreach ($arLogEvent as $event_tmp_id) {
if (!CSocNetEventUserView::Delete(SONET_ENTITY_GROUP, $entityID, $event_tmp_id)) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_EUV_ERROR_DELETE"), "ERROR_DELETE");
return false;
}
}
$dbResult = CSocNetUserToGroup::GetList(array(), array("GROUP_ID" => $entityID, "<=ROLE" => SONET_ROLES_USER, "USER_ACTIVE" => "Y"), false, false, array("USER_ID"));
while ($arResult = $dbResult->Fetch()) {
foreach ($arLogEvent as $event_tmp_id) {
$arFields = array("ENTITY_TYPE" => SONET_ENTITY_GROUP, "ENTITY_ID" => $entityID, "EVENT_ID" => $event_tmp_id, "USER_ID" => $arResult["USER_ID"], "USER_ANONYMOUS" => "N");
if (!CSocNetEventUserView::Add($arFields)) {
$errorMessage = "";
if ($e = $APPLICATION->GetException()) {
$errorMessage = $e->GetString();
}
if (StrLen($errorMessage) <= 0) {
$errorMessage = GetMessage("SONET_EUV_ERROR_SET");
}
$APPLICATION->ThrowException($errorMessage, "ERROR_SET");
return false;
}
}
}
if ($bSetFeatures) {
$arActiveFeatures = array_keys(CSocNetFeatures::GetActiveFeaturesNames(SONET_ENTITY_GROUP, $entityID));
foreach ($arActiveFeatures as $feature) {
CSocNetEventUserView::SetFeature(SONET_ENTITY_GROUP, $entityID, $feature);
}
}
return true;
}
示例12: ShowError
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
$pageId = "user_content_search";
include "util_menu.php";
include "util_profile.php";
if (!CSocNetFeaturesPerms::CanPerformOperation($GLOBALS["USER"]->GetID(), SONET_ENTITY_USER, $arResult["VARIABLES"]["user_id"], "search", "view", CSocNetUser::IsCurrentUserModuleAdmin())) {
ShowError(GetMessage("USER_CONTENT_SEARCH_DISABLED"));
return false;
}
if (isset($arUserFields["NAME"]) && strlen(trim($arUserFields["NAME"])) > 0) {
$feature = "search";
$arEntityActiveFeatures = CSocNetFeatures::GetActiveFeaturesNames(SONET_ENTITY_USER, $arResult["VARIABLES"]["user_id"]);
$strFeatureTitle = array_key_exists($feature, $arEntityActiveFeatures) && StrLen($arEntityActiveFeatures[$feature]) > 0 ? $arEntityActiveFeatures[$feature] : GetMessage("USER_CONTENT_SEARCH_TITLE");
$GLOBALS["APPLICATION"]->SetTitle($arUserFields["NAME"] . ": " . $strFeatureTitle);
}
$APPLICATION->IncludeComponent("bitrix:search.page", "tags_icons_user", array("RESTART" => $arParams["SEARCH_RESTART"], "USE_LANGUAGE_GUESS" => $arParams["SEARCH_USE_LANGUAGE_GUESS"], "CHECK_DATES" => "N", "USE_TITLE_RANK" => "N", "FILTER_NAME" => $arParams["SEARCH_FILTER_NAME"], "FILTER_DATE_NAME" => $arParams["SEARCH_FILTER_DATE_NAME"], "arrFILTER" => array(0 => "socialnetwork_user"), "arrFILTER_socialnetwork_user" => $arResult["VARIABLES"]["user_id"], "SHOW_WHERE" => "N", "arrWHERE_SONET" => array(0 => "forum", 1 => "blog", 2 => "tasks", 3 => "photo", 4 => "files"), "DEFAULT_SORT" => strlen($_REQUEST["tags"]) > 0 ? "date" : $arParams["SEARCH_DEFAULT_SORT"], "PAGE_RESULT_COUNT" => $arParams["SEARCH_PAGE_RESULT_COUNT"], "AJAX_MODE" => "N", "AJAX_OPTION_SHADOW" => "Y", "AJAX_OPTION_JUMP" => "N", "AJAX_OPTION_STYLE" => "Y", "AJAX_OPTION_HISTORY" => "N", "CACHE_TYPE" => "A", "CACHE_TIME" => "3600", "PAGER_TITLE" => GetMessage("USER_CONTENT_SEARCH_RESULTS"), "PAGER_SHOW_ALWAYS" => "N", "PAGER_TEMPLATE" => "", "TAGS_SORT" => "NAME", "TAGS_PAGE_ELEMENTS" => $arParams["SEARCH_TAGS_PAGE_ELEMENTS"], "TAGS_PERIOD" => $arParams["SEARCH_TAGS_PERIOD"], "TAGS_URL_SEARCH" => CComponentEngine::MakePathFromTemplate($arParams["~PATH_TO_USER_CONTENT_SEARCH"], array("user_id" => $arResult["VARIABLES"]["user_id"])), "TAGS_INHERIT" => "Y", "FONT_MAX" => $arParams["SEARCH_TAGS_FONT_MAX"], "FONT_MIN" => $arParams["SEARCH_TAGS_FONT_MIN"], "COLOR_NEW" => $arParams["SEARCH_TAGS_COLOR_NEW"], "COLOR_OLD" => $arParams["SEARCH_TAGS_COLOR_OLD"], "PERIOD_NEW_TAGS" => "", "SHOW_CHAIN" => "Y", "COLOR_TYPE" => "Y", "WIDTH" => "100%", "AJAX_OPTION_ADDITIONAL" => "", "SHOW_RATING" => $arParams["SHOW_RATING"], "RATING_TYPE" => $arParams["RATING_TYPE"], "PATH_TO_USER" => $arResult["PATH_TO_USER"], "PATH_TO_USER_BLOG" => $arResult["PATH_TO_USER_BLOG"], "PATH_TO_USER_FORUM" => $arResult["PATH_TO_USER_FORUM"], "PATH_TO_USER_FILES" => $arResult["PATH_TO_USER_FILES"], "PATH_TO_USER_FILES_SECTION" => $arResult["PATH_TO_USER_FILES"], "PATH_TO_USER_TASKS" => $arResult["PATH_TO_USER_TASKS"], "PATH_TO_USER_TASKS_SECTION" => $arResult["PATH_TO_USER_TASKS"], "PATH_TO_USER_PHOTO" => $arResult["PATH_TO_USER_PHOTO"], "PATH_TO_USER_PHOTO_SECTION" => $arResult["PATH_TO_USER_PHOTO_SECTION"], "PATH_TO_USER_CALENDAR" => $arResult["PATH_TO_USER_CALENDAR"], "SOCNET_USER_ID" => $arResult["VARIABLES"]["user_id"], "FILES_USER_IBLOCK_ID" => $arParams["FILES_USER_IBLOCK_ID"], "CALENDAR_USER_IBLOCK_ID" => $arParams["CALENDAR_USER_IBLOCK_ID"], "TASKS_USER_IBLOCK_ID" => $arParams["TASK_IBLOCK_ID"], "PHOTO_USER_IBLOCK_ID" => $arParams["PHOTO_USER_IBLOCK_ID"]), $component);
示例13: array
$arResult["Urls"]["Groups"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_GROUPS"], array("user_id" => $arResult["User"]["ID"]));
$arResult["Urls"]["Search"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_SEARCH"], array());
$arResult["Urls"]["GroupsAdd"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_GROUPS_ADD"], array("user_id" => $arResult["User"]["ID"]));
$arResult["Urls"]["MessageForm"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_MESSAGE_FORM"], array("user_id" => $arResult["User"]["ID"]));
$arResult["Urls"]["Log"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_LOG"], array());
$arResult["Urls"]["Main"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arResult["User"]["ID"]));
$arResult["Urls"]["MessagesInput"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_MESSAGES_INPUT"], array());
$arResult["Urls"]["Blog"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_BLOG"], array("user_id" => $arResult["User"]["ID"]));
$arResult["Urls"]["Microblog"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_MICROBLOG"], array("user_id" => $arResult["User"]["ID"]));
$arResult["Urls"]["Photo"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_PHOTO"], array("user_id" => $arResult["User"]["ID"]));
$arResult["Urls"]["Forum"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_FORUM"], array("user_id" => $arResult["User"]["ID"]));
$arResult["Urls"]["Calendar"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_CALENDAR"], array("user_id" => $arResult["User"]["ID"]));
$arResult["Urls"]["Tasks"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_TASKS"], array("user_id" => $arResult["User"]["ID"]));
$arResult["Urls"]["Files"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_FILES"], array("user_id" => $arResult["User"]["ID"], "path" => ""));
$arResult["Urls"]["content_search"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_CONTENT_SEARCH"], array("user_id" => $arResult["User"]["ID"]));
$arResult["ActiveFeatures"] = isset($arResult["User"]["EXTERNAL_AUTH_ID"]) && $arResult["User"]["EXTERNAL_AUTH_ID"] == 'replica' ? array() : CSocNetFeatures::GetActiveFeaturesNames(SONET_ENTITY_USER, $arResult["User"]["ID"]);
$arResult["CanView"]["files"] = array_key_exists("files", $arResult["ActiveFeatures"]);
if ($arResult["CanView"]["files"]) {
$diskEnabled = CModule::includeModule('disk') && \Bitrix\Disk\Driver::isSuccessfullyConverted();
if ($diskEnabled) {
$arResult["Urls"]["Files"] = CComponentEngine::makePathFromTemplate($arParams["PATH_TO_USER_DISK"], array("user_id" => $arResult["User"]["ID"], "PATH" => ""));
}
}
$arResult["CanView"]["tasks"] = array_key_exists("tasks", $arResult["ActiveFeatures"]) && CSocNetFeaturesPerms::CanPerformOperation($GLOBALS["USER"]->GetID(), SONET_ENTITY_USER, $arResult["User"]["ID"], "tasks", "view", CSocNetUser::IsCurrentUserModuleAdmin());
$arResult["CanView"]["calendar"] = array_key_exists("calendar", $arResult["ActiveFeatures"]) && (!IsModuleInstalled("extranet") || isset($arResult["User"]["UF_DEPARTMENT"]) && is_array($arResult["User"]["UF_DEPARTMENT"]) && !empty($arResult["User"]["UF_DEPARTMENT"]));
$arResult["CanView"]["microblog"] = array_key_exists("microblog", $arResult["ActiveFeatures"]) && CSocNetFeaturesPerms::CanPerformOperation($GLOBALS["USER"]->GetID(), SONET_ENTITY_USER, $arResult["User"]["ID"], "blog", "view_post", CSocNetUser::IsCurrentUserModuleAdmin());
$arResult["CanView"]["blog"] = array_key_exists("blog", $arResult["ActiveFeatures"]) && CSocNetFeaturesPerms::CanPerformOperation($GLOBALS["USER"]->GetID(), SONET_ENTITY_USER, $arResult["User"]["ID"], "blog", "view_post", CSocNetUser::IsCurrentUserModuleAdmin());
$arResult["CanView"]["photo"] = array_key_exists("photo", $arResult["ActiveFeatures"]) && CSocNetFeaturesPerms::CanPerformOperation($GLOBALS["USER"]->GetID(), SONET_ENTITY_USER, $arResult["User"]["ID"], "photo", "view", CSocNetUser::IsCurrentUserModuleAdmin());
$arResult["CanView"]["forum"] = array_key_exists("forum", $arResult["ActiveFeatures"]) && CSocNetFeaturesPerms::CanPerformOperation($GLOBALS["USER"]->GetID(), SONET_ENTITY_USER, $arResult["User"]["ID"], "forum", "view", CSocNetUser::IsCurrentUserModuleAdmin());
$arResult["CanView"]["content_search"] = array_key_exists("search", $arResult["ActiveFeatures"]) && CSocNetFeaturesPerms::CanPerformOperation($GLOBALS["USER"]->GetID(), SONET_ENTITY_USER, $arResult["User"]["ID"], "search", "view", CSocNetUser::IsCurrentUserModuleAdmin());
$arResult["Title"]["blog"] = array_key_exists("blog", $arResult["ActiveFeatures"]) && StrLen($arResult["ActiveFeatures"]["blog"]) > 0 ? $arResult["ActiveFeatures"]["blog"] : GetMessage("SONET_UM_BLOG");
示例14: while
$arResult["Groups"]["List"] = false;
$arResult["Groups"]["ListFull"] = false;
while ($arGroups = $dbGroups->GetNext()) {
if ($arResult["Groups"]["ListFull"] == false) {
$arResult["Groups"]["ListFull"] = array();
}
$arResult["Groups"]["Count"]++;
$arResult["Groups"]["ListFull"][] = array("ID" => $arGroups["ID"], "GROUP_ID" => $arGroups["GROUP_ID"], "GROUP_NAME" => $arGroups["GROUP_NAME"], "GROUP_URL" => CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_GROUP"], array("group_id" => $arGroups["GROUP_ID"])));
}
if (is_array($arResult["Groups"]["ListFull"])) {
$arResult["Groups"]["List"] = array_slice($arResult["Groups"]["ListFull"], 0, $arParams["ITEMS_COUNT"]);
}
}
}
//Blog
$arResult["ActiveFeatures"] = CSocNetFeatures::GetActiveFeaturesNames(SONET_ENTITY_USER, $arResult["User"]["ID"]);
$arResult["BLOG"] = array("SHOW" => false, "TITLE" => GetMessage("SONET_C39_BLOG_TITLE"));
if (array_key_exists("blog", $arResult["ActiveFeatures"]) && (CSocNetFeaturesPerms::CanPerformOperation($USER->GetID(), SONET_ENTITY_USER, $arResult["User"]["ID"], "blog", "view_post", CSocNetUser::IsCurrentUserModuleAdmin()) || $APPLICATION->GetGroupRight("blog") >= "W") && CModule::IncludeModule("blog")) {
$arResult["BLOG"]["SHOW"] = true;
if (StrLen($arResult["ActiveFeatures"]["blog"]) > 0) {
$arResult["BLOG"]["TITLE"] = $arResult["ActiveFeatures"]["blog"];
}
}
$arResult["forum"] = array("SHOW" => false, "TITLE" => GetMessage("SONET_C39_FORUM_TITLE"));
if (array_key_exists("forum", $arResult["ActiveFeatures"]) && (CSocNetFeaturesPerms::CanPerformOperation($USER->GetID(), SONET_ENTITY_USER, $arResult["User"]["ID"], "forum", "view", CSocNetUser::IsCurrentUserModuleAdmin()) || $APPLICATION->GetGroupRight("forum") >= "W") && CModule::IncludeModule("forum")) {
$arResult["forum"]["SHOW"] = true;
if (StrLen($arResult["ActiveFeatures"]["forum"]) > 0) {
$arResult["forum"]["TITLE"] = $arResult["ActiveFeatures"]["forum"];
}
}
$arResult["tasks"] = array("SHOW" => false, "TITLE" => GetMessage("SONET_C39_TASKS_TITLE"));
示例15: array
} else {
return "";
}
} else {
return "";
}
}
}
if (strpos($componentPage, "user_content_search") === false) {
$arGroup = CSocNetGroup::GetByID($arResult["VARIABLES"]["group_id"]);
$APPLICATION->AddChainItem($arGroup["NAME"], CComponentEngine::MakePathFromTemplate(htmlspecialcharsbx($arResult["PATH_TO_GROUP"]), array("group_id" => $arGroup["ID"])));
} else {
$dbUser = CUser::GetByID($arResult["VARIABLES"]["user_id"]);
$arUser = $dbUser->Fetch();
if (strlen($arParams["NAME_TEMPLATE"]) <= 0) {
$arParams["NAME_TEMPLATE"] = CSite::GetNameFormat();
}
$arParams["TITLE_NAME_TEMPLATE"] = str_replace(array("#NOBR#", "#/NOBR#"), array("", ""), $arParams["NAME_TEMPLATE"]);
$bUseLogin = $arParams['SHOW_LOGIN'] != "N" ? true : false;
$strTitleFormatted = CUser::FormatName($arParams['TITLE_NAME_TEMPLATE'], $arUser, $bUseLogin);
$APPLICATION->AddChainItem($strTitleFormatted, CComponentEngine::MakePathFromTemplate(htmlspecialcharsbx($arResult["PATH_TO_USER"]), array("user_id" => $arUser["ID"])));
}
$feature = "search";
$arEntityActiveFeatures = CSocNetFeatures::GetActiveFeaturesNames(strpos($componentPage, "user_content_search") === false ? SONET_ENTITY_GROUP : SONET_ENTITY_USER, strpos($componentPage, "user_content_search") === false ? $arResult["VARIABLES"]["group_id"] : $arResult["VARIABLES"]["user_id"]);
$strFeatureTitle = array_key_exists($feature, $arEntityActiveFeatures) && StrLen($arEntityActiveFeatures[$feature]) > 0 ? $arEntityActiveFeatures[$feature] : GetMessage("SONET_CONTENT_SEARCH_CHAIN");
if (strpos($componentPage, "user_content_search") === false) {
$url = CComponentEngine::MakePathFromTemplate(htmlspecialcharsbx($arResult["PATH_TO_GROUP_CONTENT_SEARCH"]), array("group_id" => $arResult["VARIABLES"]["group_id"]));
} else {
$url = CComponentEngine::MakePathFromTemplate(htmlspecialcharsbx($arResult["PATH_TO_USER_CONTENT_SEARCH"]), array("user_id" => $arResult["VARIABLES"]["user_id"]));
}
$APPLICATION->AddChainItem($strFeatureTitle, $url);