Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move all module settings to Configuration > Settings #11937

Closed
5 changes: 3 additions & 2 deletions src/OrchardCore.Modules/OrchardCore.Admin/AdminMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,16 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder)
}

builder
.Add(S["Configuration"], design => design
.Add(S["Configuration"], configuration => configuration
.Add(S["Settings"], settings => settings
.Add(S["Admin"], S["Admin"].PrefixPosition(), admin => admin
.AddClass("admin").Id("admin")
.Action("Index", "Admin", new { area = "OrchardCore.Settings", groupId = AdminSiteSettingsDisplayDriver.GroupId })
.Permission(PermissionsAdminSettings.ManageAdminSettings)
.LocalNav()
)
));
)
);

return Task.CompletedTask;
}
Expand Down
2 changes: 1 addition & 1 deletion src/OrchardCore.Modules/OrchardCore.AdminMenu/AdminMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public async Task BuildNavigationAsync(string name, NavigationBuilder builder)

// Configuration and settings menus for the AdminMenu module
builder.Add(S["Configuration"], configuration => configuration
.Add(S["Admin Menus"], S["Admin Menus"].PrefixPosition(), admt => admt
.Add(S["Admin Menus"], S["Admin Menus"].PrefixPosition(), admin => admin
.Permission(Permissions.ManageAdminMenu)
.Action("List", "Menu", new { area = "OrchardCore.AdminMenu" })
.LocalNav()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public async Task BuildNavigationAsync(string name, NavigationBuilder builder)
return;
}

var trees = ((await _adminMenuService.GetAdminMenuListAsync()).AdminMenu)
var trees = (await _adminMenuService.GetAdminMenuListAsync()).AdminMenu
Skrypt marked this conversation as resolved.
Show resolved Hide resolved
.Where(m => m.Enabled && m.MenuItems.Count > 0);

foreach (var tree in trees)
Expand Down
4 changes: 2 additions & 2 deletions src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/AdminMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder)
}

builder
.Add(S["Configuration"], NavigationConstants.AdminMenuConfigurationPosition, design => design
.Add(S["Configuration"], NavigationConstants.AdminMenuConfigurationPosition, configuration => configuration
.AddClass("menu-configuration").Id("configuration")
.Add(S["GraphiQL"], S["GraphiQL"].PrefixPosition(), deployment => deployment
.Add(S["GraphiQL"], S["GraphiQL"].PrefixPosition(), graphiQl => graphiQl
Skrypt marked this conversation as resolved.
Show resolved Hide resolved
.Action("Index", "Admin", new { area = "OrchardCore.Apis.GraphQL" })
.Permission(Permissions.ExecuteGraphQL)
.LocalNav()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder)
}

builder
.Add(S["Audit Trail"], NavigationConstants.AdminMenuAuditTrailPosition, configuration => configuration
.Add(S["Audit Trail"], NavigationConstants.AdminMenuAuditTrailPosition, audit => audit
Skrypt marked this conversation as resolved.
Show resolved Hide resolved
.AddClass("audittrail").Id("audittrail")
.Action(nameof(AdminController.Index), "Admin", new { area = "OrchardCore.AuditTrail", correlationId = "" })
.Permission(AuditTrailPermissions.ViewAuditTrail)
.LocalNav());
.LocalNav()
);

return Task.CompletedTask;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder)
.AddClass("audittrail").Id("audittrailSettings")
.Action("Index", "Admin", new { area = "OrchardCore.Settings", groupId = AuditTrailSettingsGroup.Id })
.Permission(AuditTrailPermissions.ManageAuditTrailSettings)
.LocalNav())));
.LocalNav()
)
)
);

return Task.CompletedTask;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder)
}

