From 2999ca608fb6013d6f30b985f4c0109475f89530 Mon Sep 17 00:00:00 2001 From: fSerny Date: Mon, 21 Nov 2011 21:44:52 +0000 Subject: [PATCH] [*] BO : Admin Modules now works in Ajax :) --- admin-dev/themes/template/modules/js.tpl | 44 ++++++++++++++++++ admin-dev/themes/template/modules/page.tpl | 2 +- classes/Module.php | 4 +- controllers/admin/AdminModulesController.php | 49 +++++++------------- 4 files changed, 64 insertions(+), 35 deletions(-) diff --git a/admin-dev/themes/template/modules/js.tpl b/admin-dev/themes/template/modules/js.tpl index ad8613a0b..0aa9401d5 100644 --- a/admin-dev/themes/template/modules/js.tpl +++ b/admin-dev/themes/template/modules/js.tpl @@ -77,6 +77,50 @@ }); }); + + + + // Method to reload filter in ajax + $(document).ready(function(){ + $('.categoryModuleFilterLink').click(function() + { + $('.categoryModuleFilterLink').css('background-color', 'white'); + $(this).css('background-color', '#EBEDF4'); + var ajaxReloadCurrentIndex = $(this).find('a').attr('href').replace('index.php', 'ajax-tab.php'); + try + { + resAjax = $.ajax({ + type:"POST", + url : ajaxReloadCurrentIndex, + async: true, + data : { + ajax : "1", + token : token, + controller : "AdminModules", + action : "reloadModulesList", + }, + beforeSend: function(xhr) + { + $('#moduleContainer').html(''); + }, + success : function(data) + { + $('#moduleContainer').html(data); + }, + error: function(res,textStatus,jqXHR) + { + //alert("TECHNICAL ERROR"+res); + } + }); + } + catch(e){} + return false; + }); + }); + + + + // Method to get modules_list.xml from prestashop.com and default_country_modules_list.xml from addons.prestashop.com $(document).ready(function(){ try diff --git a/admin-dev/themes/template/modules/page.tpl b/admin-dev/themes/template/modules/page.tpl index 50a9cb26f..dedadc297 100644 --- a/admin-dev/themes/template/modules/page.tpl +++ b/admin-dev/themes/template/modules/page.tpl @@ -55,7 +55,7 @@
{$nb_modules}