本文整理汇总了PHP中CSocNetFeatures::GetActiveFeatures方法的典型用法代码示例。如果您正苦于以下问题:PHP CSocNetFeatures::GetActiveFeatures方法的具体用法?PHP CSocNetFeatures::GetActiveFeatures怎么用?PHP CSocNetFeatures::GetActiveFeatures使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSocNetFeatures
的用法示例。
在下文中一共展示了CSocNetFeatures::GetActiveFeatures方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
if (IntVal($arParams["GROUP_ID"]) > 0) {
$arResult["IS_FILTERED"] = true;
}
if ($arParams["FLT_ALL"] == "Y") {
$arFilter["ALL"] = "Y";
}
if ($ENTITY_TYPE != "" && $ENTITY_ID > 0 && !array_key_exists("EVENT_ID", $arFilter)) {
$arFilter["EVENT_ID"] = array();
$arSocNetLogEvents = CSocNetAllowed::GetAllowedLogEvents();
foreach ($arSocNetLogEvents as $event_id_tmp => $arEventTmp) {
if (array_key_exists("HIDDEN", $arEventTmp) && $arEventTmp["HIDDEN"]) {
continue;
}
$arFilter["EVENT_ID"][] = $event_id_tmp;
}
$arFeatures = CSocNetFeatures::GetActiveFeatures($ENTITY_TYPE, $ENTITY_ID);
$arSocNetFeaturesSettings = CSocNetAllowed::GetAllowedFeatures();
foreach ($arFeatures as $feature_id) {
if (array_key_exists($feature_id, $arSocNetFeaturesSettings) && array_key_exists("subscribe_events", $arSocNetFeaturesSettings[$feature_id])) {
foreach ($arSocNetFeaturesSettings[$feature_id]["subscribe_events"] as $event_id_tmp => $arEventTmp) {
$arFilter["EVENT_ID"][] = $event_id_tmp;
}
}
}
}
if (!$arFilter["EVENT_ID"] || is_array($arFilter["EVENT_ID"]) && count($arFilter["EVENT_ID"]) <= 0) {
unset($arFilter["EVENT_ID"]);
}
if (isset($arParams["FILTER_SITE_ID"])) {
$arFilter["SITE_ID"] = $arParams["FILTER_SITE_ID"];
} else {
示例2: intval
$arFilter["ENTITY_ID"] = intval($arParams["ENTITY_ID"]);
$arFilter["EVENT_ID"] = array();
if ($arParams["EVENT_ID"]) {
$arFilter["EVENT_ID"] = $arParams["EVENT_ID"];
}
if (!is_array($arFilter["EVENT_ID"]) && strlen(trim($arFilter["EVENT_ID"])) > 0) {
$arFilter["EVENT_ID"] = array($arFilter["EVENT_ID"]);
}
foreach ($arFilter["EVENT_ID"] as $i => $feature) {
if ($feature == "all") {
unset($arFilter["EVENT_ID"]);
break;
}
}
if (array_key_exists("ENTITY_TYPE", $arFilter) && strlen($arFilter["ENTITY_TYPE"]) > 0 && array_key_exists("ENTITY_ID", $arFilter) && intval($arFilter["ENTITY_ID"]) > 0) {
$arFeatures = CSocNetFeatures::GetActiveFeatures($arFilter["ENTITY_TYPE"], $arFilter["ENTITY_ID"]);
$arFeatures[] = "system";
if (in_array("blog", $arFeatures)) {
$arFeatures[] = "blog_post";
$arFeatures[] = "blog_comment";
$arFeatures[] = "blog_post_micro";
}
if (!array_key_exists("EVENT_ID", $arFilter) || empty($arFilter["EVENT_ID"])) {
$arFilter["EVENT_ID"] = array("system");
foreach ($arFeatures as $feature_id) {
if ($feature_id == "blog") {
$arFilter["EVENT_ID"][] = "blog_post";
$arFilter["EVENT_ID"][] = "blog_comment";
$arFilter["EVENT_ID"][] = "blog_post_micro";
}
$arFilter["EVENT_ID"][] = $feature_id;
示例3: IncludeModuleLangFile
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
if (SITE_TEMPLATE_ID !== "bitrix24") {
return;
}
IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/intranet/public/.left.menu_ext.php");
if (!CModule::IncludeModule("socialnetwork")) {
return;
}
$arUserActiveFeatures = CSocNetFeatures::GetActiveFeatures(SONET_ENTITY_USER, $GLOBALS["USER"]->GetID());
global $USER;
$USER_ID = $USER->GetID();
$aMenuB24 = array();
$aMenuB24[] = array(GetMessage("LEFT_MENU_LIVE_FEED"), "/index.php", array(), array("name" => "live_feed", "counter_id" => "live-feed", "menu_item_id" => "menu_live_feed"), "");
if ($GLOBALS["USER"]->IsAuthorized()) {
$arSocNetFeaturesSettings = CSocNetAllowed::GetAllowedFeatures();
if (array_key_exists("tasks", $arSocNetFeaturesSettings) && array_key_exists("allowed", $arSocNetFeaturesSettings["tasks"]) && in_array(SONET_ENTITY_USER, $arSocNetFeaturesSettings["tasks"]["allowed"]) && in_array("tasks", $arUserActiveFeatures)) {
$aMenuB24[] = array(GetMessage("LEFT_MENU_TASKS"), "/company/personal/user/" . $USER_ID . "/tasks/?F_CANCEL=Y&F_STATE=sR400", array(), array("name" => "tasks", "counter_id" => "tasks_total"), "CBXFeatures::IsFeatureEnabled('Tasks')");
}
if (array_key_exists("calendar", $arSocNetFeaturesSettings) && array_key_exists("allowed", $arSocNetFeaturesSettings["calendar"]) && in_array(SONET_ENTITY_USER, $arSocNetFeaturesSettings["calendar"]["allowed"]) && in_array("calendar", $arUserActiveFeatures)) {
$aMenuB24[] = array(GetMessage("LEFT_MENU_CALENDAR"), "/company/personal/user/" . $USER_ID . "/calendar/", array(), array(), "CBXFeatures::IsFeatureEnabled('Calendar')");
}
if (CModule::IncludeModule("disk") && $GLOBALS["USER"]->IsAuthorized() && array_key_exists("files", $arSocNetFeaturesSettings) && array_key_exists("allowed", $arSocNetFeaturesSettings["files"]) && in_array(SONET_ENTITY_USER, $arSocNetFeaturesSettings["files"]["allowed"]) && in_array("files", $arUserActiveFeatures)) {
$aMenuB24[] = array(GetMessage("LEFT_MENU_DISC"), "/company/personal/user/" . $USER_ID . "/disk/path/", array(), array(), "CBXFeatures::IsFeatureEnabled('PersonalFiles')");
}
if (CModule::IncludeModule("photogallery") && array_key_exists("photo", $arSocNetFeaturesSettings) && array_key_exists("allowed", $arSocNetFeaturesSettings["photo"]) && in_array(SONET_ENTITY_USER, $arSocNetFeaturesSettings["photo"]["allowed"]) && in_array("photo", $arUserActiveFeatures)) {
$aMenuB24[] = array(GetMessage("LEFT_MENU_PHOTO"), "/company/personal/user/" . $USER_ID . "/photo/", array(), array(), "CBXFeatures::IsFeatureEnabled('PersonalPhoto')");
}
示例4: array
$arFilter["EVENT_ID"] = CSocNetLogTools::FindFullSetByEventID($arParams["EVENT_ID"]);
}
if (IntVal($arParams["CREATED_BY_ID"]) > 0) {
$arFilter["USER_ID"] = $arParams["CREATED_BY_ID"];
}
}
if (($arParams["GROUP_ID"] > 0 || $arParams["USER_ID"] > 0) && !array_key_exists("EVENT_ID", $arFilter)) {
$arFilter["EVENT_ID"] = array();
$arSocNetLogEvents = CSocNetAllowed::GetAllowedLogEvents();
foreach ($arSocNetLogEvents as $event_id_tmp => $arEventTmp) {
if (array_key_exists("HIDDEN", $arEventTmp) && $arEventTmp["HIDDEN"]) {
continue;
}
$arFilter["EVENT_ID"][] = $event_id_tmp;
}
$arFeatures = CSocNetFeatures::GetActiveFeatures($arParams["GROUP_ID"] > 0 ? SONET_ENTITY_GROUP : SONET_ENTITY_GROUP, $arParams["GROUP_ID"] > 0 ? $arParams["GROUP_ID"] : $arParams["USER_ID"]);
foreach ($arFeatures as $feature_id) {
$arSocNetFeaturesSettings = CSocNetAllowed::GetAllowedFeatures();
if (array_key_exists($feature_id, $arSocNetFeaturesSettings) && array_key_exists("subscribe_events", $arSocNetFeaturesSettings[$feature_id])) {
foreach ($arSocNetFeaturesSettings[$feature_id]["subscribe_events"] as $event_id_tmp => $arEventTmp) {
$arFilter["EVENT_ID"][] = $event_id_tmp;
}
}
}
}
if (!$arFilter["EVENT_ID"] || is_array($arFilter["EVENT_ID"]) && count($arFilter["EVENT_ID"]) <= 0) {
unset($arFilter["EVENT_ID"]);
}
$arFilter["SITE_ID"] = CModule::IncludeModule('extranet') && CExtranet::IsExtranetSite() ? SITE_ID : array(SITE_ID, false);
if ($arParams["IS_CRM"] == "Y" && strlen($arParams["CRM_ENTITY_TYPE"]) > 0) {
$arParams["SET_LOG_COUNTER"] = $arParams["SET_LOG_PAGE_CACHE"] = "N";