<?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>
		<li><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjAdminListings&amp;action=pjActionIndex" class="<?php echo $_GET['controller'] == 'pjAdminListings' ? 'menu-focus' : NULL; ?>"><span class="menu-yachts">&nbsp;</span><?php __('menuYachts'); ?></a></li>
		<li><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjAdminBookings&amp;action=pjActionIndex" class="<?php echo $_GET['controller'] == 'pjAdminBookings' ? 'menu-focus' : NULL; ?>"><span class="menu-reservations">&nbsp;</span><?php __('menuReservations'); ?></a></li>
		<?php
		if ($controller->isAdmin())
		{
			?>
			<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', 'pjActionSubmissions', 'pjActionBooking', 'pjActionBookingForm', 'pjActionNotification'))) || in_array($_GET['controller'], array('pjAdminFeatures', 'pjAdminExtras', 'pjAdminManufacturers', 'pjAdminLocales', 'pjBackup', 'pjLocale', 'pjSms')) ? '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>
			<?php
			if(PJ_IS_WEBSITE == false)
			{ 
				?>
				<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
			}
		}
		if( $controller->isOwner())
		{
			?>
			<li><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjAdminOptions&amp;action=pjActionBooking" class="<?php echo ($_GET['controller'] == 'pjAdminOptions' && in_array($_GET['action'], array('pjActionIndex', 'pjActionSubmissions', 'pjActionBooking', 'pjActionBookingForm', 'pjActionNotification'))) || in_array($_GET['controller'], array('pjAdminFeatures', 'pjAdminExtras', 'pjAdminManufacturers', 'pjAdminLocales', 'pjBackup', 'pjLocale', 'pjSms')) ? 'menu-focus' : NULL; ?>"><span class="menu-options">&nbsp;</span><?php __('menuOptions'); ?></a></li>
			<?php
		}
		if ($controller->isEditor() || $controller->isOwner())
		{
			?>
			<li><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjAdmin&amp;action=pjActionProfile" class="<?php echo ($_GET['controller'] == 'pjAdmin' && $_GET['action'] == 'pjActionProfile') ? 'menu-focus' : NULL; ?>"><span class="menu-users">&nbsp;</span><?php __('menuProfile'); ?></a></li>
			<?php
		}
		if(PJ_IS_WEBSITE == true)
		{
			?>
			<li><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjSubmissions&amp;action=pjActionIndex" class="<?php echo $_GET['controller'] == 'pjContactForm' || $_GET['controller'] == 'pjSubmissions'? 'menu-focus' : NULL; ?>"><span class="menu-forms">&nbsp;</span><?php __('plugin_contactform_menu');?></a></li>
			<li><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjLists&amp;action=pjActionIndex" class="<?php echo in_array($_GET['controller'], array( 'pjLists','pjSubscribers', 'pjMessages', 'pjQueues')) ? 'menu-focus' : NULL; ?>"><span class="menu-newsletters">&nbsp;</span><?php __('plugin_nl_menu');?></a></li>
			<?php 
			if (pjObject::getPlugin('pjWebsiteContent') !== NULL)
			{
				?><li><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjWebsiteContent&amp;action=pjActionIndex" class="<?php echo in_array($_GET['controller'], array('pjWebsiteContent')) ? 'menu-focus' : NULL; ?>"><span class="menu-content">&nbsp;</span><?php __('plugin_wc_menu');?></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>