builder
.Add(S["Configuration"], localization => localization
.Add(S["Configuration"], configuration => configuration
.Add(S["Settings"], settings => settings
.Add(S["Localization"], localization => localization
.Add(S["Content Request Culture Provider"], S["Content Request Culture Provider"].PrefixPosition(), registration => registration
.Add(S["Content Request Culture Provider"], S["Content Request Culture Provider"].PrefixPosition(), provider => provider
.AddClass("contentrequestcultureprovider").Id("contentrequestcultureprovider")
.Action("Index", "Admin", new { area = "OrchardCore.Settings", groupId = ContentRequestCultureProviderSettingsDriver.GroupId })
.Permission(Permissions.ManageContentCulturePicker)
.LocalNav()
)
.Add(S["Content Culture Picker"], S["Content Culture Picker"].PrefixPosition(), registration => registration
.Add(S["Content Culture Picker"], S["Content Culture Picker"].PrefixPosition(), picker => picker
Skrypt marked this conversation as resolved.
Show resolved Hide resolved
.AddClass("contentculturepicker").Id("contentculturepicker")
.Action("Index", "Admin", new { area = "OrchardCore.Settings", groupId = ContentCulturePickerSettingsDriver.GroupId })
.Permission(Permissions.ManageContentCulturePicker)
Expand Down
26 changes: 15 additions & 11 deletions src/OrchardCore.Modules/OrchardCore.ContentTypes/AdminMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,21 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder)

var adminControllerName = typeof(AdminController).ControllerName();

builder.Add(S["Content"], content => content
.Add(S["Content Definition"], S["Content Definition"].PrefixPosition("9"), contentDefinition => contentDefinition
.Add(S["Content Types"], S["Content Types"].PrefixPosition("1"), contentTypes => contentTypes
.Action(nameof(AdminController.List), adminControllerName, new { area = "OrchardCore.ContentTypes" })
.Permission(Permissions.ViewContentTypes)
.LocalNav())
.Add(S["Content Parts"], S["Content Parts"].PrefixPosition("2"), contentParts => contentParts
.Action(nameof(AdminController.ListParts), adminControllerName, new { area = "OrchardCore.ContentTypes" })
.Permission(Permissions.ViewContentTypes)
.LocalNav())
));
builder
.Add(S["Content"], content => content
.Add(S["Content Definition"], S["Content Definition"].PrefixPosition("9"), contentDefinition => contentDefinition
.Add(S["Content Types"], S["Content Types"].PrefixPosition("1"), contentTypes => contentTypes
.Action(nameof(AdminController.List), adminControllerName, new { area = "OrchardCore.ContentTypes" })
.Permission(Permissions.ViewContentTypes)
.LocalNav()
)
.Add(S["Content Parts"], S["Content Parts"].PrefixPosition("2"), contentParts => contentParts
.Action(nameof(AdminController.ListParts), adminControllerName, new { area = "OrchardCore.ContentTypes" })
.Permission(Permissions.ViewContentTypes)
.LocalNav()
)
)
);

return Task.CompletedTask;
}
Expand Down
3 changes: 1 addition & 2 deletions src/OrchardCore.Modules/OrchardCore.Contents/AdminMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,12 @@ public AdminMenu(

public async Task BuildNavigationAsync(string name, NavigationBuilder builder)
{
var context = _httpContextAccessor.HttpContext;

if (!String.Equals(name, "admin", StringComparison.OrdinalIgnoreCase))
{
return;
}

var context = _httpContextAccessor.HttpContext;
Skrypt marked this conversation as resolved.
Show resolved Hide resolved
var contentTypeDefinitions = _contentDefinitionManager.ListTypeDefinitions().OrderBy(d => d.Name);
var contentTypes = contentTypeDefinitions.Where(ctd => ctd.GetSettings<ContentTypeSettings>().Creatable).OrderBy(ctd => ctd.DisplayName);
await builder.AddAsync(S["Content"], NavigationConstants.AdminMenuContentPosition, async content =>
Expand Down
19 changes: 11 additions & 8 deletions src/OrchardCore.Modules/OrchardCore.Cors/AdminMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ namespace OrchardCore.Cors
{
public class AdminMenu : INavigationProvider
{
private readonly IStringLocalizer S;

public AdminMenu(IStringLocalizer<AdminMenu> localizer)
{
S = localizer;
}

public IStringLocalizer S { get; set; }

public Task BuildNavigationAsync(string name, NavigationBuilder builder)
{
if (!String.Equals(name, "admin", StringComparison.OrdinalIgnoreCase))
Expand All @@ -24,12 +24,15 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder)
builder
.Add(S["Configuration"], configuration => configuration
.Add(S["Settings"], settings => settings
.Add(S["CORS"], S["CORS"].PrefixPosition(), entry => entry
.AddClass("cors").Id("cors")
.Action("Index", "Admin", new { area = "OrchardCore.Cors" })
.Permission(Permissions.ManageCorsSettings)
.LocalNav()
))
.Add(S["Security"], security => security.Id("security")
.Add(S["CORS"], S["CORS"].PrefixPosition(), cors => cors
.AddClass("cors").Id("cors")
.Action("Index", "Admin", new { area = "OrchardCore.Cors" })
.Permission(Permissions.ManageCorsSettings)
.LocalNav()
)
)
)
);

return Task.CompletedTask;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder)
builder
.Add(S["Configuration"], configuration => configuration
.Add(S["Settings"], settings => settings
.Add(new LocalizedString(type.DisplayName, type.DisplayName), type.DisplayName.PrefixPosition(), layers => layers
.Add(new LocalizedString(type.DisplayName, type.DisplayName), type.DisplayName.PrefixPosition(), contentType => contentType
.Action("Index", "Admin", new { area = "OrchardCore.Settings", groupId = type.Name })
.Permission(Permissions.CreatePermissionForType(type))
.Resource(type.Name)
.LocalNav()
)));
)
)
);
}

return Task.CompletedTask;
Expand Down
25 changes: 16 additions & 9 deletions src/OrchardCore.Modules/OrchardCore.Demo/AdminMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,33 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder)
.AddClass("demo").Id("demo")
.Add(S["This Menu Item 1"], "0", item => item
.Add(S["This is Menu Item 1.1"], subItem => subItem
.Action("Index", "Admin", new { area = "OrchardCore.Demo" }))
.Action("Index", "Admin", new { area = "OrchardCore.Demo" })
)
.Add(S["This is Menu Item 1.2"], subItem => subItem
.Action("Index", "Admin", new { area = "OrchardCore.Demo" }))
.Action("Index", "Admin", new { area = "OrchardCore.Demo" })
)
.Add(S["This is Menu Item 1.2"], subItem => subItem
.Action("Index", "Admin", new { area = "OrchardCore.Demo" }))
.Action("Index", "Admin", new { area = "OrchardCore.Demo" })
)
)
.Add(S["This Menu Item 2"], "0", item => item
.Add(S["This is Menu Item 2.1"], subItem => subItem
.Action("Index", "Admin", new { area = "OrchardCore.Demo" }))
.Action("Index", "Admin", new { area = "OrchardCore.Demo" })
)
.Add(S["This is Menu Item 2.2"], subItem => subItem
.Action("Index", "Admin", new { area = "OrchardCore.Demo" }))
.Action("Index", "Admin", new { area = "OrchardCore.Demo" })
)
.Add(S["This is Menu Item 3.2"], subItem => subItem
.Action("Index", "Admin", new { area = "OrchardCore.Demo" }))
.Action("Index", "Admin", new { area = "OrchardCore.Demo" })
)
)
.Add(S["This Menu Item 3"], "0", item => item
.Add(S["This is Menu Item 3.1"], subItem => subItem
.Action("Index", "Admin", new { area = "OrchardCore.Demo" }))
.Action("Index", "Admin", new { area = "OrchardCore.Demo" })
)
.Add(S["This is Menu Item 3.2"], subItem => subItem
.Action("Index", "Admin", new { area = "OrchardCore.Demo" }))

