@@ -15,12 +15,12 @@ discard block |
||
15 | 15 | <?php foreach ($app->getAllEntities() as list($e, $id)): ?> |
16 | 16 | <li> |
17 | 17 | <?php |
18 | - if ($id === null) { |
|
19 | - $url = $app->getRoute('search', ['entity' => $e->getName()]); |
|
20 | - } else { |
|
21 | - $url = $app->getRoute('read', ['entity' => $e->getName(), 'id' => $id]); |
|
22 | - } |
|
23 | - ?> |
|
18 | + if ($id === null) { |
|
19 | + $url = $app->getRoute('search', ['entity' => $e->getName()]); |
|
20 | + } else { |
|
21 | + $url = $app->getRoute('read', ['entity' => $e->getName(), 'id' => $id]); |
|
22 | + } |
|
23 | + ?> |
|
24 | 24 | <a href="<?= $url ?>" title="<?= $e->description ?>"<?= ($entityName === $e->getName()) ? ' class="is-active"' : '' ?>> |
25 | 25 | <?= $this->icon($e->icon ?: 'folder-open') ?> |
26 | 26 | <strong><?= $e->title ?></strong> |
@@ -37,12 +37,12 @@ discard block |
||
37 | 37 | |
38 | 38 | <form action="<?= $app->getRoute('search', ['entity' => $entityName]) ?>" class="menu-secondary-search" data-module="search" method="get" tabindex="-1"> |
39 | 39 | <?php |
40 | - if ($app->getEntityId($entityName) === null) { |
|
41 | - $url = $app->getRoute('search', ['entity' => $entityName]); |
|
42 | - } else { |
|
43 | - $url = $app->getRoute('read', ['entity' => $entityName, 'id' => $id]); |
|
44 | - } |
|
45 | - ?> |
|
40 | + if ($app->getEntityId($entityName) === null) { |
|
41 | + $url = $app->getRoute('search', ['entity' => $entityName]); |
|
42 | + } else { |
|
43 | + $url = $app->getRoute('read', ['entity' => $entityName, 'id' => $id]); |
|
44 | + } |
|
45 | + ?> |
|
46 | 46 | |
47 | 47 | <a href="<?= $url ?>" title="<?= $entity->description ?>"> |
48 | 48 | <?= $entity->title ?> |
@@ -33,7 +33,7 @@ |
||
33 | 33 | /** |
34 | 34 | * {@inheritdoc} |
35 | 35 | * |
36 | - * @return ResponseInterface |
|
36 | + * @return \Psr\Http\Message\ResponseInterface |
|
37 | 37 | */ |
38 | 38 | public function handle(ServerRequestInterface $request): ResponseInterface |
39 | 39 | { |
@@ -4,11 +4,8 @@ |
||
4 | 4 | |
5 | 5 | use Fol\{App, NotFoundException}; |
6 | 6 | use Folk\Entities\EntityInterface; |
7 | -use Folk\Entities\SingleEntityInterface; |
|
8 | 7 | use Psr\Http\Message\{ServerRequestInterface, ResponseInterface, UriInterface}; |
9 | 8 | use Psr\Http\Server\RequestHandlerInterface; |
10 | -use Zend\Diactoros\Response; |
|
11 | -use Relay\RelayBuilder; |
|
12 | 9 | |
13 | 10 | /** |
14 | 11 | * Main manager. |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | public function getFactories() |
13 | 13 | { |
14 | 14 | return [ |
15 | - 'templates' => function (App $app): Engine { |
|
15 | + 'templates' => function(App $app): Engine { |
|
16 | 16 | $root = dirname(dirname(__DIR__)); |
17 | 17 | |
18 | 18 | $templates = new Engine($root.'/templates'); |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | |
21 | 21 | $templates->addData(['app' => $app]); |
22 | 22 | |
23 | - $templates->registerFunction('icon', function ($name) use ($icons) { |
|
23 | + $templates->registerFunction('icon', function($name) use ($icons) { |
|
24 | 24 | return $icons->get($name); |
25 | 25 | }); |
26 | 26 |
@@ -11,7 +11,7 @@ |
||
11 | 11 | public function getFactories() |
12 | 12 | { |
13 | 13 | return [ |
14 | - 'router' => function (App $app): RouterContainer { |
|
14 | + 'router' => function(App $app): RouterContainer { |
|
15 | 15 | $router = new RouterContainer(); |
16 | 16 | |
17 | 17 | $map = $router->getMap(); |
@@ -11,13 +11,13 @@ |
||
11 | 11 | public function getFactories() |
12 | 12 | { |
13 | 13 | return [ |
14 | - 'builder' => function (App $app): FormatFactory { |
|
15 | - return new FormatFactory($app); |
|
16 | - } |
|
14 | + 'builder' => function (App $app): FormatFactory { |
|
15 | + return new FormatFactory($app); |
|
16 | + } |
|
17 | 17 | ]; |
18 | 18 | } |
19 | 19 | |
20 | 20 | public function getExtensions() { |
21 | - return []; |
|
21 | + return []; |
|
22 | 22 | } |
23 | 23 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | public function getFactories() |
12 | 12 | { |
13 | 13 | return [ |
14 | - 'builder' => function (App $app): FormatFactory { |
|
14 | + 'builder' => function(App $app): FormatFactory { |
|
15 | 15 | return new FormatFactory($app); |
16 | 16 | } |
17 | 17 | ]; |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | public function getFactories() |
14 | 14 | { |
15 | 15 | return [ |
16 | - 'middleware' => function (App $app): Dispatcher { |
|
16 | + 'middleware' => function(App $app): Dispatcher { |
|
17 | 17 | $middleware = []; |
18 | 18 | |
19 | 19 | $middleware[] = new Middlewares\Expires(); |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | $middleware[] = new Middlewares\ContentType(); |
23 | 23 | $middleware[] = new Middlewares\ContentLanguage(['en', 'gl', 'es']); |
24 | 24 | |
25 | - $middleware[] = function ($request, $next) use ($app) { |
|
25 | + $middleware[] = function($request, $next) use ($app) { |
|
26 | 26 | $language = $request->getHeaderLine('Accept-Language'); |
27 | 27 | $translator = new Translator(); |
28 | 28 | $translator->loadTranslations(Translations::fromPoFile(dirname(dirname(__DIR__)).'/locales/'.$language.'.po')); |
@@ -3,8 +3,6 @@ |
||
3 | 3 | namespace Folk\Controllers; |
4 | 4 | |
5 | 5 | use Psr\Http\Message\ServerRequestInterface as Request; |
6 | -use Psr\Http\Message\ResponseInterface as Response; |
|
7 | -use Folk\Admin; |
|
8 | 6 | |
9 | 7 | class InsertEntity extends Entity |
10 | 8 | { |