Replace deprecated $response->script() call with $response->apply(), fixes file select window not closing in FF when opened through wiki

This commit is contained in:
nathangray 2017-02-13 08:53:29 -07:00
parent d6240a2410
commit a10d4a2931

View File

@ -194,12 +194,16 @@ class filemanager_select
{ {
$download_url = Vfs::download_url(Vfs::concat($content['path'],$content['name'])); $download_url = Vfs::download_url(Vfs::concat($content['path'],$content['name']));
if ($download_url[0] == '/') $download_url = Egw::link($download_url); if ($download_url[0] == '/') $download_url = Egw::link($download_url);
$js = "window.opener.CKEDITOR.tools.callFunction(".
$content['ckeditorfuncnum'].",'". $response = Api\Json\Response::get();
str_replace("'", "\\'", $download_url)."',". $response->apply('window.opener.CKEDITOR.tools.callFunction', array(
"'');\negw(window).close();"; $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(); $response = Api\Json\Response::get();
if($js) if($js)
@ -208,7 +212,8 @@ class filemanager_select
} }
// Ahh! // Ahh!
// The vfs-select widget looks for this // 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 else
{ {