当前位置: 首页>>代码示例>>PHP>>正文


PHP CSocNetGroup::Delete方法代码示例

本文整理汇总了PHP中CSocNetGroup::Delete方法的典型用法代码示例。如果您正苦于以下问题:PHP CSocNetGroup::Delete方法的具体用法?PHP CSocNetGroup::Delete怎么用?PHP CSocNetGroup::Delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CSocNetGroup的用法示例。


在下文中一共展示了CSocNetGroup::Delete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

    if ($_REQUEST['action_target'] == 'selected') {
        $arID = array();
        $dbResultList = CSocNetGroup::GetList(array($by => $order), $arFilter, false, false, array("ID"));
        while ($arResult = $dbResultList->Fetch()) {
            $arID[] = $arResult['ID'];
        }
    }
    foreach ($arID as $ID) {
        if (strlen($ID) <= 0) {
            continue;
        }
        switch ($_REQUEST['action']) {
            case "delete":
                @set_time_limit(0);
                $DB->StartTransaction();
                if (!CSocNetGroup::Delete($ID)) {
                    $DB->Rollback();
                    if ($ex = $APPLICATION->GetException()) {
                        $lAdmin->AddGroupError($ex->GetString(), $ID);
                    } else {
                        $lAdmin->AddGroupError(GetMessage("SONET_DELETE_ERROR"), $ID);
                    }
                }
                $DB->Commit();
                break;
        }
    }
}
$dbResultList = CSocNetGroup::GetList(array($by => $order), $arFilter, false, false, array("ID", "SUBJECT_ID", "NAME", "SITE_ID", "OWNER_ID"));
$dbResultList = new CAdminResult($dbResultList, $sTableID);
$dbResultList->NavStart();
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:group.php

示例2: deleteGroup

	public static function deleteGroup($arFields)
	{
		$groupID = $arFields['GROUP_ID'];

		if(intval($groupID) <= 0)
			throw new Exception('Wrong group ID');

		$dbRes = CSocNetGroup::GetList(array(), array(
			"ID" => $groupID,
			"CHECK_PERMISSIONS" => "Y"
		));
		$arGroup = $dbRes->Fetch();
		if(is_array($arGroup))
		{
			if (
				$arGroup["OWNER_ID"] == $GLOBALS["USER"]->GetID()
				|| CSocNetUser::IsCurrentUserModuleAdmin(SITE_ID, false)
			)
			{
				if (!CSocNetGroup::Delete($arGroup["ID"]))
					throw new Exception('Cannot delete group');
			}
			else
				throw new Exception('User has no permissions to delete group');
		}
		else
			throw new Exception('Socialnetwork group not found');

		return true;
	}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:30,代码来源:rest.php

示例3: array

            $arResult["Group"] = $arGroup;
            $arResult["CurrentUserPerms"] = CSocNetUserToGroup::InitUserPerms($GLOBALS["USER"]->GetID(), $arResult["Group"], CSocNetUser::IsCurrentUserModuleAdmin());
            $arResult["Urls"]["User"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $GLOBALS["USER"]->GetID()));
            $arResult["Urls"]["Group"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_GROUP"], array("group_id" => $arResult["Group"]["ID"]));
            if ($arParams["SET_TITLE"] == "Y") {
                $APPLICATION->SetTitle($arResult["Group"]["NAME"] . ": " . GetMessage("SONET_C9_TITLE"));
            }
            if ($arParams["SET_NAV_CHAIN"] != "N") {
                $APPLICATION->AddChainItem($arResult["Group"]["NAME"], $arResult["Urls"]["Group"]);
                $APPLICATION->AddChainItem(GetMessage("SONET_C9_TITLE"));
            }
            if (!$arResult["CurrentUserPerms"]["UserCanModifyGroup"]) {
                $arResult["FatalError"] = GetMessage("SONET_C9_NO_PERMS") . ". ";
            } else {
                $arResult["ShowForm"] = "Input";
                if ($_SERVER["REQUEST_METHOD"] == "POST" && strlen($_POST["save"]) > 0 && check_bitrix_sessid()) {
                    $errorMessage = "";
                    if (strlen($errorMessage) <= 0 && !CSocNetGroup::Delete($arResult["Group"]["ID"]) && ($e = $APPLICATION->GetException())) {
                        $errorMessage .= $e->GetString();
                    }
                    if (strlen($errorMessage) > 0) {
                        $arResult["ErrorMessage"] = $errorMessage;
                    } else {
                        $arResult["ShowForm"] = "Confirm";
                    }
                }
            }
        }
    }
}
$this->IncludeComponentTemplate();
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:component.php


注:本文中的CSocNetGroup::Delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。