diff --git a/phpgwapi/js/tinymce/jscripts/tiny_mce/plugins/filemanager/InsertFile/config.inc.php b/phpgwapi/js/tinymce/jscripts/tiny_mce/plugins/filemanager/InsertFile/config.inc.php index 0283851a64..89d8961fba 100644 --- a/phpgwapi/js/tinymce/jscripts/tiny_mce/plugins/filemanager/InsertFile/config.inc.php +++ b/phpgwapi/js/tinymce/jscripts/tiny_mce/plugins/filemanager/InsertFile/config.inc.php @@ -47,12 +47,15 @@ } $sessdata = $GLOBALS['egw']->session->appsession('UploadImage','phpgwapi'); + // upload_dir needs a ending slash + $sessdata['upload_dir'] = substr($sessdata['upload_dir'],-1) == '/' ? $sessdata['upload_dir'] : $sessdata['upload_dir'] . '/'; if(is_writeable($sessdata['upload_dir'])) { $MY_DOCUMENT_ROOT = $BASE_DIR = $sessdata['upload_dir']; if (isset($sessdata['upload_url']) && !empty($sessdata['upload_url'])) { - $MY_BASE_URL = $sessdata['upload_url']; + // base url must not have a ending slash + $MY_BASE_URL = substr($sessdata['upload_url'],-1) == '/' ? substr($sessdata['upload_url'],0,-1) : $sessdata['upload_url']; } else { diff --git a/phpgwapi/js/tinymce/jscripts/tiny_mce/plugins/filemanager/InsertFile/files.php b/phpgwapi/js/tinymce/jscripts/tiny_mce/plugins/filemanager/InsertFile/files.php index eafa1bafd5..6f7bcbe69b 100644 --- a/phpgwapi/js/tinymce/jscripts/tiny_mce/plugins/filemanager/InsertFile/files.php +++ b/phpgwapi/js/tinymce/jscripts/tiny_mce/plugins/filemanager/InsertFile/files.php @@ -502,7 +502,7 @@ $view = new $classname; $params['time'] = $time = filemtime($absolutePath); $params['parsed_size'] = $parsed_size = parse_size($size); $params['parsed_time'] = $parsed_time = parse_time($time); - $params['parsed_icon'] = $parsed_icon = 'img/ext/'.parse_icon($ext); + $params['parsed_icon'] = $parsed_icon = $GLOBALS['egw_info']['server']['webserver_url']. '/phpgwapi/templates/default/images/mime/'. parse_icon($ext); $params['fileNb'] = $fileNb; $files_body .= $view->files_item($params); $fileJSArray .= "['".$parsed_icon."', '".sanitize2($entry)."', '".$parsed_size."', '".$parsed_time."', '".$ext."'],\n"; diff --git a/phpgwapi/js/tinymce/jscripts/tiny_mce/plugins/filemanager/InsertFile/insert_file.php b/phpgwapi/js/tinymce/jscripts/tiny_mce/plugins/filemanager/InsertFile/insert_file.php index dd2dfdbc66..1bc2ca07cb 100644 --- a/phpgwapi/js/tinymce/jscripts/tiny_mce/plugins/filemanager/InsertFile/insert_file.php +++ b/phpgwapi/js/tinymce/jscripts/tiny_mce/plugins/filemanager/InsertFile/insert_file.php @@ -93,7 +93,7 @@ function onOK() { if(fileItems != 1) { var strId = fileItems[i].getAttribute("id").toString(); var trId = parseInt(strId.substring(1, strId.length)); - param['f_icon'] = editor_url+plugin_url+fileManager.fileJSArray[trId][0]; + param['f_icon'] = fileManager.fileJSArray[trId][0]; param['f_size'] = fileManager.fileJSArray[trId][2]; param['f_date'] = fileManager.fileJSArray[trId][3]; }