Give some indication that the action is being done for Admin / Clear cache & Wiki / Rebuild links

This commit is contained in:
Nathan Gray 2015-09-09 23:57:07 +00:00
parent b0713a9945
commit 5a950ae8dc
2 changed files with 10 additions and 5 deletions

View File

@ -21,7 +21,7 @@ class admin_hooks
* @var unknown_type * @var unknown_type
*/ */
var $public_functions = array( 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')) 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') . "<br />" .lang('Please wait...')."','info'); " .
"egw.json('admin.admin_hooks.ajax_register_all_hooks').sendRequest(true);"
);
} }
if (! $GLOBALS['egw']->acl->check('asyncservice_acc',1,'admin')) if (! $GLOBALS['egw']->acl->check('asyncservice_acc',1,'admin'))
@ -154,7 +159,7 @@ class admin_hooks
/** /**
* Register all hooks * Register all hooks
*/ */
function register_all_hooks() function ajax_register_all_hooks()
{ {
if ($GLOBALS['egw']->acl->check('applications_acc',16,'admin')) 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" // allow apps to hook into "Admin >> Clear cache and register hooks"
$GLOBALS['egw']->hooks->process('clear_cache', array(), true); $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'));
} }
/** /**

View File

@ -303,7 +303,7 @@ app.classes.admin = AppJS.extend(
} }
else if (link[0] == '/' || link.substr(0,4) == 'http') 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:') else if (link.substr(0,11) == 'javascript:')
{ {