From dd3f0031b630bda1b9eb76ef9a1a97f661795285 Mon Sep 17 00:00:00 2001 From: fSerny Date: Tue, 10 Jan 2012 16:55:14 +0000 Subject: [PATCH] [-] BO : Modules list automatic refresh when BO connect to Addons - Bug fixed #PSTEST-367 git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12324 b9a71923-0436-4b27-9f14-aed3839534dd --- admin-dev/themes/default/template/controllers/modules/js.tpl | 4 +++- controllers/admin/AdminModulesController.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/admin-dev/themes/default/template/controllers/modules/js.tpl b/admin-dev/themes/default/template/controllers/modules/js.tpl index 1b8c7eac1..2908d0081 100644 --- a/admin-dev/themes/default/template/controllers/modules/js.tpl +++ b/admin-dev/themes/default/template/controllers/modules/js.tpl @@ -170,9 +170,11 @@ controller : "AdminModules", action : "refreshModuleList" }, - success : function(res,textStatus,jqXHR) + success : function(data) { // res.status = cache or refresh + if (data == '{"status":"refresh"}') + window.location.href = window.location.href; }, error: function(res,textStatus,jqXHR) { diff --git a/controllers/admin/AdminModulesController.php b/controllers/admin/AdminModulesController.php index cf2bb42eb..036a640fe 100644 --- a/controllers/admin/AdminModulesController.php +++ b/controllers/admin/AdminModulesController.php @@ -142,7 +142,7 @@ class AdminModulesControllerCore extends AdminController public function isFresh($file, $timeout = 604800000) { if (file_exists(_PS_ROOT_DIR_.$file)) - return ((time() - filemtime(_PS_ROOT_DIR_.$this->cache_file_modules_list)) < $timeout); + return ((time() - filemtime(_PS_ROOT_DIR_.$file)) < $timeout); else return false; }