diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2024-10-18 08:28:24 +0000 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2024-10-18 08:28:24 +0000 |
| commit | 31b270404561a11608a39bf1277f3854ea670033 (patch) | |
| tree | dcee3ad388cb96ddb687abaa731cc1408a2375d2 /lib | |
| parent | 48db94cc8e8674110220eaafe2cbe0e75c62ae11 (diff) | |
post logout, re #4692
Merge request studip/studip!3507
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/navigation/AvatarNavigation.php | 1 | ||||
| -rw-r--r-- | lib/navigation/Navigation.php | 18 |
2 files changed, 19 insertions, 0 deletions
diff --git a/lib/navigation/AvatarNavigation.php b/lib/navigation/AvatarNavigation.php index a762db7..64bbdbc6 100644 --- a/lib/navigation/AvatarNavigation.php +++ b/lib/navigation/AvatarNavigation.php @@ -48,6 +48,7 @@ class AvatarNavigation extends Navigation // Link to logout $navigation = new Navigation(_('Logout'), 'logout.php'); $navigation->setImage(Icon::create('door-leave')); + $navigation->setRenderAsButton(); $this->addSubNavigation('logout', $navigation); } } diff --git a/lib/navigation/Navigation.php b/lib/navigation/Navigation.php index af4355b..c8fde82 100644 --- a/lib/navigation/Navigation.php +++ b/lib/navigation/Navigation.php @@ -48,6 +48,8 @@ class Navigation implements IteratorAggregate protected $title; protected $url; + protected $render_as_button = false; + /** * Mark the navigation item at the given path as active. * This is just a shortcut for doing: @@ -458,6 +460,22 @@ class Navigation implements IteratorAggregate } /** + * Sets whether the navigation should be rendered as a button or not + */ + public function setRenderAsButton(bool $state = true): void + { + $this->render_as_button = $state; + } + + /** + * Return whether the navigation should be rendered as a button or not + */ + public function getRenderAsButton(): bool + { + return $this->render_as_button; + } + + /** * Get the active subnavigation item of this navigation * (if there is one). Returns NULL if the subnavigation * has no active item. |
