<nav class="navbar navbar-expand-lg bg-body-tertiary mb-3">
	<div class="container-fluid">
		<span class="navbar-brand text-uppercase">🦎 KOBLOG</span>
		<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      		<span class="navbar-toggler-icon"></span>
		</button>
		<div class="collapse navbar-collapse" id="navbarNav">
			<ul class="navbar-nav me-auto mb-2 mb-lg-0 align-items-center">
				<li class="nav-item d-lg-none">
					<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'dashboard' ?>">
						<?php $L->p('Dashboard') ?></a>
				</li>
				<li class="nav-item">
					<a class="nav-link" target="_blank" href="<?php echo HTML_PATH_ROOT ?>">
						<?php $L->p('Website') ?></a>
				</li>
				<li class="nav-item d-lg-none">
					<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'content' ?>">
						<?php $L->p('Content') ?></a>
				</li>
				<?php if (!checkRole(array('admin'),false)): ?>
				    <li class="nav-item d-lg-none">
					<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'edit-user/'.$login->username() ?>">
					    <?php $L->p('Profile') ?></a>
				    </li>
				<?php endif; ?>
				<?php if (checkRole(array('admin'),false)): ?>
						<li class="nav-item d-lg-none">
							<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'categories' ?>">
								<?php $L->p('Categories') ?></a>
						</li>
						<li class="nav-item d-lg-none">
							<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'users' ?>">
								<?php $L->p('Users') ?></a>
						</li>
						<li class="nav-item d-lg-none">
							<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'settings' ?>">
								<?php $L->p('Settings') ?></a>
						</li>
						<li class="nav-item d-lg-none">
							<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'plugins' ?>">
								<?php $L->p('Plugins') ?></a>
						</li>
						<li class="nav-item d-lg-none">
							<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'themes' ?>">
								<?php $L->p('Themes') ?></a>
						</li>
						<li class="nav-item">
							<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'about' ?>">
								<?php $L->p('About') ?></a>
						</li>
				<?php endif; ?>
				<?php if (checkRole(array('admin'),false)): ?>
				    <?php
				    if (!empty($plugins['adminSidebar'])) {
					foreach ($plugins['adminSidebar'] as $pluginSidebar) {
					    echo '<li class="nav-item d-lg-none">';
					    echo $pluginSidebar->adminSidebar();
					    echo '</li>';
					}
				    }
				    ?>
				<?php endif; ?>
				<li class="nav-item d-lg-none">
					<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'logout' ?>">
						<?php $L->p('Logout') ?></a>
				</li>
			</ul>
			<ul class="navbar-nav mb-2 mb-lg-0 align-items-center d-none d-lg-flex">
				<li class="nav-item mx-1">
					<div class="btn-group dropdown">
						<a class="btn btn-sm btn-outline-primary" href="<?php echo HTML_PATH_ADMIN_ROOT.'new-content' ?>"><span class="fa fa-plus-circle"></span><?php $L->p('New') ?></a>
						<button type="button" class="btn btn-sm btn-outline-primary dropdown-toggle dropdown-toggle-split" data-bs-toggle="dropdown" aria-expanded="false">
							<span class="visually-hidden">Toggle Dropdown</span>
						</button>
						<ul class="dropdown-menu dropdown-menu-end">
							<li>
								<a class="dropdown-item" href="<?php echo HTML_PATH_ADMIN_ROOT.'new-content' ?>">
								<?php $L->p('New content') ?></a>
							</li>
							<li>
								<a class="dropdown-item" href="<?php echo HTML_PATH_ADMIN_ROOT.'new-category' ?>">
								<?php $L->p('New category') ?></a>
							</li>
							<?php if (checkRole(array('admin'),false)): ?>
								<li><hr class="dropdown-divider"></li>
								<li>
									<a class="dropdown-item" href="<?php echo HTML_PATH_ADMIN_ROOT.'new-user' ?>">
									<?php $L->p('New user') ?></a>
								</li>
							<?php endif; ?>
						</ul>
					</div>
				</li>
				<li class="nav-item dropdown ms-1">
				<a class="nav-link dropdown-toggle p-1" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
					<?php echo '<img class="profilePicture me-1" alt="" src="'.(Sanitize::pathFile(PATH_UPLOADS_PROFILES.$login->getUserData()->username().'.png')?DOMAIN_UPLOADS_PROFILES.$login->getUserData()->username().'.png':HTML_PATH_CORE_IMG.'default.svg').'" />'; ?>
					<?php echo $login->getUserData()->displayName(); ?>
				</a>
				<ul class="dropdown-menu dropdown-menu-end">
					<li><a class="dropdown-item" href="<?php echo HTML_PATH_ADMIN_ROOT.'edit-user/'.$login->username() ?>"><?php $L->p('Profile') ?></a></a></li>
					<li><hr class="dropdown-divider"></li>
					<li><a class="dropdown-item" href="<?php echo HTML_PATH_ADMIN_ROOT.'logout' ?>"><?php $L->p('Logout') ?></a></a></li>
				</ul>
				</li>
			</ul>
		</div>
	</div>
</nav>
