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
MikeAlhayek 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 @@ -25,11 +25,14 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder)
builder
.Add(S["Configuration"], configuration => configuration
.Add(S["Settings"], settings => settings
.Add(S["Audit Trail"], S["Audit Trail"].PrefixPosition(), settings => settings
.Add(S["Audit trail"], S["Audit trail"].PrefixPosition(), settings => settings
.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 @@ -24,7 +24,7 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder)
builder
.Add(S["Configuration"], configuration => configuration
.Add(S["Tasks"], S["Tasks"].PrefixPosition(), tasks => tasks
.Add(S["Background Tasks"], S["Background Tasks"].PrefixPosition(), backgroundTasks => backgroundTasks
.Add(S["Background tasks"], S["Background tasks"].PrefixPosition(), backgroundTasks => backgroundTasks
.Action("Index", "BackgroundTask", new { area = "OrchardCore.BackgroundTasks" })
.Permission(Permissions.ManageBackgroundTasks)
.LocalNav()
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
.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
5 changes: 2 additions & 3 deletions src/OrchardCore.Modules/OrchardCore.Contents/AdminMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,18 @@ 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 =>
{
content.AddClass("content").Id("content");
await content.AddAsync(S["Content Items"], S["Content Items"].PrefixPosition(), async contentItems =>
await content.AddAsync(S["Content items"], S["Content items"].PrefixPosition(), async contentItems =>
{
if (!await _authorizationService.AuthorizeContentTypeDefinitionsAsync(context.User, CommonPermissions.EditContent, contentTypes, _contentManager))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder)
.Add(S["Configuration"], configuration => configuration
.Add(S["Import/Export"], S["Import/Export"].PrefixPosition(), import => import
.Add(S["Settings"], settings => settings
.Add(S["Export Target Settings"], S["Export Target Settings"].PrefixPosition(), deployment => deployment
.Add(S["Export target settings"], S["Export target settings"].PrefixPosition(), deployment => deployment
.Action("Index", "Admin", new { area = "OrchardCore.Settings", groupId = "ExportContentToDeploymentTarget" })
.Permission(OrchardCore.Deployment.CommonPermissions.ManageDeploymentPlan)
.LocalNav()
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
45 changes: 26 additions & 19 deletions src/OrchardCore.Modules/OrchardCore.Demo/AdminMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,37 @@ public Task BuildNavigationAsync(string name, NavigationBuilder builder)
builder
.Add(S["Demo"], "10", demo => demo
.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" }))
.Add(S["This is Menu Item 1.2"], subItem => subItem
.Action("Index", "Admin", new { area = "OrchardCore.Demo" }))
.Add(S["This is Menu Item 1.2"], subItem => subItem
.Action("Index", "Admin", new { area = "OrchardCore.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" })
)
.Add(S["This is menu item 1.2"], subItem => subItem
.Action("Index", "Admin", new { area = "OrchardCore.Demo" })
)
.Add(S["This is menu item 1.2"], subItem => subItem
.Action("Index", "Admin", new { area = "OrchardCore.Demo" })
)
)
.Add(S["This Menu Item 2"], "0", item => item
.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" }))
.Add(S["This is Menu Item 2.2"], subItem => subItem
.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 is menu item 2.2"], subItem => subItem
.Action("Index", "Admin", new { area = "OrchardCore.Demo" })
)
.Add(S["This is menu item 3.2"], subItem => subItem
.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" }))
.Add(S["This is Menu Item 3.2"], subItem => subItem
.Action("Index", "Admin", new { area = "OrchardCore.Demo" }))

.Add(S["This is menu item 3.1"], subItem => subItem
.Action("Index", "Admin", new { area = "OrchardCore.Demo" })
)
.Add(S["This is menu item 3.2"], subItem => subItem
.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
.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
.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
.Action("Index", "RemoteClient", new { area = "OrchardCore.Deployment.Remote" })
.Permission(Permissions.ManageRemoteClients)
.LocalNav()
Expand Down
Loading