예제 #1
0
        /// <summary>
        /// Creates the entries menu
        /// </summary>
        private void CreateEntriesMenu(MenuDefinition menu)
        {
            menu.AddItem(CreateMenuItem(
                             "entries",
                             L("Navigation_Entries"),
                             "#/entries",
                             "fa-list",
                             templateUrl: "/app/main/views/entries/index.cshtml",
                             routeUrl: "/entries"
                             ));

            menu.AddItem(CreateMenuItem(
                             "entries_create",
                             L("entries_create"),
                             "#/entries/create",
                             null,
                             templateUrl: "/app/main/views/entries/create.cshtml",
                             routeUrl: "/entries/create",
                             hidden: true
                             ));

            menu.AddItem(CreateMenuItem(
                             "entries_edit",
                             L("entries_edit"),
                             "#/entries/edit/",
                             null,
                             templateUrl: "/app/main/views/entries/edit.cshtml",
                             routeUrl: "/entries/:entryid/edit",
                             hidden: true
                             ));
        }
예제 #2
0
        private List <MenuDefinition> LoadMenu()
        {
            string xmlString;

            using (var stream = Assembly.GetEntryAssembly().GetManifestResourceStream("JK.Web.appMenus.config"))
            {
                xmlString = Utf8Helper.ReadStringFromStream(stream);
            }

            using (var sr = new StringReader(xmlString))
            {
                using (var xr = XmlReader.Create(sr,
                                                 new XmlReaderSettings
                {
                    CloseInput = true,
                    IgnoreWhitespace = true,
                    IgnoreComments = true,
                    IgnoreProcessingInstructions = true
                }))
                {
                    var xmlDocument = new XmlDocument();
                    xmlDocument.Load(xr);
                    var root = xmlDocument.SelectSingleNode("/root");
                    var menuDefinitionNode = root.SelectNodes("menuDefinition");
                    if (menuDefinitionNode == null || menuDefinitionNode.Count <= 0)
                    {
                        throw new AbpException("A Menu Xml must include menuDefinition as root node.");
                    }
                    List <MenuDefinition> list = new List <MenuDefinition>();

                    foreach (XmlNode node in menuDefinitionNode)
                    {
                        var name = node.GetAttributeValueOrNull("name");
                        if (string.IsNullOrEmpty(name))
                        {
                            throw new AbpException("name is not defined in menu XML file!");
                        }
                        var displayName    = node.GetAttributeValueOrNull("displayName");
                        var menuDefinition = new MenuDefinition(name, L(displayName));
                        if (node.HasChildNodes)
                        {
                            foreach (XmlNode item in node.ChildNodes)
                            {
                                var itemName = item.GetAttributeValueOrNull("name");
                                if (string.IsNullOrEmpty(name))
                                {
                                    throw new AbpException("name is not defined in menu XML file!");
                                }
                                var itemDisplayName    = item.GetAttributeValueOrNull("displayName");
                                var menuItemDefinition = new MenuItemDefinition(itemName, L(itemDisplayName));
                                Iterate(menuItemDefinition, item);
                                menuDefinition.AddItem(menuItemDefinition);
                            }
                        }
                        list.Add(menuDefinition);
                    }
                    return(list);
                }
            }
        }
        public void CreateMenuItemDefinition(MenuDefinition menuDefinition)
        {
            //获取所有模块
            List <SysMenus> data = _menusRepository.GetAllList().Where(p => p.IsActive == true).ToList();

            //转换模块数据格式,转换成子父节点包含的形式
            data = _sysMenusRepository.ConvertMenusByChildrenList(data);

            foreach (SysMenus item in data)
            {
                MenuItemDefinition menuItemDefinition = new MenuItemDefinition(
                    name: item.MenuName,
                    //displayName: item.MenuDisplayName.L(),
                    displayName: GetMenuLocalizable(item.MenuDisplayName),
                    icon: item.Icon,
                    url: item.Url,
                    requiresAuthentication: item.IsRequiresAuth,
                    requiredPermissionName: item.PermissionName,
                    customData: null,
                    order: Convert.ToInt32(item.OrderBy)
                    );

                SetChildrenMenusNavigation(menuItemDefinition, item);

                menuDefinition.AddItem(menuItemDefinition);
            }
        }
        public override void SetNavigation(INavigationProviderContext context)
        {
//todo inject product repository and get categories over linq

            var sideMenu = new MenuDefinition("SideBarMenu",
                                              new LocalizableString("SideBarMenu", SportsstoreConsts.LocalizationSourceName));

            sideMenu
            .AddItem(new MenuItemDefinition(
                         "Watersports",
                         L("Watersports"),
                         url: "/Watersports",
                         icon: "fa fa-info"
                         ))
            .AddItem(new MenuItemDefinition(
                         "Soccer",
                         L("Soccer"),
                         url: "/Soccer",
                         icon: "fa fa-info"
                         ))
            .AddItem(new MenuItemDefinition(
                         "Chess",
                         L("Chess"),
                         url: "/Chess",
                         icon: "fa fa-info"
                         ));

            context.Manager.Menus.Add("SideMenu", sideMenu);
        }
예제 #5
0
        public override void SetNavigation(INavigationProviderContext context)
        {
            MenuDefinition menuDefinition = new MenuDefinition("Frontend", new FixedLocalizableString("Frontend menu"), null);

            context.Manager.Menus["Frontend"] = menuDefinition;
            menuDefinition.AddItem(new MenuItemDefinition("Frontend.Home", FrontEndNavigationProvider.L("HomePage"), null, "", false, null, 0, null, null)).AddItem(new MenuItemDefinition("Frontend.About", FrontEndNavigationProvider.L("AboutUs"), null, "About", false, null, 0, null, null));
        }
