Fix opening linked directories gave error instead of opening in filemanager

This commit is contained in:
Nathan Gray 2015-08-26 17:08:37 +00:00
parent d5e8935dd2
commit 509d47bbce
3 changed files with 13 additions and 1 deletions

View File

@ -182,6 +182,11 @@ class etemplate_widget_link extends etemplate_widget
$link['title'] = egw_vfs::decodePath($link['title']);
$link['icon'] = egw_link::vfs_path($link['app2'],$link['id2'],$link['id'],true);
$link['download_url'] = egw_vfs::download_url($link['icon']);
// Make links to directories load in filemanager
if($link['type'] == 'httpd/unix-directory')
{
$link['target'] = 'filemanager';
}
}
else
{
@ -231,6 +236,7 @@ class etemplate_widget_link extends etemplate_widget
if(!is_array($files)) $files = array($files);
foreach($files as $target) {
error_log(array2string($target));
egw_link::link_file($app, $id, $target);
}
}

View File

@ -272,8 +272,11 @@ class filemanager_hooks
'mime' => array(
egw_vfs::DIR_MIME_TYPE => array(
'menuaction' => 'filemanager.filemanager_ui.index',
'ajax' => 'true',
'mime_id' => 'path',
'mime_target' => '_self',
'mime_target' => 'filemanager',
// Prevent url from changing to webdav
'mime_url' => ''
),
),
'merge' => true,

View File

@ -181,6 +181,9 @@ egw.extend('links', egw.MODULE_GLOBAL, function()
case 'mime_type':
data[mime_info.mime_type] = _type;
break;
case 'mime_id':
data[mime_info.mime_id] = path;
break;
default:
data[attr] = mime_info[attr];
}