本文整理匯總了PHP中CSocNetFeaturesPerms::SetPerm方法的典型用法代碼示例。如果您正苦於以下問題:PHP CSocNetFeaturesPerms::SetPerm方法的具體用法?PHP CSocNetFeaturesPerms::SetPerm怎麽用?PHP CSocNetFeaturesPerms::SetPerm使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CSocNetFeaturesPerms
的用法示例。
在下文中一共展示了CSocNetFeaturesPerms::SetPerm方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: GetMessage
if (!$errorMessage && $USER->IsAuthorized() && $arResult["PERMISSION"] > "R") {
if ($_SERVER['REQUEST_METHOD'] == 'POST' && array_key_exists("sm_action", $_REQUEST) && strlen($_REQUEST["sm_action"]) > 0 && strlen($_REQUEST["feature"]) > 0 && !in_array($_REQUEST["feature"], $arStaticTabs)) {
if (!array_key_exists($_REQUEST["feature"], $arSocNetFeaturesSettings)) {
$errorMessage = GetMessage("SONET_SM_FEATURE_INCORRECT");
} elseif (!in_array($arParams["ENTITY_TYPE"], $arSocNetFeaturesSettings[$_REQUEST["feature"]]["allowed"])) {
$errorMessage = GetMessage("SONET_SM_FEATURE_INACTIVE");
}
}
if ($_SERVER['REQUEST_METHOD'] == 'POST' && array_key_exists("sm_action", $_REQUEST) && $_REQUEST["sm_action"] == "update" && strlen($_REQUEST["feature"]) > 0 && check_bitrix_sessid()) {
if (!$errorMessage) {
CUtil::JSPostUnescape();
$idTmp = CSocNetFeatures::SetFeature($arParams["ENTITY_TYPE"], $arParams["ENTITY_ID"], $_REQUEST["feature"], true, StrLen($_REQUEST[$_REQUEST["feature"] . "_name"]) > 0 ? $_REQUEST[$_REQUEST["feature"] . "_name"] : false);
if ($idTmp && (!array_key_exists("hide_operations_settings", $arSocNetFeaturesSettings[$_REQUEST["feature"]]) || !$arSocNetFeaturesSettings[$_REQUEST["feature"]]["hide_operations_settings"])) {
foreach ($arSocNetFeaturesSettings[$_REQUEST["feature"]]["operations"] as $operation => $perm) {
if (!array_key_exists("restricted", $arSocNetFeaturesSettings[$_REQUEST["feature"]]["operations"][$operation]) || !in_array($key, $arSocNetFeaturesSettings[$_REQUEST["feature"]]["operations"][$operation]["restricted"][$arParams["ENTITY_TYPE"]])) {
$id1Tmp = CSocNetFeaturesPerms::SetPerm($idTmp, $operation, $_REQUEST[$_REQUEST["feature"] . "_" . $operation . "_perm"]);
if (!$id1Tmp && ($e = $APPLICATION->GetException())) {
$errorMessage .= $e->GetString();
}
}
}
} elseif ($e = $APPLICATION->GetException()) {
$errorMessage = $e->GetString();
}
}
$APPLICATION->RestartBuffer();
require_once $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/interface/admin_lib.php';
$obJSPopup = new CJSPopup();
if (!$errorMessage) {
$obJSPopup->Close();
} else {