예제 #6
0
        public override void SetNavigation(INavigationProviderContext context)
        {
            var frontEndMenu = new MenuDefinition(MenuName, new FixedLocalizableString("Frontend menu"));

            context.Manager.Menus[MenuName] = frontEndMenu;

            frontEndMenu

            //HOME
            .AddItem(new MenuItemDefinition(
                         PageNames.Frontend.Home,
                         L("HomePage"),
                         url: ""
                         )

                     //ABOUT
                     ).AddItem(new MenuItemDefinition(
                                   PageNames.Frontend.About,
                                   L("AboutUs"),
                                   url: "About"
                                   )

                               //MULTI-LEVEL MENU (JUST FOR EXAMPLE)
                               //).AddItem(new MenuItemDefinition(
                               //    "MultiLevelMenu",
                               //    new FixedLocalizableString("Multi level menu")
                               //    ).AddItem(new MenuItemDefinition(
                               //        "MultiLevelMenu.1",
                               //        new FixedLocalizableString("Sub menu item 1")
                               //        )
                               //    ).AddItem(new MenuItemDefinition(
                               //        "MultiLevelMenu.2",
                               //        new FixedLocalizableString("Sub menu item 2")
                               //        ).AddItem(new MenuItemDefinition(
                               //            "MultiLevelMenu.2.1",
                               //            new FixedLocalizableString("Sub menu item 2.1")
                               //            )
                               //        ).AddItem(new MenuItemDefinition(
                               //            "MultiLevelMenu.2.2",
                               //            new FixedLocalizableString("Sub menu item 2.2")
                               //            )
                               //        ).AddItem(new MenuItemDefinition(
                               //            "MultiLevelMenu.2.3",
                               //            new FixedLocalizableString("Sub menu item 2.3")
                               //            ).AddItem(new MenuItemDefinition(
                               //                "MultiLevelMenu.2.3.1",
                               //                new FixedLocalizableString("ASP.NET Boilerplate"),
                               //                url: "http://aspnetboilerplate.com"
                               //                )
                               //            ).AddItem(new MenuItemDefinition(
                               //                "MultiLevelMenu.2.3.2",
                               //                new FixedLocalizableString("jtable.org"),
                               //                url: "http://jtable.org"
                               //                )
                               //            )
                               //        )
                               //    )
                               );
        }
예제 #7
0
        public override void SetNavigation(INavigationProviderContext context)
        {
            var menu = new MenuDefinition(MenuGroupName, new FixedLocalizableString("主菜单"));

            context.Manager.Menus["Code"] = menu;
            menu
            .AddItem(
                new MenuItemDefinition("系统管理", L("系统管理"))
                .AddItem(
                    new MenuItemDefinition(
                        "organization",
                        L("组织机构"),
                        url: "/organization",
                        icon: "",
                        requiredPermissionName: PermissionNames.Pages_Administration_OrganizationUnits_Lookup
                        )
                    )
                .AddItem(
                    new MenuItemDefinition(
                        "role",
                        L("角色"),
                        url: "/role",
                        icon: "",
                        requiredPermissionName: PermissionNames.Pages_Administration_Roles_Lookup
                        )
                    )
                .AddItem(
                    new MenuItemDefinition(
                        "user",
                        L("用户"),
                        url: "/user",
                        icon: "",
                        requiredPermissionName: PermissionNames.Pages_Administration_Users_Lookup
                        )
                    )
                .AddItem(
                    new MenuItemDefinition(
                        "auditLog",
                        L("审计日志"),
                        url: "/auditLog",
                        icon: "",
                        requiredPermissionName: PermissionNames.Pages_Administration_AuditLogs
                        )
                    )
                .AddItem(
                    new MenuItemDefinition(
                        "configuration",
                        L("设置"),
                        url: "/configuration",
                        icon: "",
                        requiredPermissionName: PermissionNames.Pages_Administration_Settings
                        )
                    )
                );
        }
예제 #8
0
 /// <summary>
 /// Creates the trash menu
 /// </summary>
 private void CreateTrashMenu(MenuDefinition menu)
 {
     menu.AddItem(CreateMenuItem(
                      "trash",
                      L("Navigation_Trash"),
                      "#/trash",
                      "fa-trash",
                      templateUrl: "/app/main/views/trash/index.cshtml",
                      routeUrl: "/trash"
                      ));
 }
