private void BuildMenu(NavigationItemBuilder menu) { menu.LinkToFirstChild(false); // See: https://github.com/OrchardCMS/Orchard/issues/2634 menu.Action("Index", "Admin", new { area = "Associativy.Administration" }).Permission(Permissions.ManageAssociativyGraphs); var graphs = _graphManager.FindGraphs(GraphContext.Empty).OrderBy(descriptor => descriptor.DisplayName.Text); int i = 0; foreach (var graph in graphs) { menu.Add(graph.DisplayName, i.ToString(), item => item.Action("ManageGraph", "Admin", new { area = "Associativy.Administration", GraphName = graph.Name }).Permission(Permissions.ManageAssociativyGraphs)); i++; } }
private void BuildMenu(NavigationItemBuilder menu) { menu.LinkToFirstChild(false); // See: http://orchard.codeplex.com/workitem/18807 menu.Action("GlobalSettings", "Admin", new { area = "Onestop.Seo" }).Permission(Permissions.ManageSeo); var seoContentTypes = _seoService.ListSeoContentTypes(); if (seoContentTypes.Count() != 0) { var rewriters = new List<Rewriter> { new Rewriter { DisplayName = T("Title Tag Rewriter"), Type = "TitleRewriter" }, new Rewriter { DisplayName = T("Description Tag Rewriter"), Type = "DescriptionRewriter" }, new Rewriter { DisplayName = T("Keywords Tag Rewriter"), Type = "KeywordsRewriter" } }; int i = 1; foreach (var rewriter in rewriters) { menu.Add(rewriter.DisplayName, i.ToString(), item => { int l = 1; foreach (var contentType in seoContentTypes) { if (l == 1) { item.Action("Rewriter", "Admin", new { area = "Onestop.Seo", rewriterType = rewriter.Type, Id = contentType.Name }); } item .Add(T(contentType.DisplayName), l.ToString(), tab => tab.Action("Rewriter", "Admin", new { area = "Onestop.Seo", rewriterType = rewriter.Type, Id = contentType.Name }) .LocalNav() .Permission(Permissions.ManageSeo)); l++; } }); i++; } } }
static NavigationItemBuilder Describe(NavigationItemBuilder item, string actionName, string controllerName, bool localNav) { item = item.Action(actionName, controllerName, new { area = "Orchard.Packaging" }).Permission(StandardPermissions.SiteOwner); if (localNav) item = item.LocalNav(); return item; }
private void BuildMenu(NavigationItemBuilder menu) { menu.Action("Index", "Admin", new { area = "oforms" }).Permission(StandardPermissions.SiteOwner); }