<?php
/**
 * @var $icon
 * @var $languages_arr
 */
?>

<div class="dropdown-menu dropdown-menu-small wpj-language-switcher js-dropdown-menu">

	<div class="trigger-text js-dropdown-menu-trigger uppercase"><i class="<?php echo $icon; ?> icon trigger-icon"></i><?php echo $current_language; ?></div>

	<div class="dropdown-menu-list">

		<?php foreach ( $languages_arr as $language ) {

			$code = $language['code'];
			if ( $language['code'] == 'en' ) $code = 'us';
			if ( $language['code'] == 'ar' ) $code = 'ae'; ?>

			<a href="<?php echo $language['url']; ?>" class="item <?php echo $language == $current_language ? 'active selected' : ''; ?>" title="<?php echo $language['name']; ?>">

				<i class="<?php echo $code; ?> flag"></i>

				<?php echo $language['name']; ?>

			</a>

		<?php } ?>

	</div>

</div>