예제 #9
0
        public override void SetNavigation(INavigationProviderContext context)
        {
            IDictionary <string, MenuDefinition> menus = context.Manager.Menus;
            MenuDefinition menuDefinition  = new MenuDefinition("Mpa", new FixedLocalizableString("Main Menu"), null);
            MenuDefinition menuDefinition1 = menuDefinition;

            menus["Mpa"] = menuDefinition;
            MenuDefinition menuDefinition2 = menuDefinition1;

            menuDefinition2.AddItem(new MenuItemDefinition("Tenants", MpaNavigationProvider.L("Tenants"), "icon-globe", "Mpa/Tenants", false, "Pages.Tenants", 0, null, null)).AddItem(new MenuItemDefinition("Editions", MpaNavigationProvider.L("Editions"), "icon-grid", "Mpa/Editions", false, "Pages.Editions", 0, null, null)).AddItem(new MenuItemDefinition("Dashboard.Tenant", MpaNavigationProvider.L("Dashboard"), "icon-home", "Mpa/Dashboard", false, "Pages.Tenant.Dashboard", 0, null, null)).AddItem((new MenuItemDefinition("FuelCast.Tenant", MpaNavigationProvider.L("FuelCast"), "icon-graph", "Mpa/FuelCast", false, "Pages.Tenant.FuelCast", 0, null, null)).AddItem(new MenuItemDefinition("Trucks.Tenant", MpaNavigationProvider.L("Trucks"), "fa fa-truck", "Mpa/Trucks", false, "Pages.Tenant.Trucks", 0, null, null)).AddItem(new MenuItemDefinition("FillLots.Tenant", MpaNavigationProvider.L("FuelLots"), "fa fa-filter", "Mpa/FillLots", false, "Pages.Tenant.FillLots", 0, null, null)).AddItem(new MenuItemDefinition("FuelCastSettings.Tenant", MpaNavigationProvider.L("Settings"), "fa fa-wrench", "Mpa/FuelCastSettings", false, "Pages.Tenant.FuelCastSettings", 0, null, null))).AddItem((new MenuItemDefinition("Invoices.Tenant", MpaNavigationProvider.L("Invoices"), "fa fa-file-text-o", "Mpa/Invoices", false, "Pages.Tenant.Invoices", 0, null, null)).AddItem(new MenuItemDefinition("InvoicePayments.Tenant", MpaNavigationProvider.L("InvoiceInvoices"), "fa fa-pencil", "Mpa/Invoices", false, "Pages.Tenant.Invoices", 0, null, null)).AddItem(new MenuItemDefinition("InvoicePayments.Tenant", MpaNavigationProvider.L("InvoicePayments"), "fa fa-money", "Mpa/Payments", false, "Pages.Tenant.InvoicePayments", 0, null, null))).AddItem(new MenuItemDefinition("Customers.Tenant", MpaNavigationProvider.L("Customers"), "icon-users", "Mpa/Customers", false, "Pages.Tenant.Customers", 0, null, null)).AddItem(new MenuItemDefinition("Suppliers.Tenant", MpaNavigationProvider.L("Suppliers"), "icon-share", "Mpa/Suppliers", false, "Pages.Tenant.Suppliers", 0, null, null)).AddItem(new MenuItemDefinition("Products.Tenant", MpaNavigationProvider.L("Products"), "fa fa-barcode", "Mpa/Products", false, "Pages.Tenant.Products", 0, null, null)).AddItem((new MenuItemDefinition("ProjectsAndEstimates.Tenant", MpaNavigationProvider.L("ProjectsAndEstimates"), "icon-notebook", "Mpa/ProjectAndEstimates", false, "Pages.Tenant.ProjectsAndEstimates", 0, null, null)).AddItem(new MenuItemDefinition("Projects.Tenant", MpaNavigationProvider.L("Projects"), "fa fa-hourglass-o", "Mpa/Projects", false, "Pages.Tenant.Projects", 0, null, null)).AddItem(new MenuItemDefinition("Estimates.Tenant", MpaNavigationProvider.L("Estimates"), "icon-pencil", "Mpa/Estimates", false, "Pages.Tenant.Estimates", 0, null, null))).AddItem((new MenuItemDefinition("Administration", MpaNavigationProvider.L("Administration"), "icon-wrench", null, false, null, 0, null, null)).AddItem(new MenuItemDefinition("Administration.OrganizationUnits", MpaNavigationProvider.L("OrganizationUnits"), "icon-layers", "Mpa/OrganizationUnits", false, "Pages.Administration.OrganizationUnits", 0, null, null)).AddItem(new MenuItemDefinition("Administration.Roles", MpaNavigationProvider.L("Roles"), "icon-briefcase", "Mpa/Roles", false, "Pages.Administration.Roles", 0, null, null)).AddItem(new MenuItemDefinition("Administration.Users", MpaNavigationProvider.L("Users"), "icon-users", "Mpa/Users", false, "Pages.Administration.Users", 0, null, null)).AddItem(new MenuItemDefinition("Administration.Contacts", MpaNavigationProvider.L("Contacts"), "icon-support", "Mpa/Contacts", false, "Pages.Administration.Contacts", 0, null, null)).AddItem(new MenuItemDefinition("Administration.Titles", MpaNavigationProvider.L("Titles"), "icon-list", "Mpa/Titles", false, "Pages.Administration.Titles", 0, null, null)).AddItem(new MenuItemDefinition("Administration.Taxes", MpaNavigationProvider.L("Taxes"), "fa fa-calculator", "Mpa/Taxes", false, "Pages.Administration.Taxes", 0, null, null)).AddItem(new MenuItemDefinition("Administration.TaxRules", MpaNavigationProvider.L("TaxRules"), "fa fa-institution", "Mpa/TaxRules", false, "Pages.Administration.TaxRules", 0, null, null)).AddItem(new MenuItemDefinition("Administration.EmergencyDeliveryFees", MpaNavigationProvider.L("EmergencyDeliveryFees"), "fa fa-truck", "Mpa/EmergencyDeliveryFees", false, "Pages.Administration.EmergencyDeliveryFees", 0, null, null)).AddItem(new MenuItemDefinition("Administration.Zones", MpaNavigationProvider.L("Zones"), "icon-grid", "Mpa/Zones", false, "Pages.Administration.Zones", 0, null, null)).AddItem(new MenuItemDefinition("Administration.Languages", MpaNavigationProvider.L("Languages"), "icon-flag", "Mpa/Languages", false, "Pages.Administration.Languages", 0, null, null)).AddItem(new MenuItemDefinition("Administration.AuditLogs", MpaNavigationProvider.L("AuditLogs"), "icon-lock", "Mpa/AuditLogs", false, "Pages.Administration.AuditLogs", 0, null, null)).AddItem(new MenuItemDefinition("Administration.Settings.Host", MpaNavigationProvider.L("Settings"), "icon-settings", "Mpa/HostSettings", false, "Pages.Administration.Host.Settings", 0, null, null)).AddItem(new MenuItemDefinition("Administration.Settings.Tenant", MpaNavigationProvider.L("Settings"), "icon-settings", "Mpa/Settings", false, "Pages.Administration.Tenant.Settings", 0, null, null)));
        }
