diff options
| author | Ron Lucke <lucke@elan-ev.de> | 2025-01-13 21:15:18 +0100 |
|---|---|---|
| committer | Ron Lucke <lucke@elan-ev.de> | 2025-01-13 21:15:18 +0100 |
| commit | 60f2b28874a7e3082b7806858f23bcc4a9ac064e (patch) | |
| tree | 392006ce98c061ff16ab88f75c891620e22d06b6 /templates/header.php | |
| parent | 5ad1fb5b6dd0a801e2f5d9fc6c0d59db831a4fd0 (diff) | |
Revert "fix #5107"biest-5044
This reverts commit 5ad1fb5b6dd0a801e2f5d9fc6c0d59db831a4fd0.
Diffstat (limited to 'templates/header.php')
| -rw-r--r-- | templates/header.php | 154 |
1 files changed, 75 insertions, 79 deletions
diff --git a/templates/header.php b/templates/header.php index a3ecc99..2f1d509 100644 --- a/templates/header.php +++ b/templates/header.php @@ -122,94 +122,90 @@ if ($navigation) { <? $active = Navigation::getItem('/profile')?->isActive() ?? false; ?> <? if ($GLOBALS['perm']->have_perm('autor')) : ?> - + <li id="avatar-menu-container" + class="header_avatar_container <?= PersonalNotifications::hasUnseenNotifications() ? 'alert' : '' ?>" + > <? if (PersonalNotifications::isActivated()): ?> - <li id="notification-wrapper"> - <? $notifications = PersonalNotifications::getMyNotifications() ?> - <div id="notification-container" <?= count($notifications) > 0 ? ' class="hoverable"' : '' ?>> - <button id="notification_marker" - data-toggles="#notification_checkbox" - title="<?= sprintf( - ngettext('%u Benachrichtigung', '%u Benachrichtigungen', count($notifications)), - count($notifications) - ) ?>" - aria-controls="notification-list" - data-lastvisit="<?= UserConfig::get($GLOBALS['user']->id)->getValue('NOTIFICATIONS_SEEN_LAST_DATE') ?>" - <? if (count($notifications) === 0) echo 'disabled'; ?> - class="<?= PersonalNotifications::hasUnseenNotifications() ? 'alert' : '' ?>" - aria-expanded="false" + <? $notifications = PersonalNotifications::getMyNotifications() ?> + <div id="notification-container" <?= count($notifications) > 0 ? ' class="hoverable"' : '' ?>> + <button id="notification_marker" + data-toggles="#notification_checkbox" + title="<?= sprintf( + ngettext('%u Benachrichtigung', '%u Benachrichtigungen', count($notifications)), + count($notifications) + ) ?>" + aria-controls="notification-list" + data-lastvisit="<?= UserConfig::get($GLOBALS['user']->id)->getValue('NOTIFICATIONS_SEEN_LAST_DATE') ?>" + <? if (count($notifications) === 0) echo 'disabled'; ?> + <? if (PersonalNotifications::hasUnseenNotifications()) echo 'class="alert"'; ?> + aria-expanded="false" + > + <span class="count" aria-hidden="true"><?= count($notifications) ?></span> + </button> + <input type="checkbox" id="notification_checkbox"> + <div class="list below" id="notification_list"> + <a class="mark-all-as-read <? if (count($notifications) < 2) echo 'invisible'; ?>" + href="<?= URLHelper::getLink('dispatch.php/jsupdater/mark_notification_read/all', ['return_to' => $_SERVER['REQUEST_URI']]) ?>" > - <span class="count" aria-hidden="true"><?= count($notifications) ?></span> - <? $icon_role = PersonalNotifications::hasUnseenNotifications() ? ICON::ROLE_INFO_ALT : ICON::ROLE_CLICKABLE ?> - <?= Icon::create('notification2', $icon_role)->asImg() ?> - </button> - <input type="checkbox" id="notification_checkbox"> - <div class="list below" id="notification_list"> - <a class="mark-all-as-read <? if (count($notifications) < 2) echo 'invisible'; ?>" - href="<?= URLHelper::getLink('dispatch.php/jsupdater/mark_notification_read/all', ['return_to' => $_SERVER['REQUEST_URI']]) ?>" - > - <?= _('Alle Benachrichtigungen als gelesen markieren') ?> - </a> - <a class="enable-desktop-notifications" href="#" style="display: none;"> - <?= _('Desktop-Benachrichtigungen aktivieren') ?> - </a> - <ul> - <? foreach ($notifications as $notification) : ?> - <?= $notification->getLiElement() ?> - <? endforeach ?> - </ul> - </div> - <? if (PersonalNotifications::isAudioActivated()): ?> - <audio id="audio_notification" preload="none"> - <source src="<?= Assets::url('sounds/blubb.ogg') ?>" type="audio/ogg"> - <source src="<?= Assets::url('sounds/blubb.mp3') ?>" type="audio/mpeg"> - </audio> - <? endif; ?> + <?= _('Alle Benachrichtigungen als gelesen markieren') ?> + </a> + <a class="enable-desktop-notifications" href="#" style="display: none;"> + <?= _('Desktop-Benachrichtigungen aktivieren') ?> + </a> + <ul> + <? foreach ($notifications as $notification) : ?> + <?= $notification->getLiElement() ?> + <? endforeach ?> + </ul> </div> - </li> + <? if (PersonalNotifications::isAudioActivated()): ?> + <audio id="audio_notification" preload="none"> + <source src="<?= Assets::url('sounds/blubb.ogg') ?>" type="audio/ogg"> + <source src="<?= Assets::url('sounds/blubb.mp3') ?>" type="audio/mpeg"> + </audio> + <? endif; ?> + </div> <? endif; ?> <? if (Navigation::hasItem('/avatar')): ?> - <li id="avatar-wrapper"> - <form id="avatar-menu" method="post"> - <?php - $action_menu = ContentGroupMenu::get(); - $action_menu->addCSSClass('avatar-menu'); - $action_menu->addAttribute('data-action-menu-reposition', 'false'); - $action_menu->setLabel(User::findCurrent()->getFullName()); - $action_menu->setAriaLabel(_('Profilmenü')); - $action_menu->setIcon( - Avatar::getAvatar(User::findCurrent()->id)->getImageTag(), - ['id' => 'header_avatar_image_link'] - ); + <form id="avatar-menu" method="post"> + <?php + $action_menu = ContentGroupMenu::get(); + $action_menu->addCSSClass('avatar-menu'); + $action_menu->addAttribute('data-action-menu-reposition', 'false'); + $action_menu->setLabel(User::findCurrent()->getFullName()); + $action_menu->setAriaLabel(_('Profilmenü')); + $action_menu->setIcon( + Avatar::getAvatar(User::findCurrent()->id)->getImageTag(), + ['id' => 'header_avatar_image_link'] + ); - foreach (Navigation::getItem('/avatar') as $subnav) { - if ($subnav->getRenderAsButton()) { - $action_menu->addButton( - 'logout', - $subnav->getTitle(), - $subnav->getImage(), - array_merge( - $subnav->getLinkAttributes(), - ['formaction' => URLHelper::getURL($subnav->getURL(), [], true)] - ) - ); - } else { - $action_menu->addLink( - URLHelper::getURL($subnav->getURL(), [], true), - $subnav->getTitle(), - $subnav->getImage(), - $subnav->getLinkAttributes() - ); - } + foreach (Navigation::getItem('/avatar') as $subnav) { + if ($subnav->getRenderAsButton()) { + $action_menu->addButton( + 'logout', + $subnav->getTitle(), + $subnav->getImage(), + array_merge( + $subnav->getLinkAttributes(), + ['formaction' => URLHelper::getURL($subnav->getURL(), [], true)] + ) + ); + } else { + $action_menu->addLink( + URLHelper::getURL($subnav->getURL(), [], true), + $subnav->getTitle(), + $subnav->getImage(), + $subnav->getLinkAttributes() + ); } - SkipLinks::addIndex(_('Profilmenü'), 'header_avatar_image_link', 1, false); - ?> - <?= $action_menu->render(); ?> - </form> - </li> + } + SkipLinks::addIndex(_('Profilmenü'), 'header_avatar_image_link', 1, false); + ?> + <?= $action_menu->render(); ?> + </form> <? endif; ?> - + </li> <? endif; ?> <? else: ?> <li> |
