<?php global $language ; if ($path = variable_get('languageicons_path', drupal_get_path('module', 'languageicons') . '/flags/*.png')) { $title = $language->name; // Build up $image for theme_image() consumption. $image = array( 'path' => str_replace('*', $language->language, check_plain($path)), 'alt' => $title, 'title' => $title, 'attributes' => array( 'class' => array('language-icon'), ), ); if ($size = check_plain(variable_get('languageicons_size', '16x12'))) { list($width, $height) = explode('x', $size); $image += array('width' => $width, 'height' => $height); } print "<a href='#' class='has-anchor-link ripple'>".theme('image', $image)."</a><div class='no-anchor-link'>".theme('image', $image)."<span class='language-title'>".$language->native."</span></div>"; } ?>
<style> .flag-well { background-color: #f5f5f5; border: 1px solid #e3e3e3; border-radius: 4px; } #block-locale-language { position: absolute; right: -25px; top: 35px; padding: 5px 0; visibility: hidden; } #block-locale-language ul { padding: 0; margin: 0 0 0 1em; width: 100px; } #block-locale-language ul li { list-style: none; display: inline-block; } #block-locale-language ul li a{ color: black; } #block-locale-language.opened { visibility: visible; } #block-locale-language.closed { visibility: visible; } #language-setting-block .no-anchor-link { display: none; } #language-setting-block img { width: 25px; margin-right: 10px; opacity: 0.5; filter: alpha(opacity=50); } #language-setting-block img:hover { opacity: 1.0; filter: alpha(opacity=100); } </style>
<script> jQuery(document).ready( function($) { $('#language-setting-block a').on('click',function(e){ var dropdown = $('#block-locale-language'); e.preventDefault(); if(dropdown.hasClass('opened')){ dropdown.removeClass('opened').addClass('closed'); setTimeout(function(){ dropdown.removeClass('closed') },500); }else{ dropdown.addClass('opened'); } }); } ); </script>