diff --git a/js/checkLangPack.js b/js/checkLangPack.js index 0474a8f3d..59856076f 100644 --- a/js/checkLangPack.js +++ b/js/checkLangPack.js @@ -24,27 +24,34 @@ * International Registered Trademark & Property of PrestaShop SA */ -function checkLangPack(){ - $('p#resultCheckLangPack').hide(); +function checkLangPack(token){ if ($('#iso_code').val().length == 2) { - $.ajax( - { - url: "ajax_lang_packs.php", - cache: false, - data: {iso_lang:$('#iso_code').val(), ps_version:$('#ps_version').val()}, - dataType : 'json', - success: function(ret) + doAdminAjax( { - if(typeof ret == 'object') - $('p#resultCheckLangPack').html(langPackOk+' '+ret.name+') :'+'
'+langPackVersion+''+ret.version+' '+download+'
'+langPackInfo).show("slow"); - else if (ret == "offline") - $('p#resultCheckLangPack').show('slow'); + controller:'AdminLanguages', + action:'checkLangPack', + token:token, + ajax:1, + iso_lang:$('#iso_code').val(), + ps_version:$('#ps_version').val() + }, + function(ret) + { + ret = $.parseJSON(ret); + if( ret.status == 'ok') + { + content = $.parseJSON(ret.content); + message = langPackOk + ' '+content['name'] + ') :' + +'
' + langPackVersion + ' ' + content['version'] + + ' '+download+'
' + langPackInfo; + showSuccessMessage(message); + } + else + showErrorMessage(ret.error); } - }); + ); } } -$(document).ready(function() { - $('p#resultCheckLangPack').hide(); -});