示例#1
0
 public void GetNavigation(NavigationBuilder builder)
 {
     builder.Add("Content Types", "5",
                 menu => menu
                             .Add("Content Types", "1.0", item => item.Action("ContentTypeList", "MetaData", new { area = "Orchard.MetaData" }).Permission(Permissions.ManageMetaData))
                             );
 }
        public void GetNavigation(NavigationBuilder builder)
        {
            builder

                // Image set
                .AddImageSet("patrocinadores")

                // "Webshop"
                .Add(item => item

                    .Caption(T("Patrocínios"))
                    .Position("1")
                    .LinkToFirstChild(true)

                    // "Customers"
                    .Add(subItem => subItem
                        .Caption(T("Sumário"))
                        .Position("1.1")
                        .Action("Sumario", "Sumario", new { area = "Patrocinadores" })
                    )

                    // "Orders"
                    .Add(subItem => subItem
                        .Caption(T("Patrocinadores"))
                        .Position("1.2")
                        .Action("List", "PatrocinadoresAdmin", new { area = "Patrocinadores" })
                    )
                );
        }
示例#3
0
 public void GetNavigation(NavigationBuilder builder)
 {
     builder.AddImageSet("modules")
         .Add(T("Modules"), "9", menu => menu.Action("Features", "Admin", new {area = "Orchard.Modules"}).Permission(Permissions.ManageFeatures)
             .Add(T("Features"), "0", item => item.Action("Features", "Admin", new {area = "Orchard.Modules"}).Permission(Permissions.ManageFeatures).LocalNav())
             .Add(T("Installed"), "1", item => item.Action("Index", "Admin", new {area = "Orchard.Modules"}).Permission(StandardPermissions.SiteOwner).LocalNav()));
 }
示例#4
0
 public void GetNavigation(NavigationBuilder builder)
 {
     builder.Add(T("Settings"), "50",
         menu => menu
             .Add(T("MailChimp API Key"), "10", item => item.Action("Index", "Admin", new { area = "NogginBox.MailChimp" })
                 .Permission(StandardPermissions.SiteOwner)));
 }
示例#5
0
 public void GetNavigation(NavigationBuilder builder)
 {
     builder.AddImageSet("imagegallery")
     .Add(T("Image Gallery"), "7",
                 menu => menu.Add(T("Image Gallery"), "0", item => item.Action("Index", "Admin", new {area = "Mello.ImageGallery"})
                                                                       .Permission(Permissions.ManageImageGallery)));
 }
示例#6
0
        public void GetNavigation(NavigationBuilder builder) {

            var menus = Services.ContentManager.Query<TitlePart, TitlePartRecord>().OrderBy(x => x.Title).ForType("Menu").List().ToList();
            int firstMenuIndex = 0;
            menus.ForEach(c => {
                builder.AddImageSet(c.Title)
                    .Add(T(c.Title), (++firstMenuIndex).ToString(),
                        menu => {
                            string url = string.Format("#/{0}", c.Id);
                            menu.Url(url);
                            menu.Content(c);
                            menu.IdHint(c.Id.ToString(CultureInfo.InvariantCulture));
                            int menuIdex = 0;
                            var subMenus = _menuService.GetMenuParts(c.Id)
                                .OrderBy(menuPartEntry => menuPartEntry.MenuPosition, new FlatPositionComparer())
                                .ToList();
                            foreach (var subMenu in subMenus) {
                                var subMenuCotent = subMenu;
                                var menuItemEntity = CreateMenuItemEntries(subMenu, url);
                                var moduleMenuItem = subMenu.As<ModuleMenuItemPart>();
                                var position = (++menuIdex).ToString(CultureInfo.InvariantCulture);
                                if (moduleMenuItem != null) {
                                    menu.Add(T(menuItemEntity.Text), position, item =>
                                        item.Url(menuItemEntity.Url).Content(subMenuCotent).IdHint(subMenuCotent.Id.ToString(CultureInfo.InvariantCulture)), 
                                        new List<string>() {moduleMenuItem.IconClass});
                                }
                                else {
                                    menu.Add(T(menuItemEntity.Text), position, item =>
                                        item.Url(menuItemEntity.Url).Content(subMenuCotent).IdHint(subMenuCotent.Id.ToString(CultureInfo.InvariantCulture)));
                                }
                            }
                        });
            });
        }