예제 #10
0
        private void InitAdminMenu(INavigationProviderContext context)
        {
            var adminMenu = new MenuDefinition("AdminMenu", L("AdminMenu"));

            adminMenu.AddItem(
                new MenuItemDefinition(
                    "Tenants",
                    L("Tenants"),
                    url: "Admin/Tenants",
                    icon: "fa fa-globe",
                    requiredPermissionName: PermissionNames.Pages_Tenants
                    //requiredPermissionName: PermissionNames.Host.Administration
                    )
                ).AddItem(
                new MenuItemDefinition(
                    "Content",
                    L("Content"),
                    url: "Admin/Content",
                    icon: "fa fa - info"
                    //requiredPermissionName: PermissionNames.Administration
                    )
                ).AddItem(
                new MenuItemDefinition(
                    "Users",
                    L("Users"),
                    url: "Admin/Users",
                    icon: "fa fa-users",
                    //requiredPermissionName: PermissionNames.Pages_Users
                    requiredPermissionName: PermissionNames.Tenant.Administration
                    )
                ).AddItem(
                new MenuItemDefinition(
                    "Roles",
                    L("Roles"),
                    url: "Admin/Roles",
                    icon: "fa fa-users",
                    //requiredPermissionName: PermissionNames.Pages_Users
                    requiredPermissionName: PermissionNames.Tenant.Administration
                    )
                ).AddItem(
                new MenuItemDefinition(
                    "Permissions",
                    L("Permissions"),
                    url: "Admin/Permissions",
                    icon: "fa fa-users",
                    //requiredPermissionName: PermissionNames.Pages_Users
                    requiredPermissionName: PermissionNames.Tenant.Administration
                    )
                );

            context.Manager.Menus.Add("AdminMenu", adminMenu);
        }
        private void GetMenus(MenuDefinition mainMenu)
        {
            var parentMenus = _menuRepository.GetAllList(p => p.ParentMenuId == 0 && p.IsEnabled == true && p.IsVisible == true).OrderBy(p => p.Order);

            foreach (var item in parentMenus)
            {
                mainMenu.AddItem(new MenuItemDefinition(item.Name, L(item.LocalizationName), icon: item.Icon, url: item.Url,
                                                        requiresAuthentication: item.RequiresAuthentication, requiredPermissionName: item.RequiredPermissionName, order: item.Order,
                                                        isEnabled: item.IsEnabled, isVisible: item.IsVisible));
                var menuItem = mainMenu.Items.Find(p => p.Name == item.Name);
                GetChildMenus(menuItem);
            }
        }
예제 #12
0
        public void SetMenu(MenuDefinition mainMenu, IEnumerable <MenuDto> menues)
        {
            foreach (var menu in menues)
            {
                var menuitem = new MenuItemDefinition(
                    menu.Name,
                    new LocalizableString(menu.DisplayName, IdentityConsts.LocalizationSourceName),
                    url: menu.Url,
                    icon: menu.Icon
                    );
                mainMenu.AddItem(menuitem);

                if (menu.Items.Count > 0)
                {
                    SetMenu(menuitem, menu.Items);
                }
            }
        }
예제 #13
0
        public const string MenuName = "HomeMenu";  //自定义导航属性

        public override void SetNavigation(INavigationProviderContext context)
        {
            var menu = new MenuDefinition(MenuName, new FixedLocalizableString("Home Menu"));

            context.Manager.Menus[MenuName] = menu;
            menu.AddItem(new MenuItemDefinition(
                             PageNames.Frontend.Home,
                             L("HomePage"),
                             url: ""
                             )
                         )
            .AddItem(new MenuItemDefinition(
                         PageNames.Frontend.About,
                         L("AboutUs"),
                         url: "About"
                         )
                     );
        }
예제 #14
0
        /// <summary>
        /// 构建导航菜单
        /// </summary>
        /// <param name="context"></param>
        public override void SetNavigation(INavigationProviderContext context)
        {
            if (context != null)
            {
                _context = context;
            }
            else
            {
                context = _context;
            }
            var menu = new MenuDefinition(MenuGroupName, new FixedLocalizableString("主菜单"));

            context.Manager.Menus[MenuGroupName] = menu;
            var dbContext = CreateDbContext();
            //var _menuRepository = IocManager.Instance.Resolve<IRepository<Menu>>();
            var menuItemList = dbContext.Menus //_menuRepository.GetAll()
                               .Where(m => m.IsVisible)
                               .ToList();
            var allMenus = new Dictionary <int, MenuItemDefinition>();

            foreach (var item in menuItemList)
            {
                var itemDefinition = new MenuItemDefinition(
                    item.Id.ToString(), L(item.DisplayName),
                    url: item.Url, icon: item.Icon, requiredPermissionName: item.RequiredPermissionName,
                    order: item.Order, isEnabled: item.IsEnabled, target: item.Target);
                allMenus.Add(item.Id, itemDefinition);
            }
            foreach (var item in menuItemList)
            {
                if (item.ParentId == 0)
                {
                    menu.AddItem(allMenus[item.Id]);
                }
                else
                {
                    var parent = allMenus[item.ParentId];
                    parent.AddItem(allMenus[item.Id]);
                }
            }
        }
