From 3cd44750cb8b833f4bd1ff3802cd92cb263cb02b Mon Sep 17 00:00:00 2001 From: nathangray Date: Mon, 13 Feb 2017 08:53:29 -0700 Subject: [PATCH] Replace deprecated $response->script() call with $response->apply(), fixes file select window not closing in FF when opened through wiki --- .../inc/class.filemanager_select.inc.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/filemanager/inc/class.filemanager_select.inc.php b/filemanager/inc/class.filemanager_select.inc.php index 463c1d6b83..fc84a91ac2 100644 --- a/filemanager/inc/class.filemanager_select.inc.php +++ b/filemanager/inc/class.filemanager_select.inc.php @@ -194,12 +194,16 @@ class filemanager_select { $download_url = Vfs::download_url(Vfs::concat($content['path'],$content['name'])); if ($download_url[0] == '/') $download_url = Egw::link($download_url); - $js = "window.opener.CKEDITOR.tools.callFunction(". - $content['ckeditorfuncnum'].",'". - str_replace("'", "\\'", $download_url)."',". - "'');\negw(window).close();"; + + $response = Api\Json\Response::get(); + $response->apply('window.opener.CKEDITOR.tools.callFunction', array( + $content['ckeditorfuncnum'], + str_replace("'", "\\'", $download_url) + )); + Framework::window_close(); + exit(); } - if(Api\Json\Response::isJSONResponse() && !($content['method'] == 'ckeditor_return')) + if(Api\Json\Response::isJSONResponse()) { $response = Api\Json\Response::get(); if($js) @@ -208,7 +212,8 @@ class filemanager_select } // Ahh! // The vfs-select widget looks for this - $response->script('this.selected_files = '.json_encode($files) . '; egw(this).close();'); + $response->script('this.selected_files = '.json_encode($files) . ';'); + Framework::window_close(); } else {