示例#7
0
 public void GetNavigation(NavigationBuilder builder) {
     builder
         .Add(T("Settings"), menu => menu
             .Add(T("Performance"), "10.0", subMenu => subMenu.Action("Index", "Admin", new { area = "Orchard.Warmup" }).Permission(StandardPermissions.SiteOwner)
                 .Add(T("Warmup"), "10.0", item => item.Action("Index", "Admin", new { area = "Orchard.Warmup" }).Permission(StandardPermissions.SiteOwner).LocalNav())
             ));
 }
示例#8
0
 public void GetNavigation(NavigationBuilder builder)
 {
     builder.AddImageSet("contentsync")
         .Add(root => root
                 .Caption(T("Content Sync"))
                 .Position("1")
                 .LinkToFirstChild(true)
                 .Add(child=>child.Caption(T("Overview"))
                         .Position("0")
                         .Action("Overview", "Admin", new {area = "Tad.ContentSync"})
                         .LocalNav())
                 .Add(child => child.Caption(T("Local Only"))
                         .Position("1")
                         .Action("Comparison", "Admin", new { area = "Tad.ContentSync", type = "LocalOnly" })
                         .LocalNav())
                 .Add(child => child.Caption(T("Remote Only"))
                         .Position("1")
                         .Action("Comparison", "Admin", new { area = "Tad.ContentSync", type = "RemoteOnly" })
                         .LocalNav())
                 .Add(child => child.Caption(T("Differences"))
                         .Position("1")
                         .Action("Comparison", "Admin", new { area = "Tad.ContentSync", type = "Differences" })
                         .LocalNav())
                 .Add(child => child.Caption(T("Mismatches"))
                         .Position("2")
                         .Action("Comparison", "Admin", new { area = "Tad.ContentSync", type = "Mismatches" })
                         .LocalNav()))
         .Add(T("Settings"), menu => menu
             .Add(T("Content Sync"), "99", item => item.Action("Settings", "Admin", new {area = "Tad.ContentSync"})));
 }
 public void GetNavigation(NavigationBuilder builder)
 {
     builder.AddImageSet("imagegallery")
       .Add(T("Directory Nav"), "7",
                   menu => menu.Add(T("Directory Nav"), "0", item => item.Action("Index", "Admin", new { area = "Bolo.DirectoryNav" })
                                                                         .Permission(Permissions.ManageDirectoryNav)));
 }
示例#10
0
 public void GetNavigation(NavigationBuilder builder) {
     builder
         .Add(T("Settings"), menu => menu
             .Add(T("Transliteration"), "10.0", subMenu => subMenu.Action("Index", "TransliterationAdmin", new { area = "Orchard.Localization" })
                 .Add(T("Settings"), "10.0", item => item.Action("Index", "TransliterationAdmin", new { area = "Orchard.Localization" }).LocalNav())
             ));
 }
示例#11
0
 public void GetNavigation(NavigationBuilder builder)
 {
     builder.AddImageSet("polls")
         .Add(T("Polls"), "6",
             menu => menu.Add(T("List"), "0", item => item.Action("Index", "Admin", new { area = "Cascade.Poll" })
                 ));
 }
示例#12
0
 public void GetNavigation(NavigationBuilder builder)
 {
     builder.Add("Site", "11",
                 menu => menu
                             .Add("Manage Themes", "4.0", item => item.Action("Index", "Admin", new { area = "Orchard.Themes" })
                                                                      .Permission(Permissions.ManageThemes).Permission(Permissions.ApplyTheme)));
 }
示例#13
0
 public void GetNavigation(NavigationBuilder builder)
 {
     builder
         .Add(T("Modules"), menu => menu
             .Add(T("Module Profiles"), "4", item => item.Action("Index", "ModuleProfilesAdmin", new { Area = "OrchardHUN.ModuleProfiles" }).LocalNav())
     );
 }
