Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
# Lifter010: TODO
$nav_items = Navigation::getItem('/')->getIterator()->getArrayCopy();
$nav_items = array_filter($nav_items, function ($item) {
return $item->isVisible(true);
});
$header_nav = ['visible' => $nav_items, 'hidden' => []];
if (isset($_COOKIE['navigation-length'])) {
$header_nav['hidden'] = array_splice(
$header_nav['visible'],
$_COOKIE['navigation-length']
);
}
?>
<!-- Leiste unten -->
<div id="barBottomContainer">
<div id="barBottomLeft">
<input type="checkbox" id="barTopMenu-toggle">
<label for="barTopMenu-toggle">
<?= _('Menü') ?>
</label>
<? // The main menu will be placed here when scrolled, see navigation.less ?>
</div>
<div id="barTopFont">
<?= htmlReady(Config::get()->UNI_NAME_CLEAN) ?>
</div>
<!-- Dynamische Links ohne Icons -->
<div id="barBottomright">
<ul>
<? if (Navigation::hasItem('/links')): ?>
<? foreach (Navigation::getItem('/links') as $nav): ?>
<? if ($nav->isVisible()) : ?>
<li class="<? if ($nav->isActive()) echo 'active'; ?> <?= htmlReady($nav->getLinkAttributes()['class'] ?? '') ?>">
<a
<? if (is_internal_url($url = $nav->getURL())) : ?>
href="<?= URLHelper::getLink($url) ?>"
<? else: ?>
href="<?= htmlReady($url) ?>" target="_blank" rel="noopener noreferrer"
<? endif; ?>
<? if ($nav->getDescription()): ?>
title="<?= htmlReady($nav->getDescription()) ?>"
<? endif; ?>
<?= arrayToHtmlAttributes(array_diff_key($nav->getLinkAttributes(), array_flip(['class', 'title']))) ?>
><?= htmlReady($nav->getTitle()) ?></a>
</li>
<? endif; ?>
<? endforeach; ?>
<? endif; ?>
<? if (isset($show_quicksearch)) : ?>
<? if (PageLayout::hasCustomQuicksearch()): ?>
<?= PageLayout::getCustomQuicksearch() ?>
<? else: ?>
<? SkipLinks::addIndex(_('Suche'), 'globalsearch-input', 910) ?>
<li id="quicksearch_item">
<script>
var selectSem = function (seminar_id, name) {
document.location = "<?= URLHelper::getURL("dispatch.php/course/details/", ["send_from_search" => 1, "send_from_search_page" => URLHelper::getURL("dispatch.php/search/courses?keep_result_set=1")]) ?>&sem_id=" + seminar_id;
};
</script>
<?= $GLOBALS['template_factory']->render('globalsearch/searchbar') ?>
</li>
<? endif; ?>
<? endif; ?>
<? if (is_object($GLOBALS['perm']) && $GLOBALS['perm']->have_perm('user')): ?>
<? $active = Navigation::hasItem('/profile')
&& Navigation::getItem('/profile')->isActive();
?>
<!-- User-Avatar -->
<li class="header_avatar_container <? if ($active) echo 'active'; ?>" id="barTopAvatar">
<? if (is_object($GLOBALS['perm']) && PersonalNotifications::isActivated() && $GLOBALS['perm']->have_perm('autor')) : ?>
<? $notifications = PersonalNotifications::getMyNotifications() ?>
<? $lastvisit = (int)UserConfig::get($GLOBALS['user']->id)->getValue('NOTIFICATIONS_SEEN_LAST_DATE') ?>
<div id="notification_container"<?= count($notifications) > 0 ? ' class="hoverable"' : '' ?>>
<? foreach ($notifications as $notification) {
if ($notification['mkdate'] > $lastvisit) {
$alert = true;
}
} ?>
<div id="notification_marker"<?= !empty($alert) ? ' class="alert"' : "" ?> title="<?= _("Benachrichtigungen") ?>" data-lastvisit="<?= $lastvisit ?>">
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?= count($notifications) ?>
</div>
<div class="list below" id="notification_list">
<a class="mark-all-as-read <? if (count($notifications) < 2) echo 'notification_hidden'; ?>" 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; ?>
</div>
<? else: ?>
<div id="notification_container"></div>
<? endif; ?>
<? if (Navigation::hasItem('/avatar')): ?>
<div id="header_avatar_menu">
<?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(Avatar::MEDIUM),
['id' => 'header_avatar_image_link']
);
foreach (Navigation::getItem('/avatar') as $subnav) {
$action_menu->addLink(
URLHelper::getURL($subnav->getURL(), [], true),
$subnav->getTitle(),
$subnav->getImage()
);
}
SkipLinks::addIndex(_("Profilmenü"), "header_avatar_image_link", 1);
?>
<?= $action_menu->render(); ?>
</div>
<? endif; ?>
</li>
<? endif; ?>
</ul>
</div>
</div>
<!-- Ende Header -->
<!-- Start Header -->
<div id="flex-header">
<!--<div id='barTopLogo'>
<?= Assets::img('logos/logoneu.jpg', ['alt' => 'Logo Uni Göttingen']) ?>
</div>
-->
<? SkipLinks::addIndex(_('Hauptnavigation'), 'barTopMenu', 2); ?>
<ul id="barTopMenu" role="navigation" <? if (count($header_nav['hidden']) > 0) echo 'class="overflown"'; ?>>
<? foreach ($header_nav['visible'] as $path => $nav): ?>
<?= $this->render_partial(
'header-navigation-item.php',
) ?>
<? endforeach; ?>
<li class="overflow">
<input type="checkbox" id="header-sink">
<label for="header-sink">
<a class="canvasready" href="#">
<?= Icon::create('action', 'navigation')->asImg(28, [
'class' => 'headericon original',
'title' => '',
'alt' => '',
]) ?>
<div class="navtitle">
<?= _('Mehr') ?>…
</div>
</a>
</label>
<ul>
<? foreach ($header_nav['hidden'] as $path => $nav) : ?>
<?= $this->render_partial(
'header-navigation-item.php',
) ?>
<? endforeach; ?>
</ul>
</li>
</ul>
<!-- Stud.IP Logo -->
<a class="studip-logo" id="barTopStudip" href="http://www.studip.de/" title="Stud.IP Homepage" target="_blank" rel="noopener noreferrer">
Stud.IP Homepage
</a>
</div>