Example #1
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        _MessageHelper = _Common.EkMsgRef;
        AppImgPath = _Common.AppImgPath;
        AppPath = _Common.AppPath;
        this.MenuAppPath.Text = AppPath;
        _PageAction = Request.QueryString["action"];
        object refCommon = _Common as object;
        mainTranslationPackageLink = "<a href =\"LocaleTaxonomy.aspx\">Translation Packages</a>";
        Utilities.SetLanguage(_Common);
        RegisterResources();
        _Content = _Common.EkContentRef;
           // TaxonomyLanguage = _Common.DefaultContentLanguage;
        TaxonomyLanguage = _Common.ContentLanguage;
        TaxonomyId = Convert.ToInt64(Request.QueryString["taxonomyid"]);
        if ((Request.QueryString["view"] != null))
        {
            _ViewItem = Request.QueryString["view"];
        }
        taxonomy_request = new TaxonomyRequest();
        taxonomy_request.TaxonomyId = TaxonomyId;
        taxonomy_request.TaxonomyLanguage = TaxonomyLanguage;
        taxonomy_request.PageSize = 99999999;
        // pagesize of 0 used to mean "all"
        TaxonomyBaseData[] taxcats = null;
        taxcats = _Content.ReadAllSubCategories(taxonomy_request);

        if ((taxcats != null))
        {
            TaxonomyCategoryCount = taxcats.Length;
        }
        if ((Page.IsPostBack && !string.IsNullOrEmpty(Request.Form[isPostData.UniqueID])))
        {
            if ((Request.Form["submittedaction"] == "delete"))
            {
                _Content.DeleteTaxonomy(taxonomy_request);
                //Response.Write("<script type=""text/javascript"">parent.CloseChildPage();</script>")
                Response.Redirect("LocaleTaxonomy.aspx?rf=1", false);
            }
            else if ((Request.Form["submittedaction"] == "deleteitem"))
            {
                taxonomy_request.TaxonomyIdList = Request.Form["selected_items"];
                switch (_ViewItem.ToLower())
                {
                    case "cgroup":
                        taxonomy_request.TaxonomyItemType = EkEnumeration.TaxonomyItemType.Group;
                        break;
                    case "user":
                        taxonomy_request.TaxonomyItemType = EkEnumeration.TaxonomyItemType.User;
                        break;
                    case "locale":
                        taxonomy_request.TaxonomyItemType = EkEnumeration.TaxonomyItemType.Locale;
                        break;
                    case "folder":
                        taxonomy_request.TaxonomyItemType = EkEnumeration.TaxonomyItemType.FolderDescendants;
                        _Content.RemoveTaxonomyItem(taxonomy_request);
                        taxonomy_request.TaxonomyItemType = EkEnumeration.TaxonomyItemType.FolderChildren;
                        break;
                    default:
                        taxonomy_request.TaxonomyItemType = EkEnumeration.TaxonomyItemType.Content;
                        break;
                }

                _Content.RemoveTaxonomyItem(taxonomy_request);
                if ((Request.Params["ccp"] == null))
                {
                    Response.Redirect("LocaleTaxonomy.aspx?" + Request.ServerVariables["query_string"] + "&ccp=true", true);
                }
                else
                {
                    Response.Redirect("LocaleTaxonomy.aspx?" + Request.ServerVariables["query_string"], true);
                }
            }
        }
        else if ((IsPostBack == false))
        {
            DisplayPage();
        }

        AssignTextStrings();

        isPostData.Value = "true";
        hdnSourceId.Value = TaxonomyId.ToString();
    }