From 5a950ae8dcb67fcb97bbb5ad534c27262ec29335 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 9 Sep 2015 23:57:07 +0000 Subject: [PATCH] Give some indication that the action is being done for Admin / Clear cache & Wiki / Rebuild links --- admin/inc/class.admin_hooks.inc.php | 13 +++++++++---- admin/js/app.js | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/admin/inc/class.admin_hooks.inc.php b/admin/inc/class.admin_hooks.inc.php index 89ba8a24a4..bedf187916 100644 --- a/admin/inc/class.admin_hooks.inc.php +++ b/admin/inc/class.admin_hooks.inc.php @@ -21,7 +21,7 @@ class admin_hooks * @var unknown_type */ var $public_functions = array( - 'register_all_hooks' => True, + 'ajax_register_all_hooks' => True, ); /** @@ -112,7 +112,12 @@ class admin_hooks if (! $GLOBALS['egw']->acl->check('applications_acc',16,'admin')) { - $file['Clear cache and register hooks'] = egw::link('/index.php','menuaction=admin.admin_hooks.register_all_hooks'); + $file['Clear cache and register hooks'] = array( + 'id' => 'admin/clear_cache', + 'no_lang' => true, + 'link' => "javascript:egw.message('".lang('Clear cache and register hooks') . "
" .lang('Please wait...')."','info'); " . + "egw.json('admin.admin_hooks.ajax_register_all_hooks').sendRequest(true);" + ); } if (! $GLOBALS['egw']->acl->check('asyncservice_acc',1,'admin')) @@ -154,7 +159,7 @@ class admin_hooks /** * Register all hooks */ - function register_all_hooks() + function ajax_register_all_hooks() { if ($GLOBALS['egw']->acl->check('applications_acc',16,'admin')) { @@ -173,7 +178,7 @@ class admin_hooks // allow apps to hook into "Admin >> Clear cache and register hooks" $GLOBALS['egw']->hooks->process('clear_cache', array(), true); - $GLOBALS['egw']->redirect_link('/admin/index.php'); + egw_json_response::get()->apply('egw.message', array(lang('Done'),'success')); } /** diff --git a/admin/js/app.js b/admin/js/app.js index 21897b9b66..5709a92f4e 100644 --- a/admin/js/app.js +++ b/admin/js/app.js @@ -303,7 +303,7 @@ app.classes.admin = AppJS.extend( } else if (link[0] == '/' || link.substr(0,4) == 'http') { - this.load(link+(link.match(/\?/)?'&':'?')+'nonavbar=1'); + this.load(egw.link(link,'nonavbar=1')); } else if (link.substr(0,11) == 'javascript:') {