示例#14
0
 public void GetNavigation(NavigationBuilder builder) {
     builder
         .Add(T("Settings"), menu => menu
             .Add(T("Open Authentication"), "10.0", subMenu => subMenu.Action("Index", "Admin", new { area = Constants.LocalArea }).Permission(StandardPermissions.SiteOwner)
                 .Add(T("Settings"), "10.0", item => item.Action("Index", "Admin", new { area = Constants.LocalArea }).Permission(StandardPermissions.SiteOwner).LocalNav())
             ));
 }
示例#15
0
 public void GetNavigation(NavigationBuilder builder) {
     builder.Add(T("Rules"), "4",
         menu => menu
             .Add(T("Manage Rules"), "1.0",
                 item => item.Action("Index", "Admin", new { area = "Orchard.Rules" }).Permission(StandardPermissions.SiteOwner))
     );
 }
示例#16
0
        public void GetNavigation(NavigationBuilder builder) {

            var menus = Services.ContentManager.Query<TitlePart, TitlePartRecord>().OrderBy(x => x.Title).ForType("Menu").List().ToList();
            int firstMenuIndex = 0;
            menus.ForEach(c => {
                builder.AddImageSet(c.Title)
                   .Add(T(c.Title), (++firstMenuIndex).ToString(),
                        menu =>
                        {
                            int menuIdex = 0;
                            var subMenus = _menuService.GetMenuParts(c.Id).
                                OrderBy(menuPartEntry => menuPartEntry.MenuPosition, 
                                new FlatPositionComparer()).ToList();
                            foreach (var subMenu in subMenus) {

                                //var moduleMenuItem = c.As<ModuleMenuItemPart>();
                                //if(moduleMenuItem!=null) {
                                
                                //}

                                var menuItemEntity = CreateMenuItemEntries(subMenu);
                                var moduleMenuItem = subMenu.As<ModuleMenuItemPart>();
                                if (moduleMenuItem != null) {
                                    menu.Add(T(menuItemEntity.Text), (++menuIdex).ToString(), item => item.Url(menuItemEntity.Url), new List<string>() { moduleMenuItem.IconClass});
                                }
                                else
                                {
                                    menu.Add(T(menuItemEntity.Text), (++menuIdex).ToString(), item => item.Url(menuItemEntity.Url));   
                                }
                            }
                        });
            });
        }
示例#17
0
 public void GetNavigation(NavigationBuilder builder)
 {
     // Connections menu for Graph viewing (not implemented)
  /*   builder.Add(T("Connections"), "5", menu => menu
         .Action("Connections"));
    */ 
 }
示例#18
0
 public void GetNavigation(NavigationBuilder builder) {
     builder
         .Add(T("Migrate to 1.4"), "0", menu => menu.Action("Index", "Route", new { area = "UpgradeTo14" })
             .Add(T("Migrate Routes"), "0", item => item.Action("Index", "Route", new { area = "UpgradeTo14" }).LocalNav().Permission(StandardPermissions.SiteOwner))
             .Add(T("Migrate Fields"), "0", item => item.Action("Index", "Field", new { area = "UpgradeTo14" }).LocalNav().Permission(StandardPermissions.SiteOwner))
         );
 }
示例#19
0
        public void GetNavigation(NavigationBuilder builder) {
            builder.Add(T("Content"),
                menu => menu
                    .Add(T("Search"), "1.5", item => item.Action("Index", "Admin", new {area = "Orchard.Search"}).LocalNav())
                );

        }
