<?php
if(isset($_SESSION[$controller->defaultLangMenu]) && $_SESSION[$controller->defaultLangMenu] == 'show')
{
	if (!isset($_GET['locale']) || (int) $_GET['locale'] <= 0)
	{
		if (isset($tpl['locale_arr']) && is_array($tpl['locale_arr']) && !empty($tpl['locale_arr']) && count($tpl['locale_arr']) > 1)
		{
			?>
			<div class="pcLocale">
				<ul class="pcLocaleMenu"><?php
				$locale_id = $controller->pjActionGetLocale();
				foreach ($tpl['locale_arr'] as $locale)
				{
					?><li><a href="#" class="pcSelectorLocale<?php echo $locale_id == $locale['id'] ? ' pcLocaleFocus' : NULL; ?>" data-id="<?php echo $locale['id']; ?>" title="<?php echo pjSanitize::html($locale['title']); ?>"><img src="<?php echo PJ_INSTALL_URL . 'core/framework/libs/pj/img/flags/' . $locale['file'] ?>" alt="<?php echo htmlspecialchars($locale['title']); ?>" /></a></li><?php
				}
				?>
				</ul>
			</div>
			<?php
		}
	}
}
?>