diff options
| -rw-r--r-- | locale/en_GB.json | 1 | ||||
| -rw-r--r-- | templates/side_navigation.php | 2 | ||||
| -rw-r--r-- | templates/skeleton.php | 7 |
3 files changed, 8 insertions, 2 deletions
diff --git a/locale/en_GB.json b/locale/en_GB.json index 12e1ce9..9fea62c 100644 --- a/locale/en_GB.json +++ b/locale/en_GB.json @@ -38,6 +38,7 @@ "note.resharedBy": "Reshared by %s", "navigation.login": "Log in", "navigation.logout": "Log out", + "navigation.logout.confirmation": "Are you sure you want to log out?", "navigation.followRequests": "Follow requests", "navigation.instanceSettings": "Instance settings", "login.pageTitle": "Log in", diff --git a/templates/side_navigation.php b/templates/side_navigation.php index d9a2dfd..9b21833 100644 --- a/templates/side_navigation.php +++ b/templates/side_navigation.php @@ -1,7 +1,7 @@ <ul class="sideNavigation"> <?php foreach ($links as $entry): ?> <li> - <a href="<?= $entry['href'] ?>"> + <a href="<?= $entry['href'] ?>" <?= ($entry['confirmation'] ?? null) ? ('hx-confirm="' . $entry['confirmation'] . '"') : '' ?>> <div class="icon material-symbols-outlined"><?= $entry['icon'] ?></div> <div><?= $entry['label'] ?></div> <?php if (isset($entry['unreadCount']) && $entry['unreadCount'] > 0) { diff --git a/templates/skeleton.php b/templates/skeleton.php index 5186b4a..c91dc42 100644 --- a/templates/skeleton.php +++ b/templates/skeleton.php @@ -59,7 +59,12 @@ $settings = GlobalSettings::getInstance(); if ($user->isAdmin) { $links[] = ['href' => '/admin/settings/instance', 'icon' => 'settings', 'label' => __('navigation.instanceSettings')]; } - $links[] = ['href' => '/logout', 'icon' => 'logout', 'label' => __('navigation.logout')]; + $links[] = [ + 'href' => '/logout', + 'icon' => 'logout', + 'label' => __('navigation.logout'), + 'confirmation' => __('navigation.logout.confirmation') + ]; call_template('side_navigation', ['links' => $links]); } ?> |
