Пример #1
0
    /// <summary>
    /// Handles the Load event of the Page control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    protected void Page_Load(object sender, System.EventArgs e)
    {
        m_refMsg = this.m_refContentApi.EkMsgRef;
        AppImgPath = this.m_refContentApi.AppImgPath;
        AppPath = this.m_refContentApi.AppPath;
        m_strPageAction = Request.QueryString["action"];
        object refApi = m_refContentApi as object;
        Utilities.SetLanguage(m_refContentApi);
        TaxonomyLanguage = this.m_refContentApi.ContentLanguage;
        if ((TaxonomyLanguage == -1))
        {
            TaxonomyLanguage = m_refContentApi.DefaultContentLanguage;
        }
        if ((Request.QueryString["view"] != null))
        {
            _ViewItem = Request.QueryString["view"];
        }
        if ((Request.QueryString["taxonomyid"] != null))
        {
            TaxonomyId = Convert.ToInt64(Request.QueryString["taxonomyid"]);
        }

        if ((Request.QueryString["parentid"] != null))
        {
            this.TaxonomyParentId = Convert.ToInt64(Request.QueryString["parentid"]);
        }

        if ((Request.QueryString["type"] != null) && Request.QueryString["type"].ToLower() == "author")
        {
            this.m_ObjectType = EkEnumeration.CMSObjectTypes.User;
            this.m_UserType = EkEnumeration.UserTypes.AuthorType;
        }

        else if ((Request.QueryString["type"] != null) && Request.QueryString["type"].ToLower() == "member")
        {
            this.m_ObjectType = EkEnumeration.CMSObjectTypes.User;
            this.m_UserType = EkEnumeration.UserTypes.MemberShipType;
        }

        else if ((Request.QueryString["type"] != null) && Request.QueryString["type"].ToLower() == "cgroup")
        {
            this.m_ObjectType = EkEnumeration.CMSObjectTypes.CommunityGroup;
        }

        else if ((Request.QueryString["type"] != null) && Request.QueryString["type"].ToLower() == "locales")
        {
            this.m_LocaleObjectType = EkEnumeration.TaxonomyItemType.Locale;
        }

        else if ((m_strPageAction == "addfolder"))
        {
            localization_folder_chkRecursive_div.Visible = true;
            this.m_ObjectType = EkEnumeration.CMSObjectTypes.Folder;
        }

        if ((Request.QueryString["contFetchType"] != null) && !string.IsNullOrEmpty(Request.QueryString["contFetchType"].ToLower()))
        {
            contentFetchType = Request.QueryString["contFetchType"];
        }

        this.m_refContent = this.m_refContentApi.EkContentRef;
        FormsIcon = "<img src=\"" + this.m_refContentApi.AppPath + "images/UI/Icons/contentForm.png\" alt=\"Form\">";
        ContentIcon = "<img src=\"" + this.m_refContentApi.AppPath + "images/UI/Icons/contentHtml.png\" alt=\"Content\">";
        pageIcon = "<img src=\"" + m_refContentApi.AppPath + "images/ui/icons/layout.png\" alt=\"Page\">";
        if (this.m_UserType == EkEnumeration.UserTypes.AuthorType)
        {
            UserIcon = "<img src=\"" + this.m_refContentApi.AppPath + "Images/ui/icons/user.png\" alt=\"Content\">";
        }
        else
        {
            UserIcon = "<img src=\"" + this.m_refContentApi.AppPath + "Images/ui/icons/userMembership.png\" alt=\"Content\">";
        }
        if ((Page.IsPostBack && (!string.IsNullOrEmpty(Request.Form[isPostData.UniqueID])) && (m_ObjectType == EkEnumeration.CMSObjectTypes.Content | (m_ObjectType == EkEnumeration.CMSObjectTypes.User & !string.IsNullOrEmpty(Request.Form["itemlist"])) | (m_ObjectType == EkEnumeration.CMSObjectTypes.CommunityGroup & !string.IsNullOrEmpty(Request.Form["itemlist"]) | (m_ObjectType == EkEnumeration.CMSObjectTypes.Folder & !string.IsNullOrEmpty(Request.Form["itemlist"])) | (m_ObjectType == EkEnumeration.CMSObjectTypes.TaxonomyNode & !string.IsNullOrEmpty(Request.Form["itemlist"]))))))
        {
            if ((this.m_strPageAction == "additem"))
            {
                TaxonomyRequest item_request = new TaxonomyRequest();
                item_request.TaxonomyId = TaxonomyId;
                item_request.TaxonomyIdList = Validate(Request.Form["itemlist"]);
                if (m_ObjectType == EkEnumeration.CMSObjectTypes.User)
                {
                    item_request.TaxonomyItemType = EkEnumeration.TaxonomyItemType.User;
                }
                else if (this.m_ObjectType == EkEnumeration.CMSObjectTypes.CommunityGroup)
                {
                    item_request.TaxonomyItemType = EkEnumeration.TaxonomyItemType.Group;
                }
                else if (this.m_LocaleObjectType == EkEnumeration.TaxonomyItemType.Locale)
                {
                    item_request.TaxonomyItemType = EkEnumeration.TaxonomyItemType.Locale;
                }
                item_request.TaxonomyLanguage = TaxonomyLanguage;
                m_refContent.AddTaxonomyItem(item_request);
            }
            else if (this.m_strPageAction == "addfolder")
            {
                TaxonomyRequest item_request = new TaxonomyRequest();
                item_request.TaxonomyId = this.TaxonomyId;
                item_request.TaxonomyLanguage = this.TaxonomyLanguage;

                item_request.TaxonomyIdList = this.Validate(Request.Form["newFolderDescendantsCSV"]);
                if (!String.IsNullOrEmpty(item_request.TaxonomyIdList))
                {
                    item_request.TaxonomyItemType = EkEnumeration.TaxonomyItemType.FolderDescendants;
                    this.m_refContent.AddTaxonomyItem(item_request);
                }

                item_request.TaxonomyIdList = this.Validate(Request.Form["newFolderChildrenCSV"]);
                if (!String.IsNullOrEmpty(item_request.TaxonomyIdList))
                {
                    item_request.TaxonomyItemType = EkEnumeration.TaxonomyItemType.FolderChildren;
                    this.m_refContent.AddTaxonomyItem(item_request);
                }
            }
            if ((Request.QueryString["iframe"] == "true"))
            {
                Response.Write("<script type=\"text/javascript\">parent.CloseChildPage();</script>");
            }
            else
            {
                if ((Request.QueryString["type"] != null))
                {
                    if (this.m_LocaleObjectType == EkEnumeration.TaxonomyItemType.Locale)
                    {
                        Response.Redirect("LocaleTaxonomy.aspx?action=view&view=" + this.m_LocaleObjectType + "&taxonomyid=" + this.TaxonomyId);
                    }
                    else
                    {
                        if (this.m_ObjectType == EkEnumeration.CMSObjectTypes.CommunityGroup)
                        {
                            Response.Redirect("LocaleTaxonomy.aspx?action=view&view=cGroup&taxonomyid=" + TaxonomyId);
                        }
                        else
                        {
                            Response.Redirect("LocaleTaxonomy.aspx?action=view&view=" + Convert.ToString(this.m_ObjectType).ToLower() + "&taxonomyid=" + TaxonomyId);
                        }

                    }

                }
                else if (this.m_ObjectType == EkEnumeration.CMSObjectTypes.Folder)
                {
                    Response.Redirect("LocaleTaxonomy.aspx?action=view&view=" + Convert.ToString(this.m_ObjectType).ToLower() + "&taxonomyid=" + TaxonomyId);
                }
                else
                {
                    Response.Redirect("LocaleTaxonomy.aspx?action=view&taxonomyid=" + TaxonomyId);
                }

            }
        }
        else
        {
            this.FolderId = Convert.ToInt64(Request.QueryString["folderid"]);

            folder_data_col = this.m_refContent.GetFolderInfoWithPath(FolderId);
            FolderName = this.folder_data_col["FolderName"].ToString();
            FolderParentId = Convert.ToInt64(this.folder_data_col["ParentID"].ToString());
            FolderPath = this.folder_data_col["Path"].ToString();

            folder_request_col = new Collection();
            folder_request_col.Add(this.FolderId, "ParentID", null, null);
            folder_request_col.Add("name", "OrderBy", null, null);
            folder_data_col = this.m_refContent.GetAllViewableChildFoldersv2_0(folder_request_col);

            if ((m_strPageAction != "additem"))
            {
                if (!string.IsNullOrEmpty(Request.QueryString[EkConstants.ContentTypeUrlParam]))
                {
                    if (Information.IsNumeric(Request.QueryString[EkConstants.ContentTypeUrlParam]))
                    {
                        this.SelectedContentType = Convert.ToInt32(Request.QueryString[EkConstants.ContentTypeUrlParam]);
                        this.m_refContentApi.SetCookieValue(EkConstants.ContentTypeUrlParam.ToString(), SelectedContentType.ToString());
                    }
                }
                else if (!string.IsNullOrEmpty(Ektron.Cms.CommonApi.GetEcmCookie()[(EkConstants.ContentTypeUrlParam)]))
                {
                    if (Information.IsNumeric(Ektron.Cms.CommonApi.GetEcmCookie()[(EkConstants.ContentTypeUrlParam)]))
                    {
                        this.SelectedContentType = Convert.ToInt32(Ektron.Cms.CommonApi.GetEcmCookie()[(EkConstants.ContentTypeUrlParam)]);
                    }
                }
                asset_data = this.m_refContent.GetAssetSuperTypes();
            }
            this.RegisterResources();
            this.TaxonomyToolBar();
            if ((!Page.IsPostBack || m_ObjectType == EkEnumeration.CMSObjectTypes.User || this.m_ObjectType == EkEnumeration.CMSObjectTypes.CommunityGroup))
            {
                //// avoid redisplay when clicking next/prev buttons
                this.DisplayPage();
            }
        }
    }