示例#20
0
        public void GetMenu(IContent menu, NavigationBuilder builder) {
            var menuParts = _contentManager
                .Query<MenuPart, MenuPartRecord>()
                .Where(x => x.MenuId == menu.Id)
                .WithQueryHints(new QueryHints().ExpandRecords<MenuItemPartRecord>())
                .List();

            foreach (var menuPart in menuParts) {
                if (menuPart != null) {
                    var part = menuPart;

                    string culture = null;
                    // fetch the culture of the content menu item, if any
                    var localized = part.As<ILocalizableAspect>();
                    if (localized != null) {
                        culture = localized.Culture;
                    }
                    else {
                        // fetch the culture of the content menu item, if any
                        var contentMenuItemPart = part.As<ContentMenuItemPart>();
                        if (contentMenuItemPart != null) {
                            localized = contentMenuItemPart.Content.As<ILocalizableAspect>();
                            if (localized != null) {
                                culture = localized.Culture;
                            }
                        }
                    }

                    if (part.Is<MenuItemPart>())
                        builder.Add(new LocalizedString(HttpUtility.HtmlEncode(part.MenuText)), part.MenuPosition, item => item.Url(part.As<MenuItemPart>().Url).Content(part).Culture(culture));
                    else
                        builder.Add(new LocalizedString(HttpUtility.HtmlEncode(part.MenuText)), part.MenuPosition, item => item.Action(_contentManager.GetItemMetadata(part.ContentItem).DisplayRouteValues).Content(part).Culture(culture));
                }
            }
        }
        public void GetNavigation(NavigationBuilder builder) {
            var workContext = _workContextAccessor.GetContext();
            var httpContext = workContext.HttpContext;

            if (httpContext == null) {
                return;
            }

            var queryString = workContext.HttpContext.Request.QueryString;

            string part = queryString["part"];
            string field = queryString["field"];

            ContentPickerFieldSettings settings = null;

            // if the picker is loaded for a specific field, apply custom settings
            if (!String.IsNullOrEmpty(part) && !String.IsNullOrEmpty(field)) {
                var definition = _contentDefinitionManager.GetPartDefinition(part).Fields.FirstOrDefault(x => x.Name == field);
                if (definition != null) {
                    settings = definition.Settings.GetModel<ContentPickerFieldSettings>();
                }
            }

            if (settings != null && !settings.ShowContentTab) {
                return;
            }

            builder.Add(T("Content Picker"),
                menu => menu
                    .Add(T("Recent Content"), "5", item => item.Action("Index", "Admin", new { area = "Orchard.ContentPicker" }).LocalNav()));

        }
示例#22
0
 public void GetNavigation(NavigationBuilder builder)
 {
     builder.AddImageSet("media")
         .Add(T("Media"), "6",
             menu => menu.Add(T("Media"), "0", item => item.Action("Index", "Admin", new { area = "Orchard.Media" })
                 .Permission(Permissions.ManageMedia)));
 }
示例#23
0
 public void GetNavigation(NavigationBuilder builder)
 {
     builder.Add(T("Content"),
                 menu => menu
                             .Add(T("Content Types"), "3", item => item.Action("Index", "Admin", new {area = "Orchard.ContentTypes"}).LocalNav())
                             .Add(T("Content Parts"), "4", item => item.Action("ListParts", "Admin", new {area = "Orchard.ContentTypes"}).LocalNav()));
 }
示例#24
0
 public void GetNavigation(NavigationBuilder builder) {
     builder
         .AddImageSet("taxonomies")
         .Add(T("Taxonomies"), "4", menu => menu
         .Add(T("Manage Taxonomies"), "1.0", item => item.Action("Index", "Admin", new { area = "Orchard.Taxonomies" }).Permission(Permissions.ManageTaxonomies))
     );
 }
示例#25
0
 public void GetNavigation(NavigationBuilder builder) {
     var contentTypeDefinitions = _contentDefinitionManager
         .ListTypeDefinitions().OrderBy(d => d.Name);
     var contentTypes = contentTypeDefinitions
         .Where(ctd => ctd.Settings.GetModel<ContentTypeSettings>().Creatable)
         .OrderBy(ctd => ctd.DisplayName);
     if (contentTypes.Any()) {
         builder
             .AddImageSet("content")
             .Add(T("Content"), "1.4", menu => {
                 menu.LinkToFirstChild(false);
                 foreach (var contentTypeDefinition in contentTypes) {
                     if (string.Compare(
                         contentTypeDefinition.Settings["ContentTypeSettings.Creatable"],
                         "true", StringComparison.OrdinalIgnoreCase) == 0) {
                         ContentTypeDefinition definition = contentTypeDefinition;
                         menu.Add(T(contentTypeDefinition.DisplayName), "5", item =>
                             item.Action("List", "Admin",
                             new RouteValueDictionary {
                                 {"area", "Contents"},
                                 {"model.Id", definition.Name}
                             })
                             .Permission(DynamicPermissions.CreateDynamicPermission(
                                 DynamicPermissions.PermissionTemplates["PublishOwnContent"],
                                 definition)));
                     }
                 }
             });
     }
 }
