diff --git a/filemanager/inc/class.filemanager_ui.inc.php b/filemanager/inc/class.filemanager_ui.inc.php index 7e36be962b..11d56d6235 100644 --- a/filemanager/inc/class.filemanager_ui.inc.php +++ b/filemanager/inc/class.filemanager_ui.inc.php @@ -370,7 +370,7 @@ class filemanager_ui { $sel_options['action']['mail'] = lang('Mail files'); list($width,$height) = explode('x',egw_link::get_registry('felamimail','add_popup')); - $GLOBALS['egw_info']['flags']['java_script'] .= ""; +\n"; } else { @@ -998,7 +998,8 @@ class filemanager_ui } } $js = "opener.egw_refresh('".str_replace("'","\\'",$msg)."','filemanager','". - str_replace("'","\\'",$refresh_path ? $refresh_path : $path)."','edit');"; + str_replace("'","\\'",$refresh_path ? $refresh_path : $path)."','edit',null,/&path=[^&]*/);"; + if ($button == 'save') $js .= "window.close();"; echo "\n\n\n\n\n"; if ($button == 'save') common::egw_exit(); diff --git a/phpgwapi/js/jsapi/jsapi.js b/phpgwapi/js/jsapi/jsapi.js index 2b7f930cca..88a83be06f 100644 --- a/phpgwapi/js/jsapi/jsapi.js +++ b/phpgwapi/js/jsapi/jsapi.js @@ -214,8 +214,10 @@ function egw_getAppName() * @param string|int _id=null id of entry to refresh * @param string _type=null either 'edit', 'delete', 'add' or null * @param string _targetapp which app's window should be refreshed, default current + * @param string|RegExp _replace regular expression to replace in url + * @param string _with */ -function egw_refresh(_msg, _app, _id, _type, _target) +function egw_refresh(_msg, _app, _id, _type, _targetapp, _replace, _with) { //alert("egw_refresh(\'"+_msg+"\',\'"+_app+"\',\'"+_id+"\',\'"+_type+"\')"); var win = typeof _targetapp != 'undefined' ? egw_appWindow(_targetapp) : window; @@ -228,9 +230,14 @@ function egw_refresh(_msg, _app, _id, _type, _target) } var href = win.location.href; + if (typeof _replace != 'undefined') + { + href = href.replace(typeof _replace == 'string' ? new RegExp(_replace) : _replace, typeof _with != 'undefined' ? _with : ''); + } + if (href.indexOf('msg=') != -1) { - href.replace(/msg=[^&]*/,'msg='+encodeURIComponent(_msg)); + href = href.replace(/msg=[^&]*/,'msg='+encodeURIComponent(_msg)); } else if (_msg) {