Пример #2
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        m_refMsg = m_refContentApi.EkMsgRef;
            AppImgPath = m_refContentApi.AppImgPath;
            AppPath = m_refContentApi.AppPath;
            m_strPageAction = Request.QueryString["action"];
            object refApi = m_refContentApi as object;
            Utilities.SetLanguage(m_refContentApi);
            //Utilities.SetLanguage(m_refContentApi);
            TaxonomyLanguage = m_refContentApi.ContentLanguage;
            if (TaxonomyLanguage == -1)
            {
                TaxonomyLanguage = m_refContentApi.DefaultContentLanguage;
            }
            if (Request.QueryString["taxonomyid"] != null)
            {
                TaxonomyId = Convert.ToInt64(Request.QueryString["taxonomyid"]);
            }
            if (Request.QueryString["parentid"] != null)
            {
                TaxonomyParentId = Convert.ToInt64(Request.QueryString["parentid"]);
            }
            if ((Request.QueryString["type"] != null) && Request.QueryString["type"].ToLower() == "author")
            {
                m_ObjectType = Ektron.Cms.Common.EkEnumeration.CMSObjectTypes.User;
                m_UserType = Ektron.Cms.Common.EkEnumeration.UserTypes.AuthorType;
            }
            else if ((Request.QueryString["type"] != null) && Request.QueryString["type"].ToLower() == "member")
            {
                m_ObjectType = Ektron.Cms.Common.EkEnumeration.CMSObjectTypes.User;
                m_UserType = Ektron.Cms.Common.EkEnumeration.UserTypes.MemberShipType;
            }
            else if ((Request.QueryString["type"] != null) && Request.QueryString["type"].ToLower() == "cgroup")
            {
                m_ObjectType = Ektron.Cms.Common.EkEnumeration.CMSObjectTypes.CommunityGroup;
            }

            if ((Request.QueryString["contFetchType"] != null) && Request.QueryString["contFetchType"].ToLower() != "")
            {
                contentFetchType = Request.QueryString["contFetchType"];
            }
            m_refContent = m_refContentApi.EkContentRef;
            CalendarIcon = "<img src=\"" + m_refContentApi.AppPath + "images/UI/Icons/calendar.png\" alt=\"Calendar Event\">";
            FormsIcon = "<img src=\"" + m_refContentApi.AppPath + "images/UI/Icons/contentForm.png\" alt=\"Form\">";
            ContentIcon = "<img src=\"" + m_refContentApi.AppPath + "images/UI/Icons/contentHtml.png\" alt=\"Content\">";
            pageIcon = "<img src=\"" + m_refContentApi.AppPath + "images/ui/icons/layout.png\" alt=\"Page\">"; //-HC-
            if (this.m_UserType == Ektron.Cms.Common.EkEnumeration.UserTypes.AuthorType)
            {
                UserIcon = "<img src=\"" + m_refContentApi.AppPath + "Images/ui/icons/user.png\" alt=\"Content\">";
            }
            else
            {
                UserIcon = "<img src=\"" + m_refContentApi.AppPath + "Images/ui/icons/userMembership.png\" alt=\"Content\">";
            }
            if ((Page.IsPostBack && (!string.IsNullOrEmpty(Request.Form[isPostData.UniqueID])) && (m_ObjectType == EkEnumeration.CMSObjectTypes.Content | (m_ObjectType == EkEnumeration.CMSObjectTypes.User & !string.IsNullOrEmpty(Request.Form["itemlist"])) | (m_ObjectType == EkEnumeration.CMSObjectTypes.CommunityGroup & !string.IsNullOrEmpty(Request.Form["itemlist"]) | (m_ObjectType == EkEnumeration.CMSObjectTypes.Folder & !string.IsNullOrEmpty(Request.Form["itemlist"]))))))
            //if (Page.IsPostBack && (Request.Form[isPostData.UniqueID] != "") && (m_ObjectType == Ektron.Cms.Common.EkEnumeration.CMSObjectTypes.Content || (m_ObjectType == Ektron.Cms.Common.EkEnumeration.CMSObjectTypes.User && Request.Form["itemlist"] != "") || (m_ObjectType == Ektron.Cms.Common.EkEnumeration.CMSObjectTypes.CommunityGroup && Request.Form["itemlist"] != "")))
                {
                if (m_strPageAction == "additem")
                {
                    TaxonomyRequest item_request = new TaxonomyRequest();
                    item_request.TaxonomyId = TaxonomyId;
                    item_request.TaxonomyIdList = Validate(Request.Form["itemlist"]);
                    if (m_ObjectType == Ektron.Cms.Common.EkEnumeration.CMSObjectTypes.User)
                    {
                        item_request.TaxonomyItemType = Ektron.Cms.Common.EkEnumeration.TaxonomyItemType.User;
                    }
                    else if (m_ObjectType == Ektron.Cms.Common.EkEnumeration.CMSObjectTypes.CommunityGroup)
                    {
                        item_request.TaxonomyItemType = Ektron.Cms.Common.EkEnumeration.TaxonomyItemType.Group;
                    }
                    item_request.TaxonomyLanguage = TaxonomyLanguage;
                    m_refContent.AddTaxonomyItem(item_request);
                }
                else if (m_strPageAction == "addfolder")
                {
                    TaxonomySyncRequest sync_request = new TaxonomySyncRequest();
                    sync_request.TaxonomyId = TaxonomyId;
                    sync_request.SyncIdList = Validate(Request.Form["selectedfolder"]); //Validate(Request.Form("itemlist"))
                    //sync_request.SyncRecursiveIdList = Validate(Request.Form("recursiveidlist"))
                    sync_request.TaxonomyLanguage = TaxonomyLanguage;
                    m_refContent.AddTaxonomySyncFolder(sync_request);
                }
                if (Request.QueryString["iframe"] == "true")
                {
                    Response.Write("<script type=\"text/javascript\">parent.CloseChildPage();</script>");
                }
                else
                {
                    Response.Redirect((string) ("taxonomy.aspx?action=view&taxonomyid=" + TaxonomyId));
                }
            }
            else
            {
                FolderId = Convert.ToInt64(Request.QueryString["folderid"]);

                folder_data_col = m_refContent.GetFolderInfoWithPath(FolderId);
                FolderName = folder_data_col["FolderName"].ToString();
                FolderParentId = Convert.ToInt64(folder_data_col["ParentID"].ToString());
                FolderPath = folder_data_col["Path"].ToString();
                folder_request_col = new Collection();
                folder_request_col.Add(FolderId, "ParentID", null, null);
                folder_request_col.Add("name", "OrderBy", null, null);
                folder_data_col = m_refContent.GetAllViewableChildFoldersv2_0(folder_request_col);

                if (m_strPageAction != "additem")
                {
                    if (Request.QueryString[Ektron.Cms.Common.EkConstants.ContentTypeUrlParam] != "")
                    {
                        if (Information.IsNumeric(Request.QueryString[Ektron.Cms.Common.EkConstants.ContentTypeUrlParam]))
                        {
                            SelectedContentType = System.Convert.ToInt32(Request.QueryString[Ektron.Cms.Common.EkConstants.ContentTypeUrlParam]);
                            m_refContentApi.SetCookieValue(Ektron.Cms.Common.EkConstants.ContentTypeUrlParam, SelectedContentType.ToString());
                        }
                    }
                    else if (Ektron.Cms.CommonApi.GetEcmCookie()[Ektron.Cms.Common.EkConstants.ContentTypeUrlParam] != "")
                    {
                        if (Information.IsNumeric(Ektron.Cms.CommonApi.GetEcmCookie()[Ektron.Cms.Common.EkConstants.ContentTypeUrlParam]))
                        {
                            SelectedContentType = System.Convert.ToInt32(Ektron.Cms.CommonApi.GetEcmCookie()[Ektron.Cms.Common.EkConstants.ContentTypeUrlParam]);
                        }
                    }
                    asset_data = m_refContent.GetAssetSuperTypes();
                }
                RegisterResources();
                TaxonomyToolBar();
                if (! Page.IsPostBack || m_ObjectType == Ektron.Cms.Common.EkEnumeration.CMSObjectTypes.User || m_ObjectType == Ektron.Cms.Common.EkEnumeration.CMSObjectTypes.CommunityGroup)
                {
                    // avoid redisplay when clicking next/prev buttons
                    DisplayPage();
                }
            }
    }