mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-25 16:14:59 +00:00
Create event theme admin entity
This commit is contained in:
@@ -11,6 +11,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\EventBundle\DependencyInjection;
|
||||
|
||||
use Chill\EventBundle\Controller\EventThemeController;
|
||||
use Chill\EventBundle\Entity\EventTheme;
|
||||
use Chill\EventBundle\Form\EventThemeType;
|
||||
use Chill\EventBundle\Security\EventVoter;
|
||||
use Chill\EventBundle\Security\ParticipationVoter;
|
||||
use Symfony\Component\Config\FileLocator;
|
||||
@@ -26,7 +29,10 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
||||
*/
|
||||
class ChillEventExtension extends Extension implements PrependExtensionInterface
|
||||
{
|
||||
public function load(array $configs, ContainerBuilder $container)
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function load(array $configs, ContainerBuilder $container): void
|
||||
{
|
||||
$configuration = new Configuration();
|
||||
$config = $this->processConfiguration($configuration, $configs);
|
||||
@@ -45,16 +51,17 @@ class ChillEventExtension extends Extension implements PrependExtensionInterface
|
||||
/** (non-PHPdoc).
|
||||
* @see \Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface::prepend()
|
||||
*/
|
||||
public function prepend(ContainerBuilder $container)
|
||||
public function prepend(ContainerBuilder $container): void
|
||||
{
|
||||
$this->prependAuthorization($container);
|
||||
$this->prependCruds($container);
|
||||
$this->prependRoute($container);
|
||||
}
|
||||
|
||||
/**
|
||||
* add authorization hierarchy.
|
||||
*/
|
||||
protected function prependAuthorization(ContainerBuilder $container)
|
||||
protected function prependAuthorization(ContainerBuilder $container): void
|
||||
{
|
||||
$container->prependExtensionConfig('security', [
|
||||
'role_hierarchy' => [
|
||||
@@ -70,7 +77,7 @@ class ChillEventExtension extends Extension implements PrependExtensionInterface
|
||||
/**
|
||||
* add route to route loader for chill.
|
||||
*/
|
||||
protected function prependRoute(ContainerBuilder $container)
|
||||
protected function prependRoute(ContainerBuilder $container): void
|
||||
{
|
||||
// add routes for custom bundle
|
||||
$container->prependExtensionConfig('chill_main', [
|
||||
@@ -81,4 +88,33 @@ class ChillEventExtension extends Extension implements PrependExtensionInterface
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
protected function prependCruds(ContainerBuilder $container): void
|
||||
{
|
||||
$container->prependExtensionConfig('chill_main', [
|
||||
'cruds' => [
|
||||
[
|
||||
'class' => EventTheme::class,
|
||||
'name' => 'event_theme',
|
||||
'base_path' => '/admin/event/theme',
|
||||
'form_class' => EventThemeType::class,
|
||||
'controller' => EventThemeController::class,
|
||||
'actions' => [
|
||||
'index' => [
|
||||
'template' => '@ChillEvent/Admin/EventTheme/index.html.twig',
|
||||
'role' => 'ROLE_ADMIN',
|
||||
],
|
||||
'new' => [
|
||||
'role' => 'ROLE_ADMIN',
|
||||
'template' => '@ChillEvent/Admin/EventTheme/new.html.twig',
|
||||
],
|
||||
'edit' => [
|
||||
'role' => 'ROLE_ADMIN',
|
||||
'template' => '@ChillEvent/Admin/EventTheme/edit.html.twig',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user