.Action("Index", "Admin", new { area = "OrchardCore.Demo" })
)
Skrypt marked this conversation as resolved.
Show resolved Hide resolved
)
.Add(S["Todo (Liquid - Frontend)"], "0", item => item
.Action("Index", "Todo", new { area = "OrchardCore.Demo" })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder)
builder
.Add(S["Configuration"], configuration => configuration
.Add(S["Import/Export"], import => import
.Add(S["Remote Instances"], S["Remote Instances"].PrefixPosition(), remote => remote
.Add(S["Remote Instances"], S["Remote Instances"].PrefixPosition(), instances => instances
Skrypt marked this conversation as resolved.
Show resolved Hide resolved
.Action("Index", "RemoteInstance", new { area = "OrchardCore.Deployment.Remote" })
.Permission(Permissions.ManageRemoteInstances)
.LocalNav()
)
.Add(S["Remote Clients"], S["Remote Clients"].PrefixPosition(), remote => remote
.Add(S["Remote Clients"], S["Remote Clients"].PrefixPosition(), clients => clients
Skrypt marked this conversation as resolved.
Show resolved Hide resolved
.Action("Index", "RemoteClient", new { area = "OrchardCore.Deployment.Remote" })
.Permission(Permissions.ManageRemoteClients)
.LocalNav()
Expand Down
16 changes: 10 additions & 6 deletions src/OrchardCore.Modules/OrchardCore.Email/AdminMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,21 @@ public AdminMenu(IStringLocalizer<AdminMenu> localizer)
public Task BuildNavigationAsync(string name, NavigationBuilder builder)
{
if (!String.Equals(name, "admin", StringComparison.OrdinalIgnoreCase))
{
return Task.CompletedTask;
}

builder
.Add(S["Configuration"], configuration => configuration
.Add(S["Settings"], settings => settings
.Add(S["Email"], S["Email"].PrefixPosition(), entry => entry
.AddClass("email").Id("email")
.Action("Index", "Admin", new { area = "OrchardCore.Settings", groupId = SmtpSettingsDisplayDriver.GroupId })
.Permission(Permissions.ManageEmailSettings)
.LocalNav()
)));
.Add(S["Email"], S["Email"].PrefixPosition(), email => email
.AddClass("email").Id("email")
.Action("Index", "Admin", new { area = "OrchardCore.Settings", groupId = SmtpSettingsDisplayDriver.GroupId })
.Permission(Permissions.ManageEmailSettings)
.LocalNav()
)
)
);

return Task.CompletedTask;
}
Expand Down
Loading