mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 16:03:47 +01:00
allowing stream-wrappers to specify an other mime-type for directories
This commit is contained in:
parent
2248427e48
commit
bd8ba08bc3
@ -152,7 +152,7 @@ class vfs_widget
|
||||
}
|
||||
if (egw_vfs::check_access($path,egw_vfs::READABLE)) // show link only if we have access to the file or dir
|
||||
{
|
||||
if ($n < count($comps)-1 || $mime == egw_vfs::DIR_MIME_TYPE)
|
||||
if ($n < count($comps)-1 || $mime == egw_vfs::DIR_MIME_TYPE || egw_vfs::is_dir($path))
|
||||
{
|
||||
$value['l'.$n] = '/index.php?menuaction=filemanager.filemanager_ui.index&path='.urlencode($path);
|
||||
$target = '';
|
||||
|
@ -595,11 +595,7 @@ class vfs_stream_wrapper implements iface_stream_wrapper
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (is_dir($url))
|
||||
{
|
||||
$mime = self::DIR_MIME_TYPE;
|
||||
}
|
||||
if (!$mime && ($scheme = parse_url($url,PHP_URL_SCHEME)))
|
||||
if (($scheme = parse_url($url,PHP_URL_SCHEME)))
|
||||
{
|
||||
// check it it's an eGW stream wrapper returning mime-type via url_stat
|
||||
if (class_exists($class = self::scheme2class($scheme)) && ($mime_attr = @constant($class.'::STAT_RETURN_MIME_TYPE')))
|
||||
@ -611,6 +607,10 @@ class vfs_stream_wrapper implements iface_stream_wrapper
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$mime && is_dir($url))
|
||||
{
|
||||
$mime = self::DIR_MIME_TYPE;
|
||||
}
|
||||
// if we operate on the regular filesystem and the mime_content_type function is available --> use it
|
||||
if (!$mime && !$scheme && function_exists('mime_content_type'))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user