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


C# ContentAPI.LoadPermissions方法代码示例

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


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

示例1: Handler_AddTo

    public string Handler_AddTo()
    {
        StringBuilder sbRet = new StringBuilder();
            ContentAPI apiContent = new ContentAPI();
            Ektron.Cms.Community.CommunityGroupAPI apiCommunityGroup = new Ektron.Cms.Community.CommunityGroupAPI();
            Ektron.Cms.Community.FavoritesAPI apiFavorites = new Ektron.Cms.Community.FavoritesAPI();
            Ektron.Cms.Community.FriendsAPI apiFriends = new Ektron.Cms.Community.FriendsAPI();
            long iObjID = 0;
            Ektron.Cms.Common.EkEnumeration.CMSSocialBarTypes sbObjType = Ektron.Cms.Common.EkEnumeration.CMSSocialBarTypes.Content;
            string sMode = "";
            string sMsg = "";
            string sKey = "";
            string sResult = "";
            int iIdx = 0;
            bool bIsMine = false;
            long bIsMyLinkID = 0;
            string sRetMsg = "";
            bool bAuth = false;
            int iLang = 0;
            string title = "";
            string link = "";
            string action = "";
            try
            {
                iObjID = Convert.ToInt64(Request.QueryString["oid"]);
                int oType = 0;
                int.TryParse(EkFunctions.HtmlEncode(Request.QueryString["otype"]), out oType);
                switch (oType)
                {
                    case 0:
                        sbObjType = Ektron.Cms.Common.EkEnumeration.CMSSocialBarTypes.Content;
                        break;
                    case 1:
                        sbObjType = Ektron.Cms.Common.EkEnumeration.CMSSocialBarTypes.User;
                        break;
                    case 19:
                        sbObjType = Ektron.Cms.Common.EkEnumeration.CMSSocialBarTypes.CommunityGroup;
                        break;
                }

                sMode = EkFunctions.HtmlEncode(Request.QueryString["mode"]);
                sKey = EkFunctions.HtmlEncode(Request.QueryString["key"]);
                iIdx = Convert.ToInt32(Request.QueryString["idx"]);
                title = EkFunctions.HtmlEncode(Request.QueryString["title"]);
                link = EkFunctions.HtmlEncode(Request.QueryString["link"]);

                if (iObjID > 0)
                {
                    sbRet.Append("  <method>AJAX_AddTo</method>").Append(Environment.NewLine);
                }
                else if (iObjID == 0)
                {
                    sbRet.Append("  <method>AJAX_AddLinkTo</method>").Append(Environment.NewLine);
                }

                bAuth = System.Convert.ToBoolean((apiContent.LoadPermissions(0, "users", 0)).IsLoggedIn);
                if (bAuth)
                {
                    if (sbObjType == Ektron.Cms.Common.EkEnumeration.CMSSocialBarTypes.CommunityGroup)
                    {
                        Ektron.Cms.Common.EkEnumeration.GroupMemberStatus mMemberStatus = Ektron.Cms.Common.EkEnumeration.GroupMemberStatus.NotInGroup;
                        mMemberStatus = apiCommunityGroup.GetGroupMemberStatus(iObjID, apiContent.UserId);
                        if (mMemberStatus == Ektron.Cms.Common.EkEnumeration.GroupMemberStatus.Approved)
                        {
                            if (sMode == "remove")
                            {
                                apiCommunityGroup.RemoveUserFromCommunityGroup(iObjID, apiContent.UserId);
                                Ektron.Cms.Common.Cache.ApplicationCache.Invalidate((string) ("GroupAccess_" + iObjID.ToString() + "_" + apiContent.UserId.ToString()));
                                sMsg = apiContent.EkMsgRef.GetMessage("lbl left group");
                                sRetMsg = apiContent.EkMsgRef.GetMessage("lbl join group");
                                sResult = "1";
                            }
                            else if (sMode == "add")
                            {
                                sMsg = apiContent.EkMsgRef.GetMessage("lbl already in group");
                                sRetMsg = apiContent.EkMsgRef.GetMessage("lbl leave group");
                                sResult = "-1";
                            }
                        }
                        else if (mMemberStatus == Ektron.Cms.Common.EkEnumeration.GroupMemberStatus.Leader)
                        {
                            sMsg = apiContent.EkMsgRef.GetMessage("lbl leader of group");
                            sRetMsg = apiContent.EkMsgRef.GetMessage("lbl leader of group");
                            sResult = "-1";
                        }
                        else if (mMemberStatus == Ektron.Cms.Common.EkEnumeration.GroupMemberStatus.NotInGroup)
                        {
                            if (sMode == "remove")
                            {
                                sMsg = apiContent.EkMsgRef.GetMessage("lbl not in group");
                                sRetMsg = apiContent.EkMsgRef.GetMessage("lbl join group");
                                sResult = "-1";
                            }
                            else if (sMode == "add")
                            {
                                apiCommunityGroup.AddUserToCommunityGroup(iObjID, apiContent.UserId);
                                Ektron.Cms.Common.Cache.ApplicationCache.Invalidate((string) ("GroupAccess_" + iObjID.ToString() + "_" + apiContent.UserId.ToString()));
                                mMemberStatus = apiCommunityGroup.GetGroupMemberStatus(iObjID, apiContent.UserId);
                                if (mMemberStatus == Ektron.Cms.Common.EkEnumeration.GroupMemberStatus.Pending)
                                {
//.........这里部分代码省略.........
开发者ID:jaytem,项目名称:minGit,代码行数:101,代码来源:AJAXbase.aspx.cs

示例2: Page_Load


//.........这里部分代码省略.........
                if (!m_bClose)
                {
                    ClosePanel.Text = "<script language=javascript>" + "\r\n" + "ResizeFrame(1); // Show the navigation-tree frame." + "\r\n" + "</script>";
                    Response.Redirect(GetBackPage(Convert.ToInt64(Request.Form["content_id"])), false);
                }
                else
                {
                    Response.Redirect("close.aspx", false);
                }
            }
            else if ((m_strPageAction == "save") || (m_strPageAction == "checkin") || (m_strPageAction == "publish") || (m_strPageAction == "summary_save") || (m_strPageAction == "meta_save"))
            {
                Process_FormSubmit();
                if (m_bClose && m_strPageAction != "save")
                {
                    if (updateFieldId != "")
                    {
                        string strQuery = "";
                        if (TaxonomySelectId > 0)
                        {
                            strQuery = (string)("&__taxonomyid=" + TaxonomySelectId);
                        }
                        else if (TaxonomyOverrideId > 0)
                        {
                            strQuery = (string)("&__taxonomyid=" + TaxonomyOverrideId);
                        }
                        Response.Redirect((string)("close.aspx?toggle=true" + strQuery), false);
                    }
                }
            }
            else
            {
                Display_EditControls();

                if (!(Page.IsPostBack) && bAddingNew)
                {
                    if (Request.QueryString["form_type"] != null)
                    {
                        newformwizard ucNewFormWizard;
                        ucNewFormWizard = (newformwizard)(LoadControl("controls/forms/newformwizard.ascx"));
                        ucNewFormWizard.ID = "ProgressSteps";
                        phNewFormWizard.Controls.Add(ucNewFormWizard);
                        if (bNewPoll)
                        {
                            PollHtmlScript();
                        }
                    }
                }
            }

            PermissionData cPerms;
            cPerms = m_refContApi.LoadPermissions(m_intContentFolder, "folder", 0);
            m_ctlContentDesigner.FolderId = m_intContentFolder;
            if (2 == m_intContentType)
            {
                m_ctlContentDesigner.Toolbars = Ektron.ContentDesignerWithValidator.Configuration.Designer;
            }
            else if (editorPackage.Length > 0)
            {
                m_ctlContentDesigner.Toolbars = Ektron.ContentDesignerWithValidator.Configuration.DataEntry;
            }
            else
            {
                m_ctlContentDesigner.ToolsFile = m_refContApi.ApplicationPath + "ContentDesigner/configurations/StandardEdit.aspx?wiki=1";
            }
            m_ctlContentDesigner.SetPermissions(cPerms);
            m_ctlContentDesigner.AllowFonts = true;
            m_ctlSummaryDesigner.FolderId = m_intContentFolder;
            if (2 == m_intContentType)
            {
                m_ctlSummaryDesigner.Toolbars = Ektron.ContentDesignerWithValidator.Configuration.XsltDesigner;
            }
            else if (m_bIsBlog)
            {
                m_ctlSummaryDesigner.ToolsFile = m_refContApi.ApplicationPath + "ContentDesigner/configurations/InterfaceBlog.aspx?WMV=1";
            }
            else
            {
                m_ctlSummaryDesigner.Toolbars = Ektron.ContentDesignerWithValidator.Configuration.Standard;
            }
            m_ctlSummaryDesigner.SetPermissions(cPerms);
            m_ctlSummaryDesigner.AllowFonts = true;
            m_ctlFormResponseRedirect.FolderId = m_intContentFolder;
            m_ctlFormResponseRedirect.Toolbars = Ektron.ContentDesignerWithValidator.Configuration.NoToolbars;
            m_ctlFormResponseRedirect.SetPermissions(cPerms);
            m_ctlFormResponseRedirect.AllowFonts = true;
            m_ctlFormResponseTransfer.FolderId = m_intContentFolder;
            m_ctlFormResponseTransfer.Toolbars = Ektron.ContentDesignerWithValidator.Configuration.NoToolbars;
            m_ctlFormResponseTransfer.SetPermissions(cPerms);
            m_ctlFormResponseTransfer.AllowFonts = true;
            m_ctlContentValidator.Text = m_refMsg.GetMessage("content size exceeded");
            m_ctlSummaryValidator.Text = m_refMsg.GetMessage("content size exceeded");
            g_ContentTypeSelected = Ektron.Cms.Common.EkConstants.CMSContentType_AllTypes;
            m_refContApi.SetCookieValue(Ektron.Cms.Common.EkConstants.ContentTypeUrlParam, g_ContentTypeSelected.ToString());
        }
        catch (Exception ex)
        {
            Utilities.ShowError(ex.Message);
        }
    }
开发者ID:jaytem,项目名称:minGit,代码行数:101,代码来源:edit.aspx.cs


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