@@ -11,11 +11,11 @@ |
||
11 | 11 | */ |
12 | 12 | private $container; |
13 | 13 | |
14 | - /** |
|
15 | - * Globals constructor. |
|
16 | - * @param ContainerInterface $container |
|
17 | - */ |
|
18 | - public function __construct(ContainerInterface $container) |
|
14 | + /** |
|
15 | + * Globals constructor. |
|
16 | + * @param ContainerInterface $container |
|
17 | + */ |
|
18 | + public function __construct(ContainerInterface $container) |
|
19 | 19 | { |
20 | 20 | $this->container = $container; |
21 | 21 | } |
@@ -51,9 +51,9 @@ |
||
51 | 51 | $dev_mode = $this->container->getParameter("ribs_admin")["dev_mode"]; |
52 | 52 | |
53 | 53 | if ($dev_mode === true) { |
54 | - $package = "lib/".$this->getPackageDevName($package); |
|
54 | + $package = "lib/" . $this->getPackageDevName($package); |
|
55 | 55 | } |
56 | 56 | |
57 | - return implode("/", $path)."/../../" . $package; |
|
57 | + return implode("/", $path) . "/../../" . $package; |
|
58 | 58 | } |
59 | 59 | } |
@@ -50,7 +50,7 @@ |
||
50 | 50 | $output->writeln("Start composer require " . $pacakge_name); |
51 | 51 | |
52 | 52 | $process = new Process("composer require " . $pacakge_name); |
53 | - $process->run(function ($type, $buffer) { |
|
53 | + $process->run(function($type, $buffer) { |
|
54 | 54 | echo $buffer; |
55 | 55 | }); |
56 | 56 |
@@ -13,64 +13,64 @@ |
||
13 | 13 | |
14 | 14 | class ImportModuleCommand extends Command |
15 | 15 | { |
16 | - private $em; |
|
16 | + private $em; |
|
17 | 17 | |
18 | - /** |
|
19 | - * ImportModuleCommand constructor. |
|
20 | - * @param EntityManagerInterface $em |
|
21 | - * @param string|null $name |
|
22 | - */ |
|
23 | - public function __construct(EntityManagerInterface $em, string $name = null) |
|
24 | - { |
|
25 | - parent::__construct($name); |
|
26 | - $this->em = $em; |
|
27 | - } |
|
18 | + /** |
|
19 | + * ImportModuleCommand constructor. |
|
20 | + * @param EntityManagerInterface $em |
|
21 | + * @param string|null $name |
|
22 | + */ |
|
23 | + public function __construct(EntityManagerInterface $em, string $name = null) |
|
24 | + { |
|
25 | + parent::__construct($name); |
|
26 | + $this->em = $em; |
|
27 | + } |
|
28 | 28 | |
29 | - protected function configure() |
|
30 | - { |
|
31 | - $this |
|
32 | - ->setName('ribsadmin:import-module') |
|
33 | - ->setDescription('Import a module in ribs admin') |
|
34 | - ->addArgument( |
|
35 | - 'package-name', |
|
36 | - InputArgument::REQUIRED, |
|
37 | - 'Name of composer package to import' |
|
38 | - ) |
|
39 | - ->addArgument( |
|
40 | - 'module-name', |
|
41 | - InputArgument::REQUIRED, |
|
42 | - 'Name of package to display in app' |
|
43 | - ) |
|
44 | - ; |
|
45 | - } |
|
29 | + protected function configure() |
|
30 | + { |
|
31 | + $this |
|
32 | + ->setName('ribsadmin:import-module') |
|
33 | + ->setDescription('Import a module in ribs admin') |
|
34 | + ->addArgument( |
|
35 | + 'package-name', |
|
36 | + InputArgument::REQUIRED, |
|
37 | + 'Name of composer package to import' |
|
38 | + ) |
|
39 | + ->addArgument( |
|
40 | + 'module-name', |
|
41 | + InputArgument::REQUIRED, |
|
42 | + 'Name of package to display in app' |
|
43 | + ) |
|
44 | + ; |
|
45 | + } |
|
46 | 46 | |
47 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
48 | - { |
|
49 | - $pacakge_name = $input->getArgument('package-name'); |
|
50 | - $output->writeln("Start composer require " . $pacakge_name); |
|
47 | + protected function execute(InputInterface $input, OutputInterface $output) |
|
48 | + { |
|
49 | + $pacakge_name = $input->getArgument('package-name'); |
|
50 | + $output->writeln("Start composer require " . $pacakge_name); |
|
51 | 51 | |
52 | - $process = new Process("composer require " . $pacakge_name); |
|
53 | - $process->run(function ($type, $buffer) { |
|
54 | - echo $buffer; |
|
55 | - }); |
|
52 | + $process = new Process("composer require " . $pacakge_name); |
|
53 | + $process->run(function ($type, $buffer) { |
|
54 | + echo $buffer; |
|
55 | + }); |
|
56 | 56 | |
57 | - if (!$process->isSuccessful()) { |
|
58 | - throw new ProcessFailedException($process); |
|
59 | - } |
|
57 | + if (!$process->isSuccessful()) { |
|
58 | + throw new ProcessFailedException($process); |
|
59 | + } |
|
60 | 60 | |
61 | - $output->writeln("End composer require " . $pacakge_name); |
|
62 | - $output->writeln("Start insertion of module in database " . $pacakge_name); |
|
61 | + $output->writeln("End composer require " . $pacakge_name); |
|
62 | + $output->writeln("Start insertion of module in database " . $pacakge_name); |
|
63 | 63 | |
64 | - $module = new Module(); |
|
65 | - $module->setPackageName($pacakge_name); |
|
66 | - $module->setTitle($input->getArgument('module-name')); |
|
67 | - $module->setActive(false); |
|
68 | - $module->setDisplayed(true); |
|
69 | - $this->em->persist($module); |
|
70 | - $this->em->flush(); |
|
64 | + $module = new Module(); |
|
65 | + $module->setPackageName($pacakge_name); |
|
66 | + $module->setTitle($input->getArgument('module-name')); |
|
67 | + $module->setActive(false); |
|
68 | + $module->setDisplayed(true); |
|
69 | + $this->em->persist($module); |
|
70 | + $this->em->flush(); |
|
71 | 71 | |
72 | - $output->writeln("Installation of " . $pacakge_name . " is finished. You have now to configure this module in your administration interface"); |
|
72 | + $output->writeln("Installation of " . $pacakge_name . " is finished. You have now to configure this module in your administration interface"); |
|
73 | 73 | |
74 | - return 0; |
|
75 | - } |
|
74 | + return 0; |
|
75 | + } |
|
76 | 76 | } |
@@ -8,11 +8,11 @@ |
||
8 | 8 | |
9 | 9 | class PageController extends AbstractController |
10 | 10 | { |
11 | - /** |
|
12 | - * method to show index page of content management |
|
13 | - * @Route("/contents", name="ribsadmin_contents") |
|
14 | - * @return Response |
|
15 | - */ |
|
11 | + /** |
|
12 | + * method to show index page of content management |
|
13 | + * @Route("/contents", name="ribsadmin_contents") |
|
14 | + * @return Response |
|
15 | + */ |
|
16 | 16 | public function indexAction(): Response |
17 | 17 | { |
18 | 18 | $navigation = $this->getDoctrine()->getManager()->getRepository("RibsAdminBundle:Navigation")->findAllNavigationPage(); |
@@ -9,11 +9,11 @@ |
||
9 | 9 | |
10 | 10 | class RenderPageController extends AbstractController |
11 | 11 | { |
12 | - /** |
|
13 | - * @Route("/page/{url}", name="page", requirements={"url" = "[a-zA-Z0-9\-\_\/]*"}) |
|
14 | - * @param string $url |
|
15 | - * @return Response |
|
16 | - */ |
|
12 | + /** |
|
13 | + * @Route("/page/{url}", name="page", requirements={"url" = "[a-zA-Z0-9\-\_\/]*"}) |
|
14 | + * @param string $url |
|
15 | + * @return Response |
|
16 | + */ |
|
17 | 17 | public function renderPageAction(string $url): Response |
18 | 18 | { |
19 | 19 | $em = $this->getDoctrine()->getManager(); |
@@ -28,15 +28,15 @@ |
||
28 | 28 | ]); |
29 | 29 | } |
30 | 30 | |
31 | - /** |
|
32 | - * @Route("/access-rights-management/create/", name="ribsadmin_access_rights_create") |
|
33 | - * @Route("/access-rights-management/edit/{guid}", name="ribsadmin_access_rights_edit") |
|
34 | - * @param Request $request |
|
35 | - * @param Globals $globals |
|
36 | - * @param ModuleService $module |
|
37 | - * @param string|null $guid |
|
38 | - * @return Response |
|
39 | - */ |
|
31 | + /** |
|
32 | + * @Route("/access-rights-management/create/", name="ribsadmin_access_rights_create") |
|
33 | + * @Route("/access-rights-management/edit/{guid}", name="ribsadmin_access_rights_edit") |
|
34 | + * @param Request $request |
|
35 | + * @param Globals $globals |
|
36 | + * @param ModuleService $module |
|
37 | + * @param string|null $guid |
|
38 | + * @return Response |
|
39 | + */ |
|
40 | 40 | public function editAction(Request $request, Globals $globals, ModuleService $module, string $guid = null): Response |
41 | 41 | { |
42 | 42 | $em = $this->getDoctrine()->getManager(); |
@@ -11,17 +11,17 @@ |
||
11 | 11 | |
12 | 12 | class LoginController extends AbstractController |
13 | 13 | { |
14 | - /** |
|
15 | - * @Route("/login/", name="ribsadmin_login") |
|
16 | - * @param CsrfTokenManagerInterface $token |
|
17 | - * @param AuthenticationUtils $auth_utils |
|
18 | - * @return Response |
|
19 | - */ |
|
14 | + /** |
|
15 | + * @Route("/login/", name="ribsadmin_login") |
|
16 | + * @param CsrfTokenManagerInterface $token |
|
17 | + * @param AuthenticationUtils $auth_utils |
|
18 | + * @return Response |
|
19 | + */ |
|
20 | 20 | public function loginAction(AuthenticationUtils $auth_utils): Response |
21 | 21 | { |
22 | - $csrf_token = $this->has('security.csrf.token_manager') |
|
23 | - ? $this->get('security.csrf.token_manager')->getToken('authenticate')->getValue() |
|
24 | - : null; |
|
22 | + $csrf_token = $this->has('security.csrf.token_manager') |
|
23 | + ? $this->get('security.csrf.token_manager')->getToken('authenticate')->getValue() |
|
24 | + : null; |
|
25 | 25 | |
26 | 26 | if ($auth_utils->getLastAuthenticationError()) { |
27 | 27 | $this->addFlash("error-flash", "Your login or password are incorrect"); |
@@ -7,8 +7,8 @@ |
||
7 | 7 | |
8 | 8 | class RibsAdminBundle extends Bundle |
9 | 9 | { |
10 | - public function getContainerExtension() |
|
11 | - { |
|
12 | - return new RibsAdminExtension(); |
|
13 | - } |
|
10 | + public function getContainerExtension() |
|
11 | + { |
|
12 | + return new RibsAdminExtension(); |
|
13 | + } |
|
14 | 14 | } |
@@ -10,12 +10,12 @@ |
||
10 | 10 | |
11 | 11 | class RibsAdminExtension extends Extension |
12 | 12 | { |
13 | - public function load(array $configs, ContainerBuilder $container) |
|
14 | - { |
|
15 | - $loader = new YamlFileLoader( |
|
16 | - $container, |
|
17 | - new FileLocator(__DIR__.'/../Resources/config') |
|
18 | - ); |
|
19 | - $loader->load('services.yml'); |
|
20 | - } |
|
13 | + public function load(array $configs, ContainerBuilder $container) |
|
14 | + { |
|
15 | + $loader = new YamlFileLoader( |
|
16 | + $container, |
|
17 | + new FileLocator(__DIR__.'/../Resources/config') |
|
18 | + ); |
|
19 | + $loader->load('services.yml'); |
|
20 | + } |
|
21 | 21 | } |
@@ -14,7 +14,7 @@ |
||
14 | 14 | { |
15 | 15 | $loader = new YamlFileLoader( |
16 | 16 | $container, |
17 | - new FileLocator(__DIR__.'/../Resources/config') |
|
17 | + new FileLocator(__DIR__ . '/../Resources/config') |
|
18 | 18 | ); |
19 | 19 | $loader->load('services.yml'); |
20 | 20 | } |
@@ -26,22 +26,22 @@ discard block |
||
26 | 26 | "label" => "Package name", |
27 | 27 | "required" => true |
28 | 28 | ]) |
29 | - ->add("titleTag", TextType::class, [ |
|
30 | - "label" => "Title tag", |
|
31 | - "required" => true |
|
32 | - ]) |
|
33 | - ->add("descriptionTag", TextareaType::class, [ |
|
34 | - "label" => "Description tag", |
|
35 | - "required" => true, |
|
36 | - ]) |
|
37 | - ->add("url", TextType::class, [ |
|
38 | - "label" => "Url", |
|
39 | - "required" => true |
|
40 | - ]) |
|
41 | - ->add("urlAdmin", TextType::class, [ |
|
42 | - "label" => "Admin url", |
|
43 | - "required" => true |
|
44 | - ]) |
|
29 | + ->add("titleTag", TextType::class, [ |
|
30 | + "label" => "Title tag", |
|
31 | + "required" => true |
|
32 | + ]) |
|
33 | + ->add("descriptionTag", TextareaType::class, [ |
|
34 | + "label" => "Description tag", |
|
35 | + "required" => true, |
|
36 | + ]) |
|
37 | + ->add("url", TextType::class, [ |
|
38 | + "label" => "Url", |
|
39 | + "required" => true |
|
40 | + ]) |
|
41 | + ->add("urlAdmin", TextType::class, [ |
|
42 | + "label" => "Admin url", |
|
43 | + "required" => true |
|
44 | + ]) |
|
45 | 45 | ->add("active", CheckboxType::class, [ |
46 | 46 | "label" => "Enable module", |
47 | 47 | "attr" => [ |
@@ -49,17 +49,17 @@ discard block |
||
49 | 49 | ], |
50 | 50 | "required" => false |
51 | 51 | ]) |
52 | - ->add("displayed", CheckboxType::class, [ |
|
53 | - "label" => "Display module in navigation", |
|
54 | - "attr" => [ |
|
55 | - "class" => "ribs-checkbox switched cxs-2 no-pl" |
|
56 | - ], |
|
57 | - "required" => false |
|
58 | - ]) |
|
59 | - ->add('submit', SubmitType::class, [ |
|
60 | - 'label' => 'Validate', |
|
61 | - 'attr' => [] |
|
62 | - ]); |
|
52 | + ->add("displayed", CheckboxType::class, [ |
|
53 | + "label" => "Display module in navigation", |
|
54 | + "attr" => [ |
|
55 | + "class" => "ribs-checkbox switched cxs-2 no-pl" |
|
56 | + ], |
|
57 | + "required" => false |
|
58 | + ]) |
|
59 | + ->add('submit', SubmitType::class, [ |
|
60 | + 'label' => 'Validate', |
|
61 | + 'attr' => [] |
|
62 | + ]); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | public function configureOptions(OptionsResolver $resolver) |