/// <summary> /// Gets formatted string of display names of all predecessors of given category and name of the category itself separated by ">". /// </summary> /// <param name="categoryIdPath">Category ID path</param> private string FormatCategoryPathNames(string categoryIdPath) { var categories = SettingsCategoryInfoProvider.GetCategoriesOnPath(categoryIdPath).Cast <SettingsCategoryInfo>().Select(c => c.CategoryDisplayName); var formatted = categories.Join(" > "); return(formatted); }
/// <summary> /// Gets <c>CategoryPanel</c> instance for the input settings group. /// </summary> /// <param name="group"><c>SettingsCategoryInfo</c> instance representing settings group</param> /// <param name="groupNo">Number representing index of the processing settings group</param> private CategoryPanel GetCategoryPanel(SettingsCategoryInfo group, int groupNo) { string title; if (IsSearchTextValid) { var categories = SettingsCategoryInfoProvider.GetCategoriesOnPath(group.CategoryIDPath); var categoryNames = categories.Select(c => { var displayName = HTMLHelper.HTMLEncode(ResHelper.LocalizeString(c.CategoryDisplayName)); if (c.CategoryIsGroup) { return(displayName); } var url = string.Format("~/CMSModules/Settings/Pages/Categories.aspx?selectedCategoryId={0}&selectedSiteId={1}", c.CategoryID, SiteID); url = ResolveUrl(url); var name = string.Format("<a href=\"\" onclick=\"selectCategory('{0}');\">{1}</a>", url, displayName); return(name); }); title = categoryNames.Join(" > "); } else { title = HTMLHelper.HTMLEncode(ResHelper.LocalizeString(group.CategoryDisplayName)); } var panel = new CategoryPanel { ID = string.Format(@"CategoryPanel{0}", groupNo), DisplayRightPanel = false, AllowCollapsing = false, Text = title, RenderAs = HtmlTextWriterTag.Div }; return(panel); }