allowing stream-wrappers to specify an other mime-type for directories

This commit is contained in:
Ralf Becker 2009-04-08 09:54:13 +00:00
parent 2248427e48
commit bd8ba08bc3
2 changed files with 6 additions and 6 deletions

View File

@ -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 = '';

View File

@ -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'))
{