-
Notifications
You must be signed in to change notification settings - Fork 2.4k
/
AdminMenu.cs
36 lines (31 loc) · 1.1 KB
/
AdminMenu.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System.Threading.Tasks;
using Microsoft.Extensions.Localization;
using OrchardCore.Navigation;
namespace OrchardCore.Media.Azure
{
public class AdminMenu : INavigationProvider
{
protected readonly IStringLocalizer S;
public AdminMenu(IStringLocalizer<AdminMenu> localizer)
{
S = localizer;
}
public Task BuildNavigationAsync(string name, NavigationBuilder builder)
{
if (!NavigationHelper.IsAdminMenu(name))
{
return Task.CompletedTask;
}
builder.Add(S["Configuration"], configuration => configuration
.Add(S["Media"], S["Media"].PrefixPosition(), media => media
.Add(S["Azure Blob Options"], S["Azure Blob Options"].PrefixPosition(), options => options
.Action("Options", "Admin", "OrchardCore.Media.Azure")
.Permission(Permissions.ViewAzureMediaOptions)
.LocalNav()
)
)
);
return Task.CompletedTask;
}
}
}