mirror of https://github.com/abpframework/abp.git
5 changed files with 78 additions and 5 deletions
@ -0,0 +1,33 @@ |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Microsoft.Extensions.Options; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.SettingManagement.Web.Pages.SettingManagement; |
|||
using Volo.Abp.UI.Navigation; |
|||
|
|||
namespace Volo.Abp.SettingManagement.Web.Navigation |
|||
{ |
|||
public class SettingManagementMainMenuContributor : IMenuContributor |
|||
{ |
|||
public Task ConfigureMenuAsync(MenuConfigurationContext context) |
|||
{ |
|||
if (context.Menu.Name != StandardMenus.Main) |
|||
{ |
|||
return Task.CompletedTask; |
|||
} |
|||
|
|||
var settingManagementPageOptions = context.ServiceProvider.GetRequiredService<IOptions<SettingManagementPageOptions>>().Value; |
|||
if (!settingManagementPageOptions.Contributors.Any()) |
|||
{ |
|||
return Task.CompletedTask; |
|||
} |
|||
|
|||
//TODO: Localize
|
|||
//var l = context.ServiceProvider.GetRequiredService<IStringLocalizer<IdentityResource>>();
|
|||
|
|||
context.Menu.AddItem(new ApplicationMenuItem("Volo.Abp.SettingManagement", "Settings", "/SettingManagement", icon: "fa fa-cog", order: int.MaxValue - 1000)); |
|||
|
|||
return Task.CompletedTask; |
|||
} |
|||
} |
|||
} |
|||
@ -1,13 +1,19 @@ |
|||
using System.Collections.Generic; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace Volo.Abp.SettingManagement.Web.Pages.SettingManagement |
|||
{ |
|||
public class SettingPageCreationContext |
|||
public class SettingPageCreationContext : IServiceProviderAccessor |
|||
{ |
|||
public IServiceProvider ServiceProvider { get; } |
|||
|
|||
public List<SettingPageGroup> Groups { get; } |
|||
|
|||
public SettingPageCreationContext() |
|||
public SettingPageCreationContext(IServiceProvider serviceProvider) |
|||
{ |
|||
ServiceProvider = serviceProvider; |
|||
|
|||
Groups = new List<SettingPageGroup>(); |
|||
} |
|||
} |
|||
|
|||
Loading…
Reference in new issue