<!--
#   Copyright © 2021,2022 IsardVDI S.L.
#
#   This file is part of DD
#
#   DD is free software: you can redistribute it and/or modify
#   it under the terms of the GNU Affero General Public License as published by
#   the Free Software Foundation, either version 3 of the License, or (at your
#   option) any later version.
#
#   DD is distributed in the hope that it will be useful, but WITHOUT ANY
#   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
#   FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
#   details.
#
#   You should have received a copy of the GNU Affero General Public License
#   along with DD. If not, see <https://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
-->
<div id="navbar-nextcloud" class="header-right">      

    <div id="unified-search"></div>
    <div id="notifications"></div>
    <div id="contactsmenu">
        <div class="icon-contacts menutoggle" tabindex="0" role="button"
        aria-haspopup="true" aria-controls="contactsmenu-menu" aria-expanded="false">
            <span class="hidden-visually"><?php p($l->t('Contacts'));?></span>
        </div>
        <div id="contactsmenu-menu" class="menu"
            aria-label="<?php p($l->t('Contacts menu'));?>"></div>
    </div>
    <div id="settings">
        <div id="expand" tabindex="0" role="button" class="menutoggle"
            aria-label="<?php p($l->t('Settings'));?>"
            aria-haspopup="true" aria-controls="expanddiv" aria-expanded="false">
            <div class="avatardiv<?php if ($_['userAvatarSet']) {
    print_unescaped(' avatardiv-shown');
} else {
    print_unescaped('" style="display: none');
} ?>">
                <?php if ($_['userAvatarSet']): ?>
                    <img alt="" width="32" height="32"
                    src="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', ['userId' => $_['user_uid'], 'size' => 32, 'v' => $_['userAvatarVersion']]));?>"
                    srcset="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', ['userId' => $_['user_uid'], 'size' => 64, 'v' => $_['userAvatarVersion']]));?> 2x, <?php p(\OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', ['userId' => $_['user_uid'], 'size' => 128, 'v' => $_['userAvatarVersion']]));?> 4x"
                    >
                <?php endif; ?>
            </div>
            <div id="expandDisplayName" class="icon-settings-white"></div>
        </div>
        <nav class="settings-menu" id="expanddiv" style="display:none;"
            aria-label="<?php p($l->t('Settings menu'));?>">
        <ul>
        <?php foreach ($_['settingsnavigation'] as $entry):?>
            <li data-id="<?php p($entry['id']); ?>">
                <a href="<?php print_unescaped($entry['href']); ?>"
                    <?php if ($entry["active"]): ?> class="active"<?php endif; ?>>
                    <img alt="" src="<?php print_unescaped($entry['icon'] . '?v=' . $_['versionHash']); ?>">
                    <?php p($entry['name']) ?>
                </a>
            </li>
        <?php endforeach; ?>
        </ul>
        </nav>
    </div>
</div>
