{*
 **********************************************************
 * Developed by: Team Theme Metro
 * Website: http://www.thememetro.com
 **********************************************************
*}

{if $themesettings.headersetting.enablepreheader == ''}

{if $themesettings.orderform.orderopc != '1'}
	{if $templatefile != 'order'}
		<li class="dropdown nocaret d-none-280 mr-1">
			<a href="{$WEB_ROOT}/cart.php?a=view" class="dropdown-toggle">
				<i class="fal fa-shopping-cart"></i> {if $cartitemcount > 0}<span class="badge badge-primary">{$cartitemcount}</span>{/if}
			</a>
		</li>	
	{/if}
{/if}

{if $loggedin}
	{if count($clientAlerts) > 0}
	<li class="dropdown nocaret mr-1">
		<a href="#" class="dropdown-toggle" data-toggle="dropdown">
			<i class="fal fa-bell"></i>  <span class="badge badge-primary">{$clientAlerts|count}</span>
		</a>		
		<ul class="dropdown-menu dropdown-menu-right dropdown-scroll dropdown-tasks auto">
			<li class="dropdown-header">
				<i class="fal fa-info-circle"></i> ({$clientAlerts|count}) {$LANG.notifications}
			</li>
			<li id="taskScroll">
				<ul class="list-unstyled">
					{foreach $clientAlerts as $alert}
					<li>
						<a href="{$alert->getLink()}"><i class="fas fa-fw fa-{if $alert->getSeverity() == 'danger'}exclamation-circle{elseif $alert->getSeverity() == 'warning'}exclamation-triangle{elseif $alert->getSeverity() == 'info'}info-circle{else}check-circle{/if} text-{$alert->getSeverity()}"></i> {$alert->getMessage()} {if $alert->getLinkText()}<button href="{$alert->getLink()}" class="btn btn-xs btn-{$alert->getSeverity()}">{$alert->getLinkText()}</button>{/if}</a>
					</li>
					{foreachelse}
					<li>
						<a href="javascript:;">{lang key='notificationsnone'}</a>
					</li>
					{/foreach}
				</ul>
			</li>
		</ul>
	</li>
	{/if}
	{if $languagechangeenabled && count($locales) > 1}
		<li class="lang-btn d-none d-lg-block">
			<button type="button" class="btn bg-transparent" data-toggle="modal" data-target="#modalChooseLanguage">
				{if $languagechangeenabled && count($locales) > 1}
				<span class="d-inline-block align-middle">
					<span class="d-block iti-flag {if $activeLocale.countryCode === '001'}us{else}{$activeLocale.countryCode|lower}{/if}"></span>
				</span>
				{$activeLocale.localisedName}{/if}{if $languagechangeenabled && count($locales) > 1 && $currencies && !$loggedin}&nbsp;|&nbsp;{/if}{if !$loggedin && $currencies}{$activeCurrency.prefix} {$activeCurrency.code}{/if}
			</button>
		</li>
	{/if}
	
{else}

{if !$themesettings.headersetting.accountactionbtn}
	{if $languagechangeenabled && count($locales) > 1 || $currencies}
		<li class="lang-btn d-none d-lg-block">
			<button type="button" class="btn bg-transparent" data-toggle="modal" data-target="#modalChooseLanguage">
				{if $languagechangeenabled && count($locales) > 1}
				<span class="d-inline-block align-middle">
					<span class="d-block iti-flag {if $activeLocale.countryCode === '001'}us{else}{$activeLocale.countryCode|lower}{/if}"></span>
				</span>
				{$activeLocale.localisedName}{/if}{if $languagechangeenabled && count($locales) > 1 && $currencies && !$loggedin}&nbsp;|&nbsp;{/if}{if !$loggedin && $currencies}{$activeCurrency.prefix} {$activeCurrency.code}{/if}
			</button>
		</li>
	{/if}
{/if}

{/if}

{/if}

{if $themesettings.general.themeswitcher}
<li class="dropdown nocaret d-none-280">
	<div class="nav-link" data-toggle="tooltip" data-placement="bottom" data-html="true" data-title="Switch to the <span class='SwicthtoLight{if $themesettings.customcolors.darkmode == '1'} hidden{/if}'>dark</span><span class='SwicthtoDark'>light</span> theme">
		<label class="form-check-label">
			<input class="tswicther cThemeSwitcher" type="checkbox" {if $themesettings.customcolors.darkmode == '1'}checked{/if}>
			<span class="cThemeSwitcher"><i class="fad fa-"></i></span>
		</label>
	</div>
</li>
{/if}

{if $themesettings.headersetting.accountactionbtn && !$loggedin}
    <li class="lang-btn d-none d-lg-block">
		<div class="d-flex">
			{if $registrationEnabled}<a href="{$WEB_ROOT}/register.php" class="btn btn-primary text-white border px-3">{lang key="register"}</a>{/if}
			<a href="{$WEB_ROOT}/login" class="btn btn-primary text-white border px-3">{lang key="login"}</a>
		</div>
    </li>
{else}
{include file="$template/includes/navbar.tpl" navbar=$secondaryNavbar}
{/if}




{if $themesettings.headersetting.enablepreheader == ''}
{if $adminMasqueradingAsClient || $adminLoggedIn}
	<li class="dropdown nocaret d-none d-lg-block">
		<a href="{$WEB_ROOT}/logout.php?returntoadmin=1" class="nav-link dropdown-toggle" data-toggle="tooltip" data-placement="bottom" title="{if $adminMasqueradingAsClient}{$LANG.adminmasqueradingasclient} {$LANG.logoutandreturntoadminarea}{else}{$LANG.adminloggedin} {$LANG.returntoadminarea}{/if}">
			<i class="fal fa-sign-out-alt"></i>
		</a>
	</li>
{/if}
{/if}
