Prestashop: display "Choose language" inline in admin -
i wanna simplify life , display language flags inline next input fields in admin panel. example:
i tried override
abstract class modulecore { public function displayflags() }
but no effect.
then modify admin\themes\default\template\helpers\options\options.tpl
to:
<div class="displayed_flag"> {foreach $languages $language} <img src="../img/l/{$language.id_lang}.jpg" class="pointer" alt="{$language.name}" title="{$language.name}" onclick="changelanguage('{$key}', '{if isset($custom_key)}{$custom_key}{else}{$key}{/if}', {$language.id_lang}, '{$language.iso_code}');" /> {/foreach} </div>
but still nothing.
of course deleted class_index.php
, clear cache etc...
i using prestashop 1.5.5 , default theme.
you're searching displayflags
function inside /js/admin.js
file.
here works on installation changes:
function displayflags(languages, defaultlanguageid, employee_cookie) { if ($('.translatable')) { $('.translatable').each(function() { if (!$(this).find('.displayed_flag').length > 0) { $.each(languages, function(key, language) { if (language['id_lang'] == defaultlanguageid) { defaultlanguage = language; return false; } }); var displayflags = $('<div></div>') .addclass('displayed_flag'); $.each(languages, function(key, language) { var img = $('<img>') .addclass('pointer') .css('margin', '0 2px') .attr('src', '../img/l/' + language['id_lang'] + '.jpg') .attr('alt', language['name']) .click(function() { changeformlanguage(language['id_lang'], language['iso_code'], employee_cookie); }); displayflags.append(img); }); if ($(this).find('p:last-child').hasclass('clear')) $(this).find('p:last-child').before(displayflags); else $(this).append(displayflags); } }); } }
Comments
Post a Comment