From bd941f3601631cb271f3a1423875489b7d2fff6e Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 19 Feb 2014 15:08:38 +0000 Subject: [PATCH] allow to send a redirect from server-side via client-side egw.link_handler(url, app) allowing to specify which tab to use and a top-level (ajax=true) url --- phpgwapi/js/jsapi/egw.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/phpgwapi/js/jsapi/egw.js b/phpgwapi/js/jsapi/egw.js index 5380125fca..30b61eefaa 100644 --- a/phpgwapi/js/jsapi/egw.js +++ b/phpgwapi/js/jsapi/egw.js @@ -116,6 +116,21 @@ } } + // call egw.link_handler, if attr specified + var egw_redirect = egw_script.getAttribute('data-egw-redirect'); + if (egw_redirect) + { + // set sidebox for tabed templates, we need to set it now, as framework will not resent it! + var sidebox = egw_script.getAttribute('data-setSidebox'); + if (window.framework && sidebox) + { + window.framework.setSidebox.apply(window.framework, JSON.parse(sidebox)); + } + egw_redirect = JSON.parse(egw_redirect); + egw.link_handler.apply(egw, egw_redirect); + return; // do NOT execute any further code, as IE(11) will give errors because framework already redirects + } + // call egw_refresh on opener, if attr specified var refresh_opener = egw_script.getAttribute('data-refresh-opener'); if (refresh_opener && window.opener)