<header class="navbar navbar-default pjMlHead">
	<button class="navbar-toggle collapsed pjMlNavTrigger" data-toggle="collapse" data-target="#pjMlNavCollapsible" aria-expanded="false">
		<span class="sr-only">Toggle navigation</span>
		<span class="icon-bar"></span>
		<span class="icon-bar"></span>
		<span class="icon-bar"></span>
	</button>
	<nav class="collapse navbar-collapse pull-left pjMlNav pjMlNavCollapsible" id="pjMlNavCollapsible">
		<ul class="nav navbar-nav">
			<?php
			if (@$_GET['controller'] == 'pjLoad' && @$_GET['action'] == 'pjActionView')
			{
				$back = $_SERVER['PHP_SELF'] .'?controller=pjLoad&amp;action=pjActionIndex'. (isset($_GET['iframe']) ? '&amp;iframe' : NULL);
				?>
				<li><a href="<?php echo $back; ?>"><i class="fa fa-angle-double-left"></i>&nbsp;<?php __('front_menu_back');?></a></li>
				<?php
			} 
			?>
			<li<?php echo isset($_GET['action']) ? (in_array($_GET['action'], array('pjActionIndex')) ? ' class="active"' : NULL) : ' class="active"';?>><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjLoad&amp;action=pjActionIndex"><?php __('front_menu_members');?></a></li>
			<li<?php echo isset($_GET['action']) ? (in_array($_GET['action'], array('pjActionSearch')) ? ' class="active"' : NULL) : NULL;?>><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjLoad&amp;action=pjActionSearch"><?php __('front_menu_search_page');?></a></li>
			<?php
			if($controller->checkLogin())
			{
				?>
				<li<?php echo isset($_GET['action']) ? (in_array($_GET['action'], array('pjActionProfile')) ? ' class="active"' : NULL) : NULL;?>><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjLoad&amp;action=pjActionProfile"><?php __('front_menu_profile');?></a></li>
				<li><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjLoad&amp;action=pjActionLogout"><?php __('front_menu_logout');?></a></li>
				<?php
			} else {
				?>
				<li<?php echo isset($_GET['action']) ? (in_array($_GET['action'], array('pjActionRegister')) ? ' class="active"' : NULL) : NULL;?>><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjLoad&amp;action=pjActionRegister"><?php __('front_menu_register');?></a></li>
				<?php
			} 
			?>
		</ul><!-- /.nav navbar-nav -->
	</nav><!-- /#pjMlNavCollapsible.collapse navbar-collapse pull-left pjMlNav pjMlNavCollapsible -->
	<?php
	if (isset($tpl['locale_arr']))
	{ 
		if (count($tpl['locale_arr']) > 1 && (int) $tpl['option_arr']['o_multi_lang'] === 1 )
		{
			$locale_id = $controller->pjActionGetLocale();
			$selected_lang = '';
			foreach ($tpl['locale_arr'] as $locale)
			{
				if($locale_id == $locale['id'])
				{
					$selected_lang = pjSanitize::html($locale['title']);
				}
			}
			?>
			<div class="btn-group pull-right pjMlNav pjMlNavLang">
				<button type="button" class="btn btn-default dropdown-toggle pjMlNavLangTrigger" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
					<?php echo $selected_lang;?> <span class="caret"></span>
				</button>
									
				<ul class="dropdown-menu pjMlNavLangDropdown">
					<?php
					foreach ($tpl['locale_arr'] as $locale)
					{
						?><li><a href="<?php echo $_SERVER['SCRIPT_NAME']; ?>?controller=pjLoad&amp;action=pjActionSetLocale&amp;locale=<?php echo $locale['id']; ?><?php echo isset($_GET['iframe']) ? '&amp;iframe' : NULL; ?>"><?php echo pjSanitize::html($locale['title']);?></a></li><?php
					} 
					?>
				</ul><!-- /.dropdown-menu pjMlNavLangDropdown -->
			</div><!-- /.btn-group pull-right pjMlNav pjMlNavLang -->
			<?php
		}
	} 
	?>
</header><!-- /.navbar navbar-default pjMlHead -->