mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-09 22:17:26 +01:00
Optimized menu
This commit is contained in:
parent
8f119338f0
commit
255d580532
@ -44,21 +44,27 @@ class UserMenuSubscriber implements EventSubscriberInterface
|
||||
]
|
||||
]);
|
||||
|
||||
$dropdown = $menu->addChild('user', [
|
||||
$dropdown = $menu->addChild($this->tokenStorage->getToken()
|
||||
->getUsername() ?? 'user', [
|
||||
'attributes' => [
|
||||
'dropdown' => true,
|
||||
'icon' => 'fas fa-user'
|
||||
]
|
||||
]);
|
||||
/**
|
||||
* @todo replace the following check trough fos bundle
|
||||
*/
|
||||
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
|
||||
]
|
||||
]);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user