From ca2935a8dd10b7a0080e73b2ad2fde23b9e95f8f 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 --- 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; }