mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-24 10:11:35 +08:00
Hide Gallery menu items on other tenants than Default. (#7511)
This commit is contained in:
committed by
Sébastien Ros
parent
9b8f84d679
commit
dfe7215a05
@@ -2,6 +2,7 @@
|
|||||||
using Orchard.Localization;
|
using Orchard.Localization;
|
||||||
using Orchard.UI.Navigation;
|
using Orchard.UI.Navigation;
|
||||||
using Orchard.Security;
|
using Orchard.Security;
|
||||||
|
using Orchard.Environment.Configuration;
|
||||||
|
|
||||||
namespace Orchard.Packaging {
|
namespace Orchard.Packaging {
|
||||||
[OrchardFeature("Gallery")]
|
[OrchardFeature("Gallery")]
|
||||||
@@ -11,15 +12,22 @@ namespace Orchard.Packaging {
|
|||||||
public string MenuName {
|
public string MenuName {
|
||||||
get { return "admin"; }
|
get { return "admin"; }
|
||||||
}
|
}
|
||||||
|
private readonly ShellSettings _shellSettings;
|
||||||
|
|
||||||
|
public AdminMenu(ShellSettings shellSettings) {
|
||||||
|
_shellSettings = shellSettings;
|
||||||
|
}
|
||||||
|
|
||||||
public void GetNavigation(NavigationBuilder builder) {
|
public void GetNavigation(NavigationBuilder builder) {
|
||||||
builder
|
if (_shellSettings.Name.ToLower() == "default") {
|
||||||
.Add(T("Modules"), menu => menu
|
builder
|
||||||
.Add(T("Gallery"), "3", item => Describe(item, "Modules", "Gallery", true)))
|
.Add(T("Modules"), menu => menu
|
||||||
.Add(T("Themes"), menu => menu
|
.Add(T("Gallery"), "3", item => Describe(item, "Modules", "Gallery", true)))
|
||||||
.Add(T("Gallery"), "3", item => Describe(item, "Themes", "Gallery", true)))
|
.Add(T("Themes"), menu => menu
|
||||||
.Add(T("Settings"), menu => menu
|
.Add(T("Gallery"), "3", item => Describe(item, "Themes", "Gallery", true)))
|
||||||
.Add(T("Gallery"), "1", item => Describe(item, "Sources", "Gallery", false)));
|
.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) {
|
static NavigationItemBuilder Describe(NavigationItemBuilder item, string actionName, string controllerName, bool localNav) {
|
||||||
|
|||||||
Reference in New Issue
Block a user