2021-11-20 13:52:28 +01:00
|
|
|
using Microsoft.Extensions.Configuration;
|
2020-05-27 16:03:38 +02:00
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
2021-09-30 10:53:01 +02:00
|
|
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
2020-05-27 16:03:38 +02:00
|
|
|
using zero.Web.Sections;
|
2020-10-28 15:59:36 +01:00
|
|
|
using zero.Web.ViewHelpers;
|
2020-05-27 16:03:38 +02:00
|
|
|
|
|
|
|
|
namespace zero.Web.Defaults
|
|
|
|
|
{
|
2020-10-19 15:58:32 +02:00
|
|
|
internal class ZeroBackofficePlugin : ZeroPlugin
|
2020-05-27 16:03:38 +02:00
|
|
|
{
|
2020-10-19 15:58:32 +02:00
|
|
|
public override void Configure(IZeroOptions zero)
|
|
|
|
|
{
|
2021-09-29 14:01:02 +02:00
|
|
|
zero.Sections.Add<DashboardSection>();
|
2020-10-19 15:58:32 +02:00
|
|
|
zero.Sections.Add<PagesSection>();
|
|
|
|
|
zero.Sections.Add<SpacesSection>();
|
|
|
|
|
zero.Sections.Add<MediaSection>();
|
|
|
|
|
zero.Sections.Add<SettingsSection>();
|
|
|
|
|
|
|
|
|
|
zero.Settings.AddGroup<SystemSettings>();
|
2021-11-11 15:39:26 +01:00
|
|
|
zero.Settings.AddGroup<ApplicationSettings>();
|
2020-10-19 15:58:32 +02:00
|
|
|
|
|
|
|
|
zero.Permissions.AddCollection<SectionPermissions>();
|
|
|
|
|
zero.Permissions.AddCollection<ModulePermissions>();
|
|
|
|
|
zero.Permissions.AddCollection<SettingsPermissions>();
|
|
|
|
|
zero.Permissions.AddCollection<SpacePermissions>();
|
2020-12-03 15:39:54 +01:00
|
|
|
|
2020-12-04 13:18:12 +01:00
|
|
|
zero.Pages.Add<PageFolder>(Constants.Pages.FolderAlias, "@page.folder.name", "@page.folder.description", "fth-folder");
|
2020-10-19 15:58:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public override void ConfigureServices(IServiceCollection services, IConfiguration configuration)
|
2020-05-27 16:03:38 +02:00
|
|
|
{
|
2020-09-11 16:36:36 +02:00
|
|
|
//services.AddAll(typeof(IValidator<>), ServiceLifetime.Scoped);
|
2020-09-08 14:33:31 +02:00
|
|
|
//services.AddAll(typeof(IValidator), ServiceLifetime.Scoped);
|
2020-09-11 16:36:36 +02:00
|
|
|
|
2020-11-19 00:14:52 +01:00
|
|
|
services.AddTransient<ICountriesCollection, CountriesCollection>();
|
2020-11-19 14:57:00 +01:00
|
|
|
services.AddTransient<ILanguagesCollection, LanguagesCollection>();
|
|
|
|
|
services.AddTransient<ITranslationsCollection, TranslationsCollection>();
|
2020-11-20 17:38:01 +01:00
|
|
|
services.AddTransient<IMediaCollection, MediaCollection>();
|
2021-11-19 13:31:54 +01:00
|
|
|
services.AddTransient<IMediaFolderCollection, MediaFolderCollection>();
|
2021-10-05 14:08:39 +02:00
|
|
|
services.AddTransient<IPagesCollection, PagesCollection>();
|
2021-11-19 13:31:54 +01:00
|
|
|
services.AddTransient<IMailTemplatesCollection, MailTemplatesCollection>();
|
|
|
|
|
|
|
|
|
|
services.AddTransient<IApplicationsApi, ApplicationsApi>();
|
2020-08-27 16:12:47 +02:00
|
|
|
services.AddTransient<IUserApi, UserApi>();
|
2020-09-04 11:50:22 +02:00
|
|
|
services.AddTransient<IPreviewApi, PreviewApi>();
|
2020-05-27 16:03:38 +02:00
|
|
|
|
|
|
|
|
services.AddTransient<ISetupApi, SetupApi>();
|
|
|
|
|
services.AddTransient<ISectionsApi, SectionsApi>();
|
|
|
|
|
services.AddTransient<ISettingsApi, SettingsApi>();
|
|
|
|
|
services.AddTransient<IAuthenticationApi, AuthenticationApi>();
|
|
|
|
|
services.AddTransient<IUserRolesApi, UserRolesApi>();
|
|
|
|
|
services.AddTransient<ISpacesApi, SpacesApi>();
|
|
|
|
|
services.AddTransient<IPermissionsApi, PermissionsApi>();
|
2020-08-19 12:53:18 +02:00
|
|
|
services.AddTransient<IModulesApi, ModulesApi>();
|
2021-11-20 13:52:28 +01:00
|
|
|
services.AddTransient<IRecycleBinApi, RecycleBinApi>();
|
2020-11-26 16:13:00 +01:00
|
|
|
|
2020-10-28 15:59:36 +01:00
|
|
|
services.AddScoped<IZeroMediaHelper, ZeroMediaHelper>();
|
2020-12-10 15:57:59 +01:00
|
|
|
|
2021-01-15 13:56:50 +01:00
|
|
|
services.AddTransient<IIntegrationService, IntegrationService>();
|
|
|
|
|
services.AddTransient<IIntegrationsCollection, IntegrationsCollection>();
|
2020-12-18 20:50:13 +01:00
|
|
|
|
2021-10-13 12:47:18 +02:00
|
|
|
services.AddScoped<ICollectionContext, CollectionContext>();
|
2021-11-19 13:31:54 +01:00
|
|
|
services.AddScoped(typeof(ICollectionContext<>), typeof(CollectionContext<>));
|
|
|
|
|
services.AddScoped(typeof(IInterceptorRunner<>), typeof(InterceptorRunner<>));
|
2021-10-13 12:47:18 +02:00
|
|
|
|
2021-09-01 23:09:22 +02:00
|
|
|
services.AddScoped<IBackofficeSearchService, BackofficeSearchService>();
|
2020-05-27 16:03:38 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|