<?php
if (pjObject::getPlugin('pjOneAdmin') !== NULL && $controller->isAdmin())
{
	$controller->requestAction(array('controller' => 'pjOneAdmin', 'action' => 'pjActionMenu'));
}
?>

<div class="leftmenu-top"></div>
<div class="leftmenu-middle">
	<ul class="menu">
		<li><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjAdmin&amp;action=pjActionIndex" class="<?php echo $_GET['controller'] == 'pjAdmin' && $_GET['action'] == 'pjActionIndex' ? 'menu-focus' : NULL; ?>"><span class="menu-dashboard">&nbsp;</span><?php __('menuDashboard'); ?></a></li>
		<?php
		if ($controller->isAdmin())
		{
			?>
			<li><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjAdminJobs&amp;action=pjActionIndex" class="<?php echo $_GET['controller'] == 'pjAdminJobs' ? 'menu-focus' : NULL; ?>"><span class="menu-jobs">&nbsp;</span><?php __('menuJobs'); ?></a></li>
			<li><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjAdminApplications&amp;action=pjActionIndex" class="<?php echo $_GET['controller'] == 'pjAdminApplications' ? 'menu-focus' : NULL; ?>"><span class="menu-applications">&nbsp;</span><?php __('menuApplications'); ?></a></li>
			<li><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjAdminEmployers&amp;action=pjActionIndex" class="<?php echo $_GET['controller'] == 'pjAdminEmployers' ? 'menu-focus' : NULL; ?>"><span class="menu-employers">&nbsp;</span><?php __('menuEmployers'); ?></a></li>
			<li><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjAdminEmployees&amp;action=pjActionIndex" class="<?php echo $_GET['controller'] == 'pjAdminEmployees' ? 'menu-focus' : NULL; ?>"><span class="menu-employees">&nbsp;</span><?php __('menuEmployees'); ?></a></li>
			<li><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjAdminOptions&amp;action=pjActionIndex" class="<?php echo ($_GET['controller'] == 'pjAdminOptions' && in_array($_GET['action'], array('pjActionIndex', 'pjActionNotifications', 'pjActionSubmissions'))) || in_array($_GET['controller'], array('pjAdminLocales', 'pjBackup', 'pjLocale', 'pjAdminTypes', 'pjAdminCategories', 'pjAdminCountries', 'pjAdminFilters')) ? 'menu-focus' : NULL; ?>"><span class="menu-options">&nbsp;</span><?php __('menuOptions'); ?></a></li>
			<li><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjAdminUsers&amp;action=pjActionIndex" class="<?php echo $_GET['controller'] == 'pjAdminUsers' ? 'menu-focus' : NULL; ?>"><span class="menu-users">&nbsp;</span><?php __('menuUsers'); ?></a></li>
			<li><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjAdminOptions&amp;action=pjActionPreview" class="<?php echo $_GET['controller'] == 'pjAdminOptions' && $_GET['action'] == 'pjActionPreview' ? 'menu-focus' : NULL; ?>"><span class="menu-preview">&nbsp;</span><?php __('menuPreview'); ?></a></li>
			<li><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjAdminOptions&amp;action=pjActionInstall" class="<?php echo $_GET['controller'] == 'pjAdminOptions' && $_GET['action'] == 'pjActionInstall' ? 'menu-focus' : NULL; ?>"><span class="menu-install">&nbsp;</span><?php __('menuInstall'); ?></a></li>
			<?php
		}else if($controller->isEmployer()){
			?>
			<li><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjAdminJobs&amp;action=pjActionIndex" class="<?php echo $_GET['controller'] == 'pjAdminJobs' ? 'menu-focus' : NULL; ?>"><span class="menu-jobs">&nbsp;</span><?php __('menuJobs'); ?></a></li>
			<li><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjAdminApplications&amp;action=pjActionIndex" class="<?php echo $_GET['controller'] == 'pjAdminApplications' ? 'menu-focus' : NULL; ?>"><span class="menu-applications">&nbsp;</span><?php __('menuApplications'); ?></a></li>
			<li><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjAdminEmployers&amp;action=pjActionProfile" class="<?php echo $_GET['controller'] == 'pjAdminEmployers' ? 'menu-focus' : NULL; ?>"><span class="menu-employers">&nbsp;</span><?php __('menuProfile'); ?></a></li>
			<?php
			if(!empty($tpl['option_arr']['o_job_page']))
			{ 
				?><li><a href="<?php echo $tpl['option_arr']['o_job_page']; ?>" target="_blank"><span class="menu-preview">&nbsp;</span><?php __('menuPreview'); ?></a></li><?php 
			}
		}
		?>
		<li><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjAdmin&amp;action=pjActionLogout"><span class="menu-logout">&nbsp;</span><?php __('menuLogout'); ?></a></li>
	</ul>

</div>
<div class="leftmenu-bottom"></div>
<?php
if (isset($tpl['menu_locale_arr']) && !empty($tpl['menu_locale_arr']) && count($tpl['menu_locale_arr']) > 1)
{
	?>
	<div class="locale-nav dropdown-nav">
		<a href="#" class="dropdown-toggle dropdown-closed"><img src="<?php echo PJ_INSTALL_URL; ?>core/framework/libs/pj/img/flags/<?php echo @$tpl['menu_locale_arr'][$controller->getLocaleId()]['file']; ?>" alt="<?php echo pjSanitize::html(@$tpl['menu_locale_arr'][$controller->getLocaleId()]['title']); ?>" /> <?php echo pjSanitize::html(@$tpl['menu_locale_arr'][$controller->getLocaleId()]['title']); ?></a>
		<ul><?php
		foreach ($tpl['menu_locale_arr'] as $locale)
		{
			?><li><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjAdmin&amp;action=pjActionSetLocale&amp;id=<?php echo $locale['id']; ?>"<?php echo $locale['id'] != $controller->getLocaleId() ? NULL : ' class="active"'; ?>><img src="<?php echo PJ_INSTALL_URL . PJ_FRAMEWORK_LIBS_PATH . 'pj/img/flags/' . $locale['file']; ?>" alt="<?php echo pjSanitize::html($locale['title']); ?>" /> <?php echo pjSanitize::html($locale['title']); ?></a></li><?php
		}
		?></ul>
	</div>
	<?php
}
?>