@@ -4,12 +4,9 @@ |
||
| 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 Interop\Http\ServerMiddleware\MiddlewareInterface; |
| 10 | 9 | use Interop\Http\ServerMiddleware\DelegateInterface; |
| 11 | -use Zend\Diactoros\Response; |
|
| 12 | -use Relay\RelayBuilder; |
|
| 13 | 10 | |
| 14 | 11 | /** |
| 15 | 12 | * Main manager. |
@@ -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 ?: 'file/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 ?> |