mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-13 09:28:29 +01:00
additional parameters _replace and _with for egw_refresh to modify the url, fixed not working update of existing msg parameter
This commit is contained in:
parent
e960b79570
commit
ea6b823bd4
@ -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'] .= "<script>
|
||||
$GLOBALS['egw_info']['flags']['java_script'] .= "<script type=\"text/javascript\">
|
||||
function open_mail(attachments)
|
||||
{
|
||||
var link = '".egw::link('/index.php',array('menuaction' => 'felamimail.uicompose.compose'))."';
|
||||
@ -402,7 +402,7 @@ class filemanager_ui
|
||||
selbox.value = '';
|
||||
}
|
||||
}
|
||||
</script>";
|
||||
</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 "<html>\n<body>\n<script>\n$js\n</script>\n</body>\n</html>\n";
|
||||
if ($button == 'save') common::egw_exit();
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user