本文整理汇总了PHP中CSocNetFeatures::GetList方法的典型用法代码示例。如果您正苦于以下问题:PHP CSocNetFeatures::GetList方法的具体用法?PHP CSocNetFeatures::GetList怎么用?PHP CSocNetFeatures::GetList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSocNetFeatures
的用法示例。
在下文中一共展示了CSocNetFeatures::GetList方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __GCE_GetFeatures
function __GCE_GetFeatures($group_id, &$arFeatures)
{
if (!CModule::IncludeModule("socialnetwork")) {
return;
}
if (intval($group_id) > 0) {
$arFeaturesTmp = array();
$dbResultTmp = CSocNetFeatures::GetList(array(), array("ENTITY_ID" => $group_id, "ENTITY_TYPE" => SONET_ENTITY_GROUP));
while ($arResultTmp = $dbResultTmp->GetNext()) {
$arFeaturesTmp[$arResultTmp["FEATURE"]] = $arResultTmp;
}
}
$arSocNetFeaturesSettings = CSocNetAllowed::GetAllowedFeatures();
foreach ($arSocNetFeaturesSettings as $feature => $arFeature) {
if (!is_array($arFeature["allowed"]) || !in_array(SONET_ENTITY_GROUP, $arFeature["allowed"])) {
continue;
}
if (intval($group_id) == 0) {
$arFeaturesTmp[$feature]["ACTIVE"] = COption::GetOptionString("socialnetwork", "default_" . $feature . "_create_default", "Y", SITE_ID);
}
$arFeatures[$feature] = array("FeatureName" => $arFeaturesTmp ? $arFeaturesTmp[$feature]["FEATURE_NAME"] : false, "Active" => $arFeaturesTmp && array_key_exists($feature, $arFeaturesTmp) ? $arFeaturesTmp[$feature]["ACTIVE"] == "Y" : true);
}
}
示例2: Delete
function Delete($ID)
{
global $DB;
if (!CSocNetGroup::__ValidateID($ID)) {
return false;
}
$ID = IntVal($ID);
$bSuccess = True;
$db_events = GetModuleEvents("socialnetwork", "OnBeforeSocNetGroupDelete");
while ($arEvent = $db_events->Fetch()) {
if (ExecuteModuleEventEx($arEvent, array($ID)) === false) {
return false;
}
}
$arGroup = CSocNetGroup::GetByID($ID);
if (!$arGroup) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_NO_GROUP"), "ERROR_NO_GROUP");
return false;
}
$DB->StartTransaction();
$events = GetModuleEvents("socialnetwork", "OnSocNetGroupDelete");
while ($arEvent = $events->Fetch()) {
ExecuteModuleEventEx($arEvent, array($ID));
}
if ($bSuccess) {
$bSuccess = $DB->Query("DELETE FROM b_sonet_user2group WHERE GROUP_ID = " . $ID . "", true);
}
if ($bSuccess) {
$bSuccessTmp = true;
$dbResult = CSocNetFeatures::GetList(array(), array("ENTITY_ID" => $ID, "ENTITY_TYPE" => SONET_ENTITY_GROUP));
while ($arResult = $dbResult->Fetch()) {
$bSuccessTmp = $DB->Query("DELETE FROM b_sonet_features2perms WHERE FEATURE_ID = " . $arResult["ID"] . "", true);
if (!$bSuccessTmp) {
break;
}
}
if (!$bSuccessTmp) {
$bSuccess = false;
}
}
if ($bSuccess) {
$bSuccess = $DB->Query("DELETE FROM b_sonet_features WHERE ENTITY_ID = " . $ID . " AND ENTITY_TYPE = '" . $DB->ForSql(SONET_ENTITY_GROUP, 1) . "'", true);
}
if ($bSuccess) {
$dbResult = CSocNetLog::GetList(array(), array("ENTITY_ID" => $ID, "ENTITY_TYPE" => SONET_ENTITY_GROUP), false, false, array("ID"));
while ($arResult = $dbResult->Fetch()) {
$bSuccessTmp = $DB->Query("DELETE FROM b_sonet_log_site WHERE LOG_ID = " . $arResult["ID"] . "", true);
if (!$bSuccessTmp) {
break;
}
$bSuccessTmp = $DB->Query("DELETE FROM b_sonet_log_right WHERE LOG_ID = " . $arResult["ID"] . "", true);
if (!$bSuccessTmp) {
break;
}
}
if (!$bSuccessTmp) {
$bSuccess = false;
}
}
if ($bSuccess) {
$bSuccess = $DB->Query("DELETE FROM b_sonet_log WHERE ENTITY_TYPE = '" . SONET_ENTITY_GROUP . "' AND ENTITY_ID = " . $ID . "", true);
}
if ($bSuccess) {
$bSuccess = CSocNetLog::DeleteSystemEventsByGroupID($ID);
}
if ($bSuccess) {
$bSuccess = $DB->Query("DELETE FROM b_sonet_log_events WHERE ENTITY_TYPE = 'G' AND ENTITY_ID = " . $ID . "", true);
}
if ($bSuccess) {
$bSuccess = $DB->Query("DELETE FROM b_sonet_group_site WHERE GROUP_ID = " . $ID . "", true);
}
if ($bSuccess) {
$bSuccess = $DB->Query("DELETE FROM b_sonet_log_right WHERE GROUP_CODE LIKE 'SG" . $ID . "\\_%' OR GROUP_CODE = 'SG" . $ID . "'", true);
}
if ($bSuccess) {
$bSuccess = CSocNetSubscription::DeleteEx(false, "SG" . $ID);
}
if ($bSuccess) {
CFile::Delete($arGroup["IMAGE_ID"]);
$bSuccess = $DB->Query("DELETE FROM b_sonet_group WHERE ID = " . $ID . "", true);
}
if ($bSuccess) {
CUserOptions::DeleteOption("socialnetwork", "~menu_" . SONET_ENTITY_GROUP . "_" . $ID, false, 0);
unset($GLOBALS["SONET_GROUP_CACHE"][$ID]);
}
if ($bSuccess) {
$DB->Commit();
} else {
$DB->Rollback();
}
if ($bSuccess) {
unset($GLOBALS["SONET_GROUP_CACHE"][$ID]);
if (defined("BX_COMP_MANAGED_CACHE")) {
$GLOBALS["CACHE_MANAGER"]->ClearByTag("sonet_user2group_G" . $ID);
$GLOBALS["CACHE_MANAGER"]->ClearByTag("sonet_user2group");
$GLOBALS["CACHE_MANAGER"]->ClearByTag("sonet_group_" . $ID);
$GLOBALS["CACHE_MANAGER"]->ClearByTag("sonet_group");
}
}
if ($bSuccess && CModule::IncludeModule("search")) {
//.........这里部分代码省略.........
示例3: str_replace
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;
$name = "";
if ($USER->IsAuthorized() && $arResult["VARIABLES"]["user_id"] == $USER->GetID()) {
$arTmpUser = array("NAME" => $USER->GetFirstName(), "LAST_NAME" => $USER->GetLastName(), "SECOND_NAME" => $USER->GetParam("SECOND_NAME"), "LOGIN" => $USER->GetLogin());
$name = CUser::FormatName($arParams['TITLE_NAME_TEMPLATE'], $arTmpUser, $bUseLogin);
} else {
$dbUser = CUser::GetByID($arResult["VARIABLES"]["user_id"]);
$arUser = $dbUser->Fetch();
$name = CUser::FormatName($arParams['TITLE_NAME_TEMPLATE'], $arUser, $bUseLogin);
}
$arResult["USER"] = array("ID" => $arResult["VARIABLES"]["user_id"], "NAME" => $name);
$db_res = CSocNetFeatures::GetList(array(), array("ENTITY_ID" => $arResult["USER"]["ID"], "ENTITY_TYPE" => SONET_ENTITY_USER, "FEATURE" => "files"));
if ($db_res && ($arResult["USER"]["FEATURE"] = $db_res->GetNext())) {
$arParams["STR_TITLE"] = $arResult["USER"]["FEATURE"]["FEATURE_NAME"] = empty($arResult["USER"]["FEATURE"]["FEATURE_NAME"]) ? $arParams["STR_TITLE"] : $arResult["USER"]["FEATURE"]["FEATURE_NAME"];
} else {
$arResult["USER"]["FEATURE"] = array("FEATURE_NAME" => $arParams["STR_TITLE"]);
}
$name = trim($name);
$strTitle = $name . ": " . $arParams["STR_TITLE"];
if ($arParams["SET_NAV_CHAIN"] == "Y") {
$APPLICATION->AddChainItem($name, CComponentEngine::MakePathFromTemplate($arResult["PATH_TO_USER"], array("user_id" => $arResult["VARIABLES"]["user_id"])));
$APPLICATION->AddChainItem($arParams["STR_TITLE"], CComponentEngine::MakePathFromTemplate($arResult["PATH_TO_USER_FILES"], array("user_id" => $arResult["VARIABLES"]["user_id"], "path" => "")));
}
}
if ($arParams["SET_TITLE"] == "Y") {
$APPLICATION->SetTitle($strTitle);
if ($componentPage == "user_files" && (empty($arResult["VARIABLES"]["path"]) || $arResult["VARIABLES"]["path"] == "index.php")) {
示例4: in_array
}
}
}
}
if (!in_array($arParams["SM_THEME"], $arThemes)) {
$arParams["SM_THEME"] = in_array("grey", $arThemes) ? "grey" : $arThemes[0];
}
if (in_array($arParams["SM_THEME"], $arThemes)) {
$this->InitComponentTemplate();
$obTemplate =& $this->GetTemplate();
$GLOBALS['APPLICATION']->SetAdditionalCSS($obTemplate->GetFolder() . "/themes/" . $arParams["SM_THEME"] . "/style.css");
}
$arUserOptions = CUserOptions::GetOption("socialnetwork", "~menu_" . $arParams["ENTITY_TYPE"] . "_" . $arParams["ENTITY_ID"], false, 0);
$arResult["ALL_FEATURES"] = array();
$arFeaturesTmp = array();
$dbResultTmp = CSocNetFeatures::GetList(array(), array("ENTITY_ID" => $arParams["ENTITY_ID"], "ENTITY_TYPE" => $arParams["ENTITY_TYPE"]));
while ($arResultTmp = $dbResultTmp->GetNext()) {
$arFeaturesTmp[$arResultTmp["FEATURE"]] = $arResultTmp;
}
$arCustomFeatures = array();
$events = GetModuleEvents("socialnetwork", "OnFillSocNetMenu");
while ($arEvent = $events->Fetch()) {
ExecuteModuleEventEx($arEvent, array(&$arCustomFeatures, $arParams));
}
if ($arParams["ENTITY_TYPE"] == SONET_ENTITY_USER && $USER->IsAuthorized() && $USER->GetID() == $arParams["ENTITY_ID"]) {
$arResult["ALL_FEATURES"]["log"] = array("FeatureName" => $arParams["LogName"], "Active" => true, "Operations" => array(), "NOPARAMS" => true, "Url" => $arParams["arResult"]["Urls"]["Log"]);
}
if ($arParams["ENTITY_TYPE"] == SONET_ENTITY_USER || $arParams["ENTITY_TYPE"] == SONET_ENTITY_GROUP) {
$arResult["ALL_FEATURES"]["general"] = array("FeatureName" => $arParams["GeneralName"], "Active" => true, "Operations" => array(), "NOPARAMS" => true, "Url" => $arParams["ENTITY_TYPE"] == SONET_ENTITY_GROUP ? $arParams["arResult"]["Urls"]["View"] : $arParams["arResult"]["Urls"]["Main"]);
}
if ($arParams["ENTITY_TYPE"] == SONET_ENTITY_USER && CSocNetUser::IsFriendsAllowed() && $arParams["arResult"]["CurrentUserPerms"]["Operations"]["viewfriends"]) {
示例5: GetOperationPerm
function GetOperationPerm($type, $id, $feature, $operation)
{
global $arSocNetAllowedEntityTypes;
$arSocNetFeaturesSettings = CSocNetAllowed::GetAllowedFeatures();
$type = Trim($type);
if (StrLen($type) <= 0 || !in_array($type, $arSocNetAllowedEntityTypes)) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_GF_ERROR_NO_ENTITY_TYPE"), "ERROR_EMPTY_TYPE");
if (is_array($id)) {
$arReturn = array();
foreach ($id as $TmpGroupID) {
$arReturn[$TmpGroupID] = false;
}
return $arReturn;
} else {
return false;
}
}
$feature = StrToLower(Trim($feature));
if (StrLen($feature) <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_GF_EMPTY_FEATURE_ID"), "ERROR_EMPTY_FEATURE_ID");
if (is_array($id)) {
$arReturn = array();
foreach ($id as $TmpGroupID) {
$arReturn[$TmpGroupID] = false;
}
return $arReturn;
} else {
return false;
}
}
if (!array_key_exists($feature, $arSocNetFeaturesSettings) || !array_key_exists("allowed", $arSocNetFeaturesSettings[$feature]) || !in_array($type, $arSocNetFeaturesSettings[$feature]["allowed"])) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_GF_ERROR_NO_FEATURE_ID"), "ERROR_NO_FEATURE_ID");
if (is_array($id)) {
$arReturn = array();
foreach ($id as $TmpGroupID) {
$arReturn[$TmpGroupID] = false;
}
return $arReturn;
} else {
return false;
}
}
$operation = StrToLower(Trim($operation));
if (!array_key_exists("operations", $arSocNetFeaturesSettings[$feature]) || !array_key_exists($operation, $arSocNetFeaturesSettings[$feature]["operations"])) {
if (is_array($id)) {
$arReturn = array();
foreach ($id as $TmpGroupID) {
$arReturn[$TmpGroupID] = false;
}
return $arReturn;
} else {
return false;
}
}
global $arSonetFeaturesPermsCache;
if (!isset($arSonetFeaturesPermsCache) || !is_array($arSonetFeaturesPermsCache)) {
$arSonetFeaturesPermsCache = array();
}
if (is_array($id)) {
$arFeaturesPerms = array();
$arGroupToGet = array();
foreach ($id as $TmpGroupID) {
$arFeaturesPerms[$TmpGroupID] = array();
if (!array_key_exists($type . "_" . $TmpGroupID, $arSonetFeaturesPermsCache)) {
$arGroupToGet[] = $TmpGroupID;
} else {
$arFeaturesPerms[$TmpGroupID] = $arSonetFeaturesPermsCache[$type . "_" . $TmpGroupID];
}
}
if (!empty($arGroupToGet)) {
$dbResult = CSocNetFeaturesPerms::GetList(array(), array("FEATURE_ENTITY_ID" => $arGroupToGet, "FEATURE_ENTITY_TYPE" => $type, "GROUP_FEATURE_ACTIVE" => "Y"), false, false, array("OPERATION_ID", "FEATURE_ENTITY_ID", "FEATURE_FEATURE", "ROLE"));
while ($arResult = $dbResult->Fetch()) {
if (!array_key_exists($arResult["FEATURE_ENTITY_ID"], $arFeaturesPerms) || !array_key_exists($arResult["FEATURE_FEATURE"], $arFeaturesPerms[$arResult["FEATURE_ENTITY_ID"]])) {
$arFeaturesPerms[$arResult["FEATURE_ENTITY_ID"]][$arResult["FEATURE_FEATURE"]] = array();
}
$arFeaturesPerms[$arResult["FEATURE_ENTITY_ID"]][$arResult["FEATURE_FEATURE"]][$arResult["OPERATION_ID"]] = $arResult["ROLE"];
}
}
$arReturn = array();
foreach ($id as $TmpEntityID) {
$arSonetFeaturesPermsCache[$type . "_" . $TmpGroupID] = $arFeaturesPerms[$TmpEntityID];
if ($type == SONET_ENTITY_GROUP) {
if (!array_key_exists($feature, $arFeaturesPerms[$TmpEntityID])) {
$featureOperationPerms = $arSocNetFeaturesSettings[$feature]["operations"][$operation][SONET_ENTITY_GROUP];
} elseif (!array_key_exists($operation, $arFeaturesPerms[$TmpEntityID][$feature])) {
$featureOperationPerms = $arSocNetFeaturesSettings[$feature]["operations"][$operation][SONET_ENTITY_GROUP];
} else {
$featureOperationPerms = $arFeaturesPerms[$TmpEntityID][$feature][$operation];
}
} else {
if (!array_key_exists($feature, $arFeaturesPerms[$TmpEntityID])) {
$featureOperationPerms = $arSocNetFeaturesSettings[$feature]["operations"][$operation][SONET_ENTITY_USER];
} elseif (!array_key_exists($operation, $arFeaturesPerms[$TmpEntityID][$feature])) {
$featureOperationPerms = $arSocNetFeaturesSettings[$feature]["operations"][$operation][SONET_ENTITY_USER];
} else {
$featureOperationPerms = $arFeaturesPerms[$TmpEntityID][$feature][$operation];
}
if ($featureOperationPerms == SONET_RELATIONS_TYPE_FRIENDS2) {
$featureOperationPerms = SONET_RELATIONS_TYPE_FRIENDS;
}
//.........这里部分代码省略.........
示例6: GetActiveFeaturesNames
function GetActiveFeaturesNames($type, $id)
{
global $arSocNetAllowedEntityTypes;
$type = Trim($type);
if (StrLen($type) <= 0 || !in_array($type, $arSocNetAllowedEntityTypes)) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_GF_ERROR_NO_ENTITY_TYPE"), "ERROR_EMPTY_TYPE");
return false;
}
$id = IntVal($id);
if ($id <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_GF_EMPTY_ENTITY_ID"), "ERROR_EMPTY_ENTITY_ID");
return false;
}
$arReturn = array();
$arFeatures = array();
if (array_key_exists("SONET_FEATURES_CACHE", $GLOBALS) && isset($GLOBALS["SONET_FEATURES_CACHE"][$type]) && isset($GLOBALS["SONET_FEATURES_CACHE"][$type][$id]) && is_array($GLOBALS["SONET_FEATURES_CACHE"][$type][$id])) {
$arFeatures = $GLOBALS["SONET_FEATURES_CACHE"][$type][$id];
} else {
$cache = new CPHPCache();
$cache_time = 31536000;
$cache_id = $type . "_" . $id;
$cache_path = "/sonet/features/";
if ($cache->InitCache($cache_time, $cache_id, $cache_path)) {
$arCacheVars = $cache->GetVars();
$arFeatures = $arCacheVars["FEATURES"];
} else {
$cache->StartDataCache($cache_time, $cache_id, $cache_path);
if (defined("BX_COMP_MANAGED_CACHE")) {
$GLOBALS["CACHE_MANAGER"]->StartTagCache($cache_path);
$GLOBALS["CACHE_MANAGER"]->RegisterTag("sonet_features_" . $type . "_" . $id);
}
$dbResult = CSocNetFeatures::GetList(array(), array("ENTITY_ID" => $id, "ENTITY_TYPE" => $type));
while ($arResult = $dbResult->GetNext()) {
$arFeatures[$arResult["FEATURE"]] = array("ACTIVE" => $arResult["ACTIVE"], "FEATURE_NAME" => $arResult["FEATURE_NAME"]);
if (defined("BX_COMP_MANAGED_CACHE")) {
$GLOBALS["CACHE_MANAGER"]->RegisterTag("sonet_feature_" . $arResult["ID"]);
}
}
$arCacheData = array("FEATURES" => $arFeatures);
$cache->EndDataCache($arCacheData);
if (defined("BX_COMP_MANAGED_CACHE")) {
$GLOBALS["CACHE_MANAGER"]->EndTagCache();
}
}
if (!array_key_exists("SONET_FEATURES_CACHE", $GLOBALS) || !is_array($GLOBALS["SONET_FEATURES_CACHE"])) {
$GLOBALS["SONET_FEATURES_CACHE"] = array();
}
if (!array_key_exists($type, $GLOBALS["SONET_FEATURES_CACHE"]) || !is_array($GLOBALS["SONET_FEATURES_CACHE"][$type])) {
$GLOBALS["SONET_FEATURES_CACHE"][$type] = array();
}
$GLOBALS["SONET_FEATURES_CACHE"][$type][$id] = $arFeatures;
}
$arSocNetFeaturesSettings = CSocNetAllowed::GetAllowedFeatures();
foreach ($arSocNetFeaturesSettings as $feature => $arr) {
if (!array_key_exists("allowed", $arSocNetFeaturesSettings[$feature]) || !in_array($type, $arSocNetFeaturesSettings[$feature]["allowed"])) {
continue;
}
if (array_key_exists($feature, $arFeatures) && $arFeatures[$feature]["ACTIVE"] == "N") {
continue;
}
$arReturn[$feature] = $arFeatures[$feature]["FEATURE_NAME"];
}
return $arReturn;
}
示例7: GetMessage
$arResult["FatalError"] = GetMessage("SONET_C3_PERMS") . ".";
}
} else {
$arResult["FatalError"] = GetMessage("SONET_C3_NO_GROUP") . ".";
}
} else {
$dbUser = CUser::GetByID($arParams["USER_ID"]);
$arResult["User"] = $dbUser->GetNext();
if (is_array($arResult["User"])) {
$arResult["User"]["NAME_FORMATTED"] = CUser::FormatName($arParams['NAME_TEMPLATE'], $arResult['User'], $bUseLogin);
CSocNetUserPerms::InitUserPerms($GLOBALS["USER"]->GetID(), $arResult["User"]["ID"], CSocNetUser::IsCurrentUserModuleAdmin());
$arResult["CurrentUserPerms"] = CSocNetUserPerms::InitUserPerms($GLOBALS["USER"]->GetID(), $arResult["User"]["ID"], CSocNetUser::IsCurrentUserModuleAdmin());
if ($arResult["CurrentUserPerms"]["Operations"]["modifyuser"]) {
$arResult["Features"] = array();
$arFeaturesTmp = array();
$dbResultTmp = CSocNetFeatures::GetList(array(), array("ENTITY_ID" => $arResult["User"]["ID"], "ENTITY_TYPE" => SONET_ENTITY_USER));
while ($arResultTmp = $dbResultTmp->GetNext()) {
$arFeaturesTmp[$arResultTmp["FEATURE"]] = $arResultTmp;
}
global $arSocNetFeaturesSettings;
foreach ($arSocNetFeaturesSettings as $feature => $arFeature) {
if (!is_array($arFeature["allowed"]) || !in_array(SONET_ENTITY_USER, $arFeature["allowed"])) {
continue;
}
$arResult["Features"][$feature] = array("FeatureName" => $arFeaturesTmp[$feature]["FEATURE_NAME"], "Active" => array_key_exists($feature, $arFeaturesTmp) ? $arFeaturesTmp[$feature]["ACTIVE"] == "Y" : true, "Operations" => array());
if ($feature == 'files') {
$arResult["Features"][$feature]['note'] = GetMessage("SONET_WEBDAV_RIGHS_NOTE");
continue;
}
if ($feature == 'calendar' && (!IsModuleInstalled("intranet") || COption::GetOptionString("intranet", "calendar_2", "N") == "Y") && CModule::IncludeModule("calendar")) {
$arResult["Features"][$feature]['note'] = GetMessage('SONET_CALENDAR_ACCESS_NOTE');
示例8: GetActiveFeaturesNames
function GetActiveFeaturesNames($type, $id)
{
global $arSocNetAllowedEntityTypes, $arSocNetFeaturesSettings;
$type = Trim($type);
if (StrLen($type) <= 0 || !in_array($type, $arSocNetAllowedEntityTypes)) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_GF_ERROR_NO_ENTITY_TYPE"), "ERROR_EMPTY_TYPE");
return false;
}
$id = IntVal($id);
if ($id <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_GF_EMPTY_ENTITY_ID"), "ERROR_EMPTY_ENTITY_ID");
return false;
}
$arReturn = array();
$arFeatures = array();
if (array_key_exists("SONET_FEATURES_CACHE", $GLOBALS) && is_array($GLOBALS["SONET_FEATURES_CACHE"]) && array_key_exists($type, $GLOBALS["SONET_FEATURES_CACHE"]) && is_array($GLOBALS["SONET_FEATURES_CACHE"][$type]) && array_key_exists($id, $GLOBALS["SONET_FEATURES_CACHE"][$type]) && is_array($GLOBALS["SONET_FEATURES_CACHE"][$type][$id])) {
$arFeatures = $GLOBALS["SONET_FEATURES_CACHE"][$type][$id];
} else {
$dbResult = CSocNetFeatures::GetList(array(), array("ENTITY_ID" => $id, "ENTITY_TYPE" => $type));
while ($arResult = $dbResult->GetNext()) {
$arFeatures[$arResult["FEATURE"]] = array("ACTIVE" => $arResult["ACTIVE"], "FEATURE_NAME" => $arResult["FEATURE_NAME"]);
}
if (!array_key_exists("SONET_FEATURES_CACHE", $GLOBALS) || !is_array($GLOBALS["SONET_FEATURES_CACHE"])) {
$GLOBALS["SONET_FEATURES_CACHE"] = array();
}
if (!array_key_exists($type, $GLOBALS["SONET_FEATURES_CACHE"]) || !is_array($GLOBALS["SONET_FEATURES_CACHE"][$type])) {
$GLOBALS["SONET_FEATURES_CACHE"][$type] = array();
}
$GLOBALS["SONET_FEATURES_CACHE"][$type][$id] = $arFeatures;
}
foreach ($arSocNetFeaturesSettings as $feature => $arr) {
if (!array_key_exists("allowed", $arSocNetFeaturesSettings[$feature]) || !in_array($type, $arSocNetFeaturesSettings[$feature]["allowed"])) {
continue;
}
if (array_key_exists($feature, $arFeatures) && $arFeatures[$feature]["ACTIVE"] == "N") {
continue;
}
$arReturn[$feature] = $arFeatures[$feature]["FEATURE_NAME"];
}
return $arReturn;
}
示例9: while
$arFilter["ENTITY_ID"] = 0;
$arFilter["ENTITY_MY"] = "Y";
} else {
$arFilter["ENTITY_ID"] = $entity_id;
}
}
$dbResultTmp = CSocNetLogEvents::GetList(array(), $arFilter);
while ($arResultTmp = $dbResultTmp->Fetch()) {
if ($arResultTmp["ENTITY_CB"] == "Y") {
$arSubscribesTmpCB[$arResultTmp["EVENT_ID"]] = $arResultTmp;
} else {
$arSubscribesTmp[$arResultTmp["EVENT_ID"]] = $arResultTmp;
}
}
$arFeaturesTmp = array();
$dbResultTmp = CSocNetFeatures::GetList(array(), array("ENTITY_TYPE" => $entity_type, "ENTITY_ID" => $entity_id));
while ($arResultTmp = $dbResultTmp->GetNext()) {
$arFeaturesTmp[$arResultTmp["FEATURE"]] = $arResultTmp;
}
$arResult["Subscription"] = array();
foreach ($arSocNetLogEvents as $event_id_tmp => $arEventTmp) {
if (array_key_exists("HIDDEN", $arEventTmp) && $arEventTmp["HIDDEN"]) {
continue;
}
if (!array_key_exists("ENTITIES", $arEventTmp) || !array_key_exists($entity_type, $arEventTmp["ENTITIES"])) {
continue;
}
$arSubscriptionData = __SLGetSubscriptionData($event_id_tmp, $arSubscribesTmp, $arSubscribesTmpAllMy, $arSubscribesTmpAll);
$arResult["Subscription"][] = array("Feature" => $event_id_tmp, "Name" => $arEventTmp["ENTITIES"][$entity_type]["TITLE"], "Transport" => $arSubscriptionData["Transport"], "TransportInherited" => $arSubscriptionData["TransportInherited"], "TransportInheritedFrom" => $arSubscriptionData["TransportInheritedFrom"], "Visible" => $arSubscriptionData["Visible"], "VisibleInherited" => $arSubscriptionData["VisibleInherited"], "VisibleInheritedFrom" => $arSubscriptionData["VisibleInheritedFrom"]);
}
foreach ($arSocNetFeaturesSettings as $feature => $arFeature) {
示例10: array
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
?>
<?php
$pageId = "user_calendar";
include "util_menu.php";
include "util_profile.php";
$ownerId = $arResult["VARIABLES"]["user_id"];
if (isset($_GET['bx_enable_calendar']) && $_GET['bx_enable_calendar'] == 'Y') {
$rsFeatures = CSocNetFeatures::GetList(array(), array("ENTITY_ID" => $ownerId, "ENTITY_TYPE" => SONET_ENTITY_USER, "FEATURE" => 'calendar'));
if ($arFeature = $rsFeatures->Fetch()) {
CSocNetFeatures::Update($arFeature['ID'], array('ACTIVE' => 'Y'));
unset($GLOBALS['SONET_FEATURES_CACHE']);
}
}
if (CSocNetFeatures::IsActiveFeature(SONET_ENTITY_USER, $ownerId, "calendar")) {
$calendar2 = (!IsModuleInstalled("intranet") || COption::GetOptionString("intranet", "calendar_2", "N") == "Y") && CModule::IncludeModule("calendar");
if ($calendar2) {
$APPLICATION->IncludeComponent("bitrix:calendar.grid", "", array("CALENDAR_TYPE" => 'user', "OWNER_ID" => $ownerId, "ALLOW_SUPERPOSE" => $arParams['CALENDAR_ALLOW_SUPERPOSE'], "ALLOW_RES_MEETING" => $arParams["CALENDAR_ALLOW_RES_MEETING"], "SET_TITLE" => 'Y', "SET_NAV_CHAIN" => 'Y', 'NAME_TEMPLATE' => $arParams['NAME_TEMPLATE']), $component, array("HIDE_ICONS" => "Y"));
} else {
$APPLICATION->IncludeComponent("bitrix:intranet.event_calendar", ".default", array("IBLOCK_TYPE" => $arParams['CALENDAR_IBLOCK_TYPE'], "IBLOCK_ID" => $arParams['CALENDAR_USER_IBLOCK_ID'], "OWNER_ID" => $ownerId, "OWNER_TYPE" => 'USER', "INIT_DATE" => "", "WEEK_HOLIDAYS" => $arParams['CALENDAR_WEEK_HOLIDAYS'], "YEAR_HOLIDAYS" => $arParams['CALENDAR_YEAR_HOLIDAYS'], "LOAD_MODE" => "ajax", "USE_DIFFERENT_COLORS" => "Y", "EVENT_COLORS" => "", "ADVANCED_MODE_SETTINGS" => "Y", "SET_TITLE" => 'Y', "SET_NAV_CHAIN" => 'Y', "WORK_TIME_START" => $arParams['CALENDAR_WORK_TIME_START'], "WORK_TIME_END" => $arParams['CALENDAR_WORK_TIME_END'], "PATH_TO_USER" => $arResult["PATH_TO_USER"], "PATH_TO_USER_CALENDAR" => $arResult["PATH_TO_USER_CALENDAR"], "ALLOW_SUPERPOSE" => $arParams['CALENDAR_ALLOW_SUPERPOSE'], "SUPERPOSE_GROUPS_CALS" => $arParams['CALENDAR_SUPERPOSE_GROUPS_CALS'], "SUPERPOSE_USERS_CALS" => $arParams['CALENDAR_SUPERPOSE_USERS_CALS'], "SUPERPOSE_CUR_USER_CALS" => $arParams['CALENDAR_SUPERPOSE_CUR_USER_CALS'], "SUPERPOSE_CAL_IDS" => $arParams['CALENDAR_SUPERPOSE_CAL_IDS'], "SUPERPOSE_GROUPS_IBLOCK_ID" => $arParams['CALENDAR_SUPERPOSE_GROUPS_IBLOCK_ID'], "SUPERPOSE_USERS_IBLOCK_ID" => $arParams['CALENDAR_USER_IBLOCK_ID'], "USERS_IBLOCK_ID" => $arParams['CALENDAR_USER_IBLOCK_ID'], "ALLOW_RES_MEETING" => $arParams["CALENDAR_ALLOW_RES_MEETING"], "RES_MEETING_IBLOCK_ID" => $arParams["CALENDAR_RES_MEETING_IBLOCK_ID"], "PATH_TO_RES_MEETING" => $arParams["CALENDAR_PATH_TO_RES_MEETING"], "RES_MEETING_USERGROUPS" => $arParams["CALENDAR_RES_MEETING_USERGROUPS"], "REINVITE_PARAMS_LIST" => $arParams["CALENDAR_REINVITE_PARAMS_LIST"], "NAME_TEMPLATE" => $arParams["NAME_TEMPLATE"], "SHOW_LOGIN" => $arParams["SHOW_LOGIN"], "ALLOW_VIDEO_MEETING" => $arParams["CALENDAR_ALLOW_VIDEO_MEETING"], "VIDEO_MEETING_IBLOCK_ID" => $arParams["CALENDAR_VIDEO_MEETING_IBLOCK_ID"], "PATH_TO_VIDEO_MEETING" => $arParams["CALENDAR_PATH_TO_VIDEO_MEETING"], "PATH_TO_VIDEO_MEETING_DETAIL" => $arParams["CALENDAR_PATH_TO_VIDEO_MEETING_DETAIL"], "VIDEO_MEETING_USERGROUPS" => $arParams["CALENDAR_VIDEO_MEETING_USERGROUPS"]), $component, array("HIDE_ICONS" => "Y"));
}
} elseif (strpos(POST_FORM_ACTION_URI, 'bx_enable_calendar=Y') === false) {
$url = POST_FORM_ACTION_URI . (strpos(POST_FORM_ACTION_URI, '?') === false ? '?' : '&') . 'bx_enable_calendar=Y';
echo GetMessage('SONET_U_CALENDAR_DIS_MES') . ' <a href="' . $url . '" title="' . GetMessage('SONET_U_CALENDAR_DIS_TITLE') . '">' . GetMessage('SONET_U_CALENDAR_TURN_ON') . '</a>';
}