1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* part-db version 0.1 |
4
|
|
|
* Copyright (C) 2005 Christoph Lechner |
5
|
|
|
* http://www.cl-projects.de/. |
6
|
|
|
* |
7
|
|
|
* part-db version 0.2+ |
8
|
|
|
* Copyright (C) 2009 K. Jacobs and others (see authors.php) |
9
|
|
|
* http://code.google.com/p/part-db/ |
10
|
|
|
* |
11
|
|
|
* Part-DB Version 0.4+ |
12
|
|
|
* Copyright (C) 2016 - 2019 Jan Böhmer |
13
|
|
|
* https://github.com/jbtronics |
14
|
|
|
* |
15
|
|
|
* This program is free software; you can redistribute it and/or |
16
|
|
|
* modify it under the terms of the GNU General Public License |
17
|
|
|
* as published by the Free Software Foundation; either version 2 |
18
|
|
|
* of the License, or (at your option) any later version. |
19
|
|
|
* |
20
|
|
|
* This program is distributed in the hope that it will be useful, |
21
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
22
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
23
|
|
|
* GNU General Public License for more details. |
24
|
|
|
* |
25
|
|
|
* You should have received a copy of the GNU General Public License |
26
|
|
|
* along with this program; if not, write to the Free Software |
27
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
28
|
|
|
*/ |
29
|
|
|
|
30
|
|
|
namespace App\Controller; |
31
|
|
|
|
32
|
|
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; |
33
|
|
|
use Symfony\Component\Routing\Annotation\Route; |
34
|
|
|
use Symfony\Contracts\Translation\TranslatorInterface; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* Class DebugController. |
38
|
|
|
*/ |
39
|
|
|
class DebugController extends AbstractController |
40
|
|
|
{ |
41
|
|
|
/** |
42
|
|
|
* @Route("/debug/flash_test") |
43
|
|
|
*/ |
44
|
|
|
public function flashTest() |
45
|
|
|
{ |
46
|
|
|
$this->addFlash('success', 'Success Flash Message!'); |
47
|
|
|
$this->addFlash('error', 'Error Flash Message!'); |
48
|
|
|
$this->addFlash('warning', 'Warning Flash Message!'); |
49
|
|
|
$this->addFlash('notice', 'Notice Flash Message!'); |
50
|
|
|
$this->addFlash('info', 'Info Flash Message! <b>Test</b>'); |
51
|
|
|
|
52
|
|
|
$this->addFlash('testkjfd', 'Blabla. This message type should be not know to template!'); |
53
|
|
|
|
54
|
|
|
|
55
|
|
|
|
56
|
|
|
return $this->render('base.html.twig'); |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* @Route("/debug/dummy") |
61
|
|
|
*/ |
62
|
|
|
public function dummy(TranslatorInterface $translator) |
63
|
|
|
{ |
64
|
|
|
//Here we collect translation keys automatically created, so they can be extracted easily |
65
|
|
|
|
66
|
|
|
//Validators: |
67
|
|
|
$translator->trans('validator.noneofitschild.self'); |
68
|
|
|
$translator->trans('validator.noneofitschild.children'); |
69
|
|
|
$translator->trans('validator.isSelectable'); |
70
|
|
|
$translator->trans('validator.part_lot.location_full.no_increasment'); |
71
|
|
|
$translator->trans('validator.part_lot.location_full'); |
72
|
|
|
$translator->trans('validator.part_lot.only_existing'); |
73
|
|
|
$translator->trans('validator.part_lot.single_part'); |
74
|
|
|
|
75
|
|
|
//Manufacturer status |
76
|
|
|
$translator->trans('m_status.active.help'); |
77
|
|
|
$translator->trans('m_status.announced.help'); |
78
|
|
|
$translator->trans('m_status.discontinued.help'); |
79
|
|
|
$translator->trans('m_status.eol.help'); |
80
|
|
|
$translator->trans('m_status.nrfnd.help'); |
81
|
|
|
$translator->trans('m_status.unknown.help'); |
82
|
|
|
|
83
|
|
|
//Flash titles |
84
|
|
|
$translator->trans('flash.success'); |
85
|
|
|
$translator->trans('flash.error'); |
86
|
|
|
$translator->trans('flash.warning'); |
87
|
|
|
$translator->trans('flash.notice'); |
88
|
|
|
$translator->trans('flash.info'); |
89
|
|
|
|
90
|
|
|
} |
91
|
|
|
} |
92
|
|
|
|