示例#26
0
 public void GetNavigation(NavigationBuilder builder) {
     builder.AddImageSet("users")
         .Add(T("Users"), "11",
             menu => menu.Action("Index", "Admin", new { area = "Orchard.Users" })
                 .Add(T("Users"), "1.0", item => item.Action("Index", "Admin", new { area = "Orchard.Users" })
                     .LocalNav().Permission(Permissions.ManageUsers)));
 }
示例#27
0
 public void GetNavigation(NavigationBuilder builder)
 {
     builder
         .Add(menu => menu
             .Caption(T("OShop"))
             .Add(subMenu => subMenu
                 .Caption(T("Shipping"))
                 .Position("9")
                 .Permission(OShopPermissions.ManageShopSettings)
                 .Add(tab => tab
                     .Caption(T("Providers"))
                     .Position("1")
                     .Action("Index", "ShippingProvidersAdmin", new { area = "OShop" })
                     .Permission(OShopPermissions.ManageShopSettings)
                     .LocalNav()
                     )
                 .Add(tab => tab
                     .Caption(T("Zones"))
                     .Position("5")
                     .Action("Index", "ShippingZonesAdmin", new { area = "OShop" })
                     .Permission(OShopPermissions.ManageShopSettings)
                     .LocalNav()
                     )
             )
         );
 }
示例#28
0
 public void GetNavigation(NavigationBuilder builder) {
     builder.Add(T("Forms"), "4",
         menu => menu
             .Add(T("Manage Forms"), "1.0",
                 item => item.Action("Index", "Admin", new { area = "Orchard.CustomForms" }).Permission(Permissions.ManageForms))
     );
 }
示例#29
0
 public void GetNavigation(NavigationBuilder builder)
 {
     builder.Add("Users", "5",
                 menu => menu
                             .Add("Manage Users", "1.0", item => item.Action("Index", "Admin", new { area = "Orchard.Users" }).Permission(Permissions.ManageUsers))
                             .Add("Add New User", "1.1", item => item.Action("Create", "Admin", new { area = "Orchard.Users" }).Permission(Permissions.ManageUsers)));
 }
示例#30
0
 public void GetNavigation(NavigationBuilder builder) {
     builder
         .Add(T("Audit Trail"), "12", auditTrail => auditTrail
             .Add(T("Recycle Bin"), "2", history => history
                 .Action("Index", "RecycleBin", new { area = "Orchard.AuditTrail" })
                 .LocalNav()));
 }
示例#31
0
 private IEnumerable <IEnumerable <MenuItem> > GetSources(IContent menu)
 {
     foreach (var provider in _menuProviders)
     {
         var builder = new NavigationBuilder();
         IEnumerable <MenuItem> items = null;
         try {
             provider.GetMenu(menu, builder);
             items = builder.Build();
         }
         catch (Exception ex) {
             Logger.Error(ex, "Unexpected error while querying a menu provider. It was ignored. The menu provided by the provider may not be complete.");
         }
         if (items != null)
         {
             yield return(items);
         }
     }
 }
 private IEnumerable <IEnumerable <string> > GetImageSets(string menuName)
 {
     foreach (var provider in _providers)
     {
         if (provider.MenuName == menuName)
         {
             var builder = new NavigationBuilder();
             IEnumerable <string> imageSets = null;
             try {
                 provider.GetNavigation(builder);
                 imageSets = builder.BuildImageSets();
             }
             catch (Exception ex) {
                 Logger.Error(ex, "Unexpected error while querying a navigation provider. It was ignored. The menu provided by the provider may not be complete.");
             }
             if (imageSets != null)
             {
                 yield return(imageSets);
             }
         }
     }
 }