mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-26 20:16:15 +08:00
--HG-- branch : dev extra : transplant_source : %EC%C1%8B%1E%F3%9F%7B4%87%84%3C%CBg%B4%86XK%9D%20%C8
34 lines
1.5 KiB
C#
34 lines
1.5 KiB
C#
using Orchard.Environment.Extensions;
|
|
using Orchard.Localization;
|
|
using Orchard.UI.Navigation;
|
|
using Orchard.Security;
|
|
|
|
namespace Orchard.Packaging {
|
|
[OrchardFeature("Gallery")]
|
|
public class AdminMenu : INavigationProvider {
|
|
public Localizer T { get; set; }
|
|
|
|
public string MenuName {
|
|
get { return "admin"; }
|
|
}
|
|
|
|
public void GetNavigation(NavigationBuilder builder) {
|
|
builder
|
|
.Add(T("Modules"), menu => menu
|
|
.Add(T("Gallery"), "3", item => Describe(item, "Modules", "Gallery", true))
|
|
.Add(T("Upload"), "9", item => Describe(item, "AddModule", "PackagingServices", true)))
|
|
.Add(T("Themes"), menu => menu
|
|
.Add(T("Gallery"), "3", item => Describe(item, "Themes", "Gallery", true))
|
|
.Add(T("Upload"), "9", item => Describe(item, "AddTheme", "PackagingServices", true)))
|
|
.Add(T("Settings"), menu => menu
|
|
.Add(T("Gallery"), "1", item => Describe(item, "Sources", "Gallery", false)));
|
|
}
|
|
|
|
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;
|
|
}
|
|
}
|
|
} |