jcb-compiler/src/2dd1289a-4000-43cc-8c62-77ff32de56bf/code.power

67 lines
2.0 KiB
Plaintext
Raw Normal View History

/**
* Registers the service provider with a DI container.
*
* @param Container $container The DI container.
*
* @return void
* @since 3.2.0
*/
public function register(Container $container)
{
$container->alias(AdminviewData::class, 'Adminview.Data')
->share('Adminview.Data', [$this, 'getAdminviewData'], true);
2023-10-04 18:28:29 +00:00
$container->alias(Permission::class, 'Adminview.Permission')
->share('Adminview.Permission', [$this, 'getAdminviewPermission'], true);
}
/**
* Get the Compiler Adminview Data
*
* @param Container $container The DI container.
*
* @return AdminviewData
* @since 3.2.0
*/
public function getAdminviewData(Container $container): AdminviewData
{
return new AdminviewData(
$container->get('Config'),
$container->get('Event'),
$container->get('Placeholder'),
$container->get('Customcode.Dispenser'),
$container->get('Model.Customtabs'),
$container->get('Model.Tabs'),
$container->get('Model.Fields'),
$container->get('Model.Historyadminview'),
$container->get('Model.Permissions'),
$container->get('Model.Conditions'),
$container->get('Model.Relations'),
$container->get('Model.Linkedviews'),
$container->get('Model.Javascriptadminview'),
$container->get('Model.Cssadminview'),
$container->get('Model.Phpadminview'),
$container->get('Model.Custombuttons'),
$container->get('Model.Customimportscripts'),
$container->get('Model.Ajaxadmin'),
$container->get('Model.Customalias'),
$container->get('Model.Sql'),
2023-10-04 18:28:29 +00:00
$container->get('Model.Mysqlsettings'),
$container->get('Compiler.Builder.Site.Edit.View')
);
}
2023-10-04 18:28:29 +00:00
/**
* Get the Compiler Adminview Permission
*
* @param Container $container The DI container.
*
* @return Permission
* @since 3.2.0
*/
public function getAdminviewPermission(Container $container): Permission
{
return new Permission(
$container->get('Compiler.Builder.Has.Permissions')
);
}