예제 #15
0
        public override void SetNavigation(INavigationProviderContext context)
        {
            var frontEndMenu = new MenuDefinition(MenuName, new FixedLocalizableString("Frontend menu"));

            context.Manager.Menus[MenuName] = frontEndMenu;

            frontEndMenu

            //HOME
            .AddItem(new MenuItemDefinition(
                         PageNames.Frontend.Home,
                         L("Trang chủ"),
                         url: ""
                         )
                     //Thutuchanhchinh
                     ).AddItem(new MenuItemDefinition(
                                   PageNames.Frontend.Thutuchanhchinh,
                                   L("Bộ thủ tục"),
                                   url: "/thu-tuc-hanh-chinh"
                                   )
                               //Hethongbaocao
                               //).AddItem(new MenuItemDefinition(
                               //    PageNames.Frontend.Thongke,
                               //    L("Thống kê"),
                               //    url: "thong-ke"
                               //    )
                               //Hethongbaocao
                               ).AddItem(new MenuItemDefinition(
                                             PageNames.Frontend.Baocao,
                                             L("Thông báo"),
                                             url: "thong-bao"
                                             )
                                         //Lienhe
                                         ).AddItem(new MenuItemDefinition(
                                                       PageNames.Frontend.Lienhe,
                                                       L("Liên hệ"),
                                                       url: "lien-he"
                                                       )
                                                   );
        }
예제 #16
0
        public override void SetNavigation(INavigationProviderContext context)
        {
            var administrationMenu = new MenuDefinition("AdministrationMenu", new FixedLocalizableString("后台管理"));

            var pagees = new MenuItemDefinition(
                Permissions.Pages_Administration,
                new LocalizableString("PagesAdministration", LyuAdminConsts.PermissionsSourceName),
                "fa fa-wrench",
                "/admin/dashboard",
                true,
                Permissions.Pages_Administration
                );

            var role = new MenuItemDefinition(
                RolesPermissions.Role,
                new LocalizableString("Role", LyuAdminConsts.PermissionsSourceName),
                "fa fa-circle-o",
                "/admin/role",
                true,
                RolesPermissions.Role
                );

            var user = new MenuItemDefinition(
                UsersPermissions.User,
                new LocalizableString("User", LyuAdminConsts.PermissionsSourceName),
                "fa fa-circle-o",
                "/admin/user",
                true,
                UsersPermissions.User
                );

            pagees.AddItem(user);
            pagees.AddItem(role);

            administrationMenu
            .AddItem(pagees);
            context.Manager.Menus.Add("AdministrationMenu", administrationMenu);
        }
예제 #17
0
        private static void InitSideMenu(INavigationProviderContext context)
        {
            var sideMenu = new MenuDefinition("SideMenu", L("SideMenu"));

            sideMenu
            .AddItem(new MenuItemDefinition(
                         "All Products",
                         L("All Products"),
                         url: "/Products",
                         icon: "fa fa-product-hunt",
                         requiresAuthentication: true
                         ))
            .AddItem(new MenuItemDefinition(
                         "Watersports",
                         L("Watersports"),
                         url: "/Watersports",
                         icon: "fa fa-life-ring",
                         requiresAuthentication: true
                         ))
            .AddItem(new MenuItemDefinition(
                         "Soccer",
                         L("Soccer"),
                         url: "/Soccer",
                         icon: "fa fa-futbol-o",
                         requiresAuthentication: true
                         ))
            .AddItem(new MenuItemDefinition(
                         "Chess",
                         L("Chess"),
                         url: "/Chess",
                         icon: "fa fa-beer",
                         requiresAuthentication: true
                         ));

            context.Manager.Menus.Add("SideMenu", sideMenu);
        }
