displayed nextcloud user menu like moodle and wp applications

revert-4e64f57c
elena 2023-03-08 11:32:57 +00:00
parent 006add66c4
commit 5d5ef2f884
1 changed files with 36 additions and 17 deletions

View File

@ -22,6 +22,7 @@
*/
$api_url = "https://" . preg_replace('/^nextcloud\./', 'api.', $_SERVER['HTTP_HOST']);
$avatar_url = "https://" . preg_replace('/^nextcloud\./', 'sso.', $_SERVER['HTTP_HOST']) . "/auth/realms/master/avatar-provider";
$profile_url = "https://" . preg_replace('/^nextcloud\./', 'sso.', $_SERVER['HTTP_HOST']) . "/auth/realms/master/account";
// Remove user menu Settings item for non-administrator users
if(!array_key_exists('core_apps', $_["settingsnavigation"])){
@ -67,16 +68,25 @@
.newFileMenu > ul:nth-child(1) > li:nth-child(3) {
order: 1;
}
#header .header-right > div > .menu.settings-menu > ul li.onlytext {
display: inline-flex;
align-items: center;
height: 44px;
color: var(--color-main-text);
padding: 10px 35px;
box-sizing: border-box;
white-space: nowrap;
#header .header-right>div>.menu:after {
display:none;
}
.ddicon {
position: relative;
width: 100%;
left: 8px;
top: 9px;
}
.ddiconcontainer {
margin-right: 16px;
width: 36px;
height: 36px;
background-color: #f0f0f0;
position: relative;
border-radius: 5px;
left: -7px;
}
#expanddiv {
padding: .5rem .7rem;
}
</style>
</head>
@ -134,16 +144,25 @@
<nav class="settings-menu" id="expanddiv" style="display:none;"
aria-label="<?php p($l->t('Settings menu'));?>">
<ul>
<li class="onlytext"><?php p($_['user_displayname']); ?></li>
<?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']) ?>
<li>
<a target="_blank" href="<?php p($profile_url)?>">
<div class="ddiconcontainer">
<i class="icon fa fa-user fa-fw ddicon"></i>
</div>
<?php p($_['user_displayname']); ?>
</a>
</li>
<?php foreach ($_['settingsnavigation'] as $entry):?>
<?php if ($entry['id'] == 'logout') { ?>
<li data-id="<?php p($entry['id']); ?>">
<a href="<?php print_unescaped($entry['href']); ?>">
<div class="ddiconcontainer">
<i class="icon fa fa-sign-out fa-fw ddicon" aria-hidden="true"></i> </div>
<?php p($entry['name']) ?>
</a>
</li>
<?php endforeach; ?>
<?php } ?>
<?php endforeach; ?>
</ul>
</nav>
</div>