From fe5c848e99896af072c1237a92b994418cc99869 Mon Sep 17 00:00:00 2001 From: mMarinetti Date: Fri, 30 Dec 2011 16:06:04 +0000 Subject: [PATCH] // fix admin Language (javascript check lang for iso) --- js/checkLangPack.js | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) 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(); -});