예제 #18
0
        public override void SetNavigation(INavigationProviderContext context)
        {
            var menu = new MenuDefinition(MenuName, new FixedLocalizableString("Manager Menu"));

            context.Manager.Menus[MenuName] = menu;

            menu.AddItem(
                new MenuItemDefinition(
                    "Manager.SystemManager",
                    new LocalizableString("SystemManager", ApplicationConsts.LocalizationSourceName),
                    icon: "icon-cog").AddItem(
                    //Common
                    new MenuItemDefinition(
                        "Common.User",
                        L("User"),
                        url: "user.index",
                        icon: "icon-group",
                        requiredPermissionName: AppPermissions.PagesAdministrationCommon
                        )
                    ).AddItem(
                    new MenuItemDefinition(
                        "Common.Role",
                        L("Role"),
                        url: "role.index",
                        icon: "icon-key",
                        requiredPermissionName: AppPermissions.PagesAdministrationCommon
                        )
                    )
                //Host
                .AddItem(
                    new MenuItemDefinition(
                        "Host.Dashboard",
                        L("Dashboard"),
                        url: "host.dashboard",
                        icon: "icon-globe",
                        requiredPermissionName: AppPermissions.PagesAdministrationHostTenants
                        )
                    )
                .AddItem(
                    new MenuItemDefinition(
                        "Host.Tenants",
                        L("Tenants"),
                        url: "host.tenant.index",
                        icon: "icon-globe",
                        requiredPermissionName: AppPermissions.PagesAdministrationHostTenants
                        )
                    ).AddItem(
                    new MenuItemDefinition(
                        "Host.Edition",
                        L("Editions"),
                        url: "host.edition",
                        icon: "icon-inbox",
                        requiredPermissionName: AppPermissions.PagesAdministrationHostEditions
                        )
                    ).AddItem(
                    new MenuItemDefinition(
                        "Host.Maintenance",
                        L("Maintenance"),
                        url: "host.maintenance",
                        icon: "icon-dashboard",
                        requiredPermissionName: AppPermissions.PagesAdministrationHostMaintenance
                        )
                    ).AddItem(
                    new MenuItemDefinition(
                        "Host.Setting",
                        L("Setting"),
                        url: "host.setting",
                        icon: "icon-cog",
                        requiredPermissionName: AppPermissions.PagesAdministrationHost
                        )
                    ).AddItem(
                    new MenuItemDefinition(
                        "Host.BackgroundJob",
                        L("BackgroundJob"),
                        url: "host.backgroundJob",
                        icon: "icon-tasks",
                        requiredPermissionName: AppPermissions.PagesAdministrationHostBackgroundJobs
                        )
                    ).AddItem(
                    new MenuItemDefinition(
                        "Host.AuditLog",
                        L("AuditLog"),
                        url: "host.auditLog",
                        icon: "icon-bolt",
                        requiredPermissionName: AppPermissions.PagesAdministrationHostAudtiLogs
                        )
                    ).AddItem(
                    new MenuItemDefinition(
                        "Host.Language",
                        L("Language"),
                        url: "host.language",
                        icon: "icon-cog",
                        requiredPermissionName: AppPermissions.PagesAdministrationHostLanguages
                        )
                    ).AddItem(
                    //Tenant
                    new MenuItemDefinition(
                        "Tenant.Setting",
                        L("Setting"),
                        url: "tenant.setting",
                        icon: "icon-cog",
                        requiredPermissionName: AppPermissions.PagesAdministrationTenant
                        )
                    ).AddItem(
                    new MenuItemDefinition(
                        "Tenant.Dashboard",
                        L("Dashboard"),
                        url: "tenant.dashboard",
                        icon: "icon-group",
                        requiredPermissionName: AppPermissions.PagesAdministrationTenant
                        )
                    ))
            .AddItem(
                new MenuItemDefinition(
                    "Tenant.PublicWechatManager",
                    new LocalizableString("PublicWechatManager", ApplicationConsts.LocalizationSourceName),
                    icon: "icon-cog").AddItem(
                    new MenuItemDefinition(
                        "Tenant.PublicWechatManager.PublicWechat.Setting",
                        L("Setting"),
                        url: "publicWechat.setting",
                        icon: "icon-cog",
                        requiredPermissionName: AppPermissions.PagesAdministrationTenant
                        )
                    ).AddItem(
                    new MenuItemDefinition(
                        "Tenant.PublicWechatManager.PublicWechat.MenuManager",
                        L("MenuManager"),
                        url: "publicWechat.menu",
                        icon: "icon-cog",
                        requiredPermissionName: AppPermissions.PagesAdministrationTenant
                        )
                    ).AddItem(
                    new MenuItemDefinition(
                        "Tenant.PublicWechatManager.PublicWechat.AutoReplyManager",
                        L("AutoReplyManager"),
                        url: "publicWechat.autoReply.index",
                        icon: "icon-cog",
                        requiredPermissionName: AppPermissions.PagesAdministrationTenant
                        )
                    )
                ).AddItem(
                new MenuItemDefinition(
                    "Tenant.ArticleManager",
                    new LocalizableString("ArticleManager", ApplicationConsts.LocalizationSourceName),
                    icon: "icon-cog").AddItem(
                    new MenuItemDefinition(
                        "Tenant.ArticleManager.Article",
                        L("Article"),
                        url: "article.index",
                        icon: "icon-cog",
                        requiredPermissionName: AppPermissions.PagesAdministrationTenant
                        )
                    )
                ).AddItem(
                new MenuItemDefinition(
                    "Tenant.SpreadPosterManager",
                    L("SpreadPosterManager"),
                    icon: "icon-qrcode",
                    requiredPermissionName: AppPermissions.PagesAdministrationTenant
                    ).AddItem(
                    new MenuItemDefinition(
                        "Tenant.SpreadPosterManager.SpreadPosterTemplate",
                        L("SpreadPoster"),
                        url: "spreadPosterTemplate.index",
                        icon: "icon-align-justify",
                        requiredPermissionName: AppPermissions.PagesAdministrationTenant
                        )
                    )).AddItem(
                new MenuItemDefinition(
                    "Tenant.MemberManager",
                    L("MemberManager"),
                    icon: "icon-member",
                    requiredPermissionName: AppPermissions.PagesAdministrationTenant
                    ).AddItem(
                    new MenuItemDefinition(
                        "Tenant.MemberManager.MemberLevel",
                        L("MemberLevel"),
                        url: "memberLevel.index",
                        icon: "icon-align-justify",
                        requiredPermissionName: AppPermissions.PagesAdministrationTenant
                        )
                    ).AddItem(
                    new MenuItemDefinition(
                        "Tenant.MemberManager.MemberCardPackage",
                        L("MemberCardPackage"),
                        url: "memberCardPackage.index",
                        icon: "icon-film",
                        requiredPermissionName: AppPermissions.PagesAdministrationTenant
                        )
                    )
                .AddItem(
                    new MenuItemDefinition(
                        "Tenant.MemberManager.MemberCard",
                        L("MemberCard"),
                        url: "memberCard",
                        icon: "icon-film",
                        requiredPermissionName: AppPermissions.PagesAdministrationTenant
                        )
                    )
                ).AddItem(
                new MenuItemDefinition(
                    "Tenant.ProductManager",
                    L("ProductManager"),
                    icon: "icon-product",
                    requiredPermissionName: AppPermissions.PagesAdministrationTenant
                    ).AddItem(
                    new MenuItemDefinition(
                        "Tenant.ProductManager.ProductCategory",
                        L("ProductCategory"),
                        url: "productCategory",
                        icon: "icon-align-justify",
                        requiredPermissionName: AppPermissions.PagesAdministrationTenant
                        )
                    ).AddItem(
                    new MenuItemDefinition(
                        "Tenant.ProductManager.SpecificationProperty",
                        L("SpecificationProperty"),
                        url: "specificationProperty.index",
                        icon: "icon-align-justify",
                        requiredPermissionName: AppPermissions.PagesAdministrationTenant
                        )
                    ).AddItem(
                    new MenuItemDefinition(
                        "Tenant.ProductManager.Product",
                        L("Product"),
                        url: "product.index",
                        icon: "icon-align-justify",
                        requiredPermissionName: AppPermissions.PagesAdministrationTenant
                        )
                    )).AddItem(
                new MenuItemDefinition(
                    "Tenant.ExpressCompanyManager",
                    L("ExpressCompanyManager"),
                    icon: "icon-express",
                    requiredPermissionName: AppPermissions.PagesAdministrationTenant
                    ).AddItem(
                    new MenuItemDefinition(
                        "Tenant.ExpressCompanyManager.ExpressCompany",
                        L("ExpressCompany"),
                        url: "expressCompany.index",
                        icon: "icon-align-justify",
                        requiredPermissionName: AppPermissions.PagesAdministrationTenant
                        )
                    )).AddItem(
                new MenuItemDefinition(
                    "Tenant.WalletManager",
                    L("WalletManager"),
                    icon: "icon-wallet",
                    requiredPermissionName: AppPermissions.PagesAdministrationTenant
                    ).AddItem(
                    new MenuItemDefinition(
                        "Tenant.WalletRecordManager.WalletRecord",
                        L("WalletRecord"),
                        url: "walletRecord.index",
                        icon: "icon-align-justify",
                        requiredPermissionName: AppPermissions.PagesAdministrationTenant
                        )
                    )).AddItem(
                new MenuItemDefinition(
                    "Tenant.OrderManager",
                    L("OrderManager"),
                    icon: "icon-order",
                    requiredPermissionName: AppPermissions.PagesAdministrationTenant
                    ).AddItem(
                    new MenuItemDefinition(
                        "Tenant.OrderManager.Order",
                        L("Order"),
                        url: "order.index",
                        icon: "icon-align-justify",
                        requiredPermissionName: AppPermissions.PagesAdministrationTenant
                        )
                    )).AddItem(
                new MenuItemDefinition(
                    "Tenant.VirtualProductManager",
                    L("VirtualProductManager"),
                    icon: "icon-order",
                    requiredPermissionName: AppPermissions.PagesAdministrationTenant
                    ).AddItem(
                    new MenuItemDefinition(
                        "Tenant.VirtualProductManager.VirtualCardManager",
                        L("VirtualCardManager"),
                        url: "virtualProduct.virtualCard.index",
                        icon: "icon-align-justify",
                        requiredPermissionName: AppPermissions.PagesAdministrationTenant
                        )
                    )).AddItem(
                new MenuItemDefinition(
                    "Tenant.GlobalRebateManager",
                    L("GlobalRebateManager"),
                    icon: "icon-channel",
                    requiredPermissionName: AppPermissions.PagesAdministrationTenant
                    ).AddItem(
                    new MenuItemDefinition(
                        "Tenant.GlobalRebateManager.GlobalRebate",
                        L("GlobalRebate"),
                        url: "globalRebate.globalRebate.index",
                        icon: "icon-align-justify",
                        requiredPermissionName: AppPermissions.PagesAdministrationTenant
                        )
                    )).AddItem(
                new MenuItemDefinition(
                    "Tenant.ChannelManager",
                    L("ChannelManager"),
                    icon: "icon-channel",
                    requiredPermissionName: AppPermissions.PagesAdministrationTenant
                    ).AddItem(
                    new MenuItemDefinition(
                        "Tenant.ChannelManager.ChannelAgent",
                        L("ChannelAgent"),
                        url: "channel.channelAgent.index",
                        icon: "icon-align-justify",
                        requiredPermissionName: AppPermissions.PagesAdministrationTenant
                        )
                    ).AddItem(
                    new MenuItemDefinition(
                        "Tenant.ChannelManager.ChannelAgencyApply",
                        L("ChannelAgencyApply"),
                        url: "channel.channelAgencyApply.index",
                        icon: "icon-align-justify",
                        requiredPermissionName: AppPermissions.PagesAdministrationTenant
                        )
                    ).AddItem(
                    new MenuItemDefinition(
                        "Tenant.ChannelManager.ChannelAgency",
                        L("ChannelAgency"),
                        url: "channel.channelAgency.index",
                        icon: "icon-align-justify",
                        requiredPermissionName: AppPermissions.PagesAdministrationTenant
                        )
                    )).AddItem(
                new MenuItemDefinition(
                    "Tenant.MovieManager",
                    L("MovieManager"),
                    icon: "icon-movie",
                    requiredPermissionName: AppPermissions.PagesAdministrationTenant
                    ).AddItem(
                    new MenuItemDefinition(
                        "Tenant.MovieManager.Movie",
                        L("Movie"),
                        url: "movie.index",
                        icon: "icon-align-justify",
                        requiredPermissionName: AppPermissions.PagesAdministrationTenant
                        )
                    ).AddItem(
                    new MenuItemDefinition(
                        "Tenant.MovieManager.MovieCategoryManager",
                        L("MovieCategory"),
                        url: "movieCategory.index",
                        icon: "icon-align-justify",
                        requiredPermissionName: AppPermissions.PagesAdministrationTenant
                        )
                    ));
        }
