mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 21:57:16 +02:00
Merged Pull Request Introduce code formatting with PHP-CS-Fixer
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace App\Subscriber;
|
||||
|
||||
use App\Event\Menu\Topbar\UserMenuEvent;
|
||||
@@ -8,15 +9,12 @@ use Symfony\Component\Translation\TranslatorInterface;
|
||||
|
||||
class UserMenuSubscriber implements EventSubscriberInterface
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
* @var TokenStorageInterface
|
||||
*/
|
||||
private $tokenStorage;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var TranslatorInterface
|
||||
*/
|
||||
private $translator;
|
||||
@@ -33,61 +31,64 @@ class UserMenuSubscriber implements EventSubscriberInterface
|
||||
$menu->addChild('start', [
|
||||
'route' => 'homepage',
|
||||
'attributes' => [
|
||||
'icon' => 'fab fa-font-awesome-flag'
|
||||
'icon' => 'fab fa-font-awesome-flag',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$menu->addChild(
|
||||
'imprint',
|
||||
[
|
||||
'route' => 'imprint',
|
||||
'attributes' => [
|
||||
'icon' => 'fas fa-address-card',
|
||||
],
|
||||
]
|
||||
]);
|
||||
|
||||
$menu->addChild('imprint', [
|
||||
'route' => 'imprint',
|
||||
'attributes' => [
|
||||
'icon' => 'fas fa-address-card'
|
||||
]
|
||||
]);
|
||||
|
||||
);
|
||||
|
||||
$dropdown = $menu->addChild($this->tokenStorage->getToken()
|
||||
->getUsername() ?? 'user', [
|
||||
'attributes' => [
|
||||
'dropdown' => true,
|
||||
'icon' => 'fas fa-user'
|
||||
]
|
||||
'icon' => 'fas fa-user',
|
||||
],
|
||||
]);
|
||||
if ($this->tokenStorage->getToken()->getRoles()) {
|
||||
|
||||
$dropdown->addChild('logout', [
|
||||
'route' => 'logout',
|
||||
'attributes' => [
|
||||
'icon' => 'fas fa-sign-out-alt',
|
||||
'divider_append' => true
|
||||
]
|
||||
'divider_append' => true,
|
||||
],
|
||||
]);
|
||||
$dropdown->addChild('edit profile', [
|
||||
'route' => 'fos_user_profile_edit',
|
||||
'attributes' => [
|
||||
'icon' => 'fas fa-user-edit',
|
||||
'divider_append' => true
|
||||
]
|
||||
'divider_append' => true,
|
||||
],
|
||||
]);
|
||||
} else {
|
||||
$dropdown->addChild('login', [
|
||||
'route' => 'fos_user_security_login',
|
||||
'attributes' => [
|
||||
'divider_append' => true,
|
||||
'icon' => 'fas fa-sign-in-alt'
|
||||
]
|
||||
'icon' => 'fas fa-sign-in-alt',
|
||||
],
|
||||
]);
|
||||
}
|
||||
$dropdown->addChild('register', [
|
||||
'route' => 'fos_user_registration_register',
|
||||
'attributes' => [
|
||||
'icon' => 'fas fa-file-signature'
|
||||
]
|
||||
'icon' => 'fas fa-file-signature',
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return [
|
||||
UserMenuEvent::EVENT => 'onUserMenuConfigure'
|
||||
UserMenuEvent::EVENT => 'onUserMenuConfigure',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user