示例#1
0
	private List<BXPublicMenuItem> ExtractMenuItemsFromCollection(string executionVirtualPath, List<BXPublicMenuItem> resultList, BXIBlockSectionCollection coll)
	{
		resultList = null;
		if (coll != null && coll.Count > 0)
		{
			resultList = new List<BXPublicMenuItem>();
			foreach (BXIBlockSection s in coll)
			{
				BXPublicMenuItem i1 = new BXPublicMenuItem();
				i1.Title = s.Name;

				BXParamsBag<object> p = new BXParamsBag<object>();
				p["SECTION_ID"] = s.Id;
				p["SECTION_CODE"] = s.Code ?? string.Empty;
				i1.Links.Add(MakeMenuUri(executionVirtualPath, p));
				i1.Sort = s.Sort;
				resultList.Add(i1);
			}
		}
		return resultList;
	}
示例#2
0
    private List<BXPublicMenuItem> ExtractMenuItemsFromCollection(BXIBlockSectionCollection sectionsList, string executionVirtualPath)
    {
        if (sectionsList == null || sectionsList.Count < 1)
            return null;

        List<BXPublicMenuItem> menuList = new List<BXPublicMenuItem>();
        foreach (BXIBlockSection section in sectionsList)
        {
            BXPublicMenuItem menuItem = new BXPublicMenuItem();
            menuItem.Title = section.Name;
            menuItem.Links.Add(MakeMenuUri(executionVirtualPath, section.Id));
            menuItem.Sort = section.Sort;
            if (!String.IsNullOrEmpty(menuItemPermisson))
            {
                menuItem.ConditionType = ConditionType.Group;
                menuItem.Condition = menuItemPermisson;
            }
            menuList.Add(menuItem);
        }

        return menuList;
    }
示例#3
0
    public virtual void SetupNavchain(BXIBlockSectionCollection navChain, BXParamsBag<object> request)
    {
        string SEFFolder = Parameters.Get<string>("SEFFolder", "/catalog");

        if (navChain != null)
        {           
            string parentSectionUrl, parentSectionCode = String.Empty;
            for (int j = 0; j < navChain.Count; j++)
            {
                if (navChain[j] == null) continue;
                request["section_id"] = navChain[j].Id;
                request["section_code"] = navChain[j].Code;
                string sectionUrl = MakeLink(SectionURL, request);
                if (EnableSef) 
					sectionUrl = BXUri.Combine(SEFFolder, sectionUrl);

                if (j != 0)
                {
                    request["section_id"] = navChain[j].SectionId;
                    request["section_code"] = parentSectionCode;
                    parentSectionUrl = MakeLink(SectionURL, request);
                    if (EnableSef)
						parentSectionUrl = BXUri.Combine(SEFFolder, parentSectionUrl);
                }
                else
                {
                    parentSectionCode = navChain[0].Code;
                    parentSectionUrl = (string)Results["CatalogRoot"];
                }

                BXSiteMapManager.AddNode(
                    parentSectionUrl,
                    sectionUrl,
                    navChain[j].Name);

                parentSectionCode = navChain[j].Code;
            }
        }
    }
示例#4
0
		private List<BXPublicMenuItem> ExtractMenuItemsFromCollection(BXIBlockSectionCollection sectionsList, string executionVirtualPath)
		{
			if (sectionsList == null || sectionsList.Count < 1)
				return null;

			List<BXPublicMenuItem> menuList = new List<BXPublicMenuItem>();
			foreach (BXIBlockSection section in sectionsList)
			{
				BXPublicMenuItem menuItem = new BXPublicMenuItem();
				menuItem.Title = section.Name;

				BXParamsBag<object> replaceItems = new BXParamsBag<object>();
				replaceItems["SECTION_ID"] = section.Id;
				replaceItems["SECTION_CODE"] = section.Code ?? String.Empty;
				replaceItems["SectionId"] = replaceItems["SECTION_ID"];
				replaceItems["SectionCode"] = replaceItems["SECTION_CODE"];

				menuItem.Links.Add(MakeMenuUri(executionVirtualPath, replaceItems));
				menuItem.Sort = section.LeftMargin;
				menuItem.ConditionType = ConditionType.Group;
				menuItem.Condition = menuItemPermisson;
				menuList.Add(menuItem);
			}

			return menuList;
		}