예제 #19
0
        public override void SetNavigation(INavigationProviderContext context)
        {
            var frontEndMenu = new MenuDefinition(MenuName, new FixedLocalizableString("Frontend menu"));

            context.Manager.Menus[MenuName] = frontEndMenu;
            var personInfo = new MenuItemDefinition(
                PersonInfoAppPermissions.PersonInfo,
                L("PersonInfo"),
                url: "PersonInfoManage",
                icon: "icon-grid",
                requiredPermissionName: PersonInfoAppPermissions.PersonInfo
                );



            frontEndMenu

            //HOME
            //.AddItem(new MenuItemDefinition(
            //    PageNames.Frontend.Home,
            //    L("HomePage"),
            //    url: ""
            //    )

            ////ABOUT
            //)
            .AddItem(new MenuItemDefinition(
                         PageNames.Frontend.Home,
                         L("HomePage"),
                         url: "PersonHome",
                         requiredPermissionName: PersonInfoAppPermissions.PersonInfo
                         )

                     //ABOUT
                     )
            .AddItem(new MenuItemDefinition(
                         PageNames.Frontend.About,
                         L("AboutUs"),
                         url: "About"
                         ))
            .AddItem(personInfo);


            //MULTI-LEVEL MENU (JUST FOR EXAMPLE)
            //).AddItem(new MenuItemDefinition(
            //    "MultiLevelMenu",
            //    new FixedLocalizableString("Multi level menu")
            //    ).AddItem(new MenuItemDefinition(
            //        "MultiLevelMenu.1",
            //        new FixedLocalizableString("Sub menu item 1")
            //        )
            //    ).AddItem(new MenuItemDefinition(
            //        "MultiLevelMenu.2",
            //        new FixedLocalizableString("Sub menu item 2")
            //        ).AddItem(new MenuItemDefinition(
            //            "MultiLevelMenu.2.1",
            //            new FixedLocalizableString("Sub menu item 2.1")
            //            )
            //        ).AddItem(new MenuItemDefinition(
            //            "MultiLevelMenu.2.2",
            //            new FixedLocalizableString("Sub menu item 2.2")
            //            )
            //        ).AddItem(new MenuItemDefinition(
            //            "MultiLevelMenu.2.3",
            //            new FixedLocalizableString("Sub menu item 2.3")
            //            ).AddItem(new MenuItemDefinition(
            //                "MultiLevelMenu.2.3.1",
            //                new FixedLocalizableString("ASP.NET Boilerplate"),
            //                url: "http://aspnetboilerplate.com"
            //                )
            //            ).AddItem(new MenuItemDefinition(
            //                "MultiLevelMenu.2.3.2",
            //                new FixedLocalizableString("jtable.org"),
            //                url: "http://jtable.org"
            //                )
            //            )
            //        )
            //    )
        }
        public override void SetNavigation(INavigationProviderContext context)
        {
            var rootNode = new MenuDefinition(MenuName, L("PortalMenu"));

            context.Manager.Menus[MenuName] = rootNode;



            #region 首页

            var home = new MenuItemDefinition(
                PortalNavPageNames.Home,
                L("HomePage"),
                url: "/"
                );

            #endregion

            // 首页、下载、合作、学习、关于我们、更多。。。
            #region 文档

            var wiki = new MenuItemDefinition(
                PortalNavPageNames.Wiki,
                L("Wiki"),
                url: "Wiki"
                );

            #endregion


            #region  载

            var download = new MenuItemDefinition(
                PortalNavPageNames.Download,
                L("Download"),
                url: "Download/Index"
                );

            #endregion

            #region 博客
            var blog = new MenuItemDefinition(
                PortalNavPageNames.Blog,
                L("Blog"),
                url: "Blog"
                );


            #endregion

            var sample = new MenuItemDefinition(PortalNavPageNames.Samples,
                                                new FixedLocalizableString("案例"),
                                                url: "Blog/samples");


            #region 教程

            var Partnership = new MenuItemDefinition(
                PortalNavPageNames.Partnership,
                L("Partnership"),
                url: "About");

            var Learn = new MenuItemDefinition(
                PortalNavPageNames.Learn,
                L("Learn"), url: "");



            var college = new MenuItemDefinition(
                PortalNavPageNames.College,
                new FixedLocalizableString("视频课程"),
                url: "college"
                ); var purchase = new MenuItemDefinition(
                PortalNavPageNames.Pricing,
                new FixedLocalizableString("商业服务"),
                url: "Purchase"
                );
            var study163Video = new MenuItemDefinition(
                PortalNavPageNames.VideoCourse,
                new FixedLocalizableString("52ABP框架收费课程"),
                url: "https://study.163.com/course/courseMain.htm?courseId=1006191011&share=2&shareId=400000000309007", target: "_blank"
                );
            var study163Video2 = new MenuItemDefinition(
                PortalNavPageNames.VideoCourse,
                new FixedLocalizableString("ABP框架免费课程 "),
                url: "https://study.163.com/course/courseMain.htm?courseId=1005208064&share=2&shareId=400000000309007", target: "_blank"
                ); var study163VideoMore = new MenuItemDefinition(
                PortalNavPageNames.VideoCourse,
                new FixedLocalizableString("网易云课堂 "),
                url: "https://study.163.com/provider/400000000309007/index.htm?share=2&shareId=400000000309007", target: "_blank"
                );

            //var studyQqVideo = new MenuItemDefinition(
            //    PortalNavPageNames.VideoCourse,
            //    L("StudyQQVideo"),
            //    url: "http://52abp.ke.qq.com/", target: "_blank"
            //);


            //var faq = new MenuItemDefinition(
            //    PortalNavPageNames.Faq,
            //    L("Faq"),
            //    url: "/Blog/Faq"
            //);



            #endregion



            #region 菜单结构



            #endregion


            rootNode
            // 首页
            .AddItem(home)
            // 下载



            .AddItem(sample)
            // .AddItem()

            ;
        }