mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-27 00:58:55 +01:00
Correct MIME-type when viewing, add option for viewing files with unknown MIME-type as text/plain
This commit is contained in:
parent
fa69a38255
commit
4b94acadaa
@ -14,6 +14,7 @@ $pref->change ("phpwebhosting", "modifiedby_id", "True");
|
|||||||
$pref->change ("phpwebhosting", "comment", "True");
|
$pref->change ("phpwebhosting", "comment", "True");
|
||||||
//$pref->change ("phpwebhosting", "viewinnewwin", "False");
|
//$pref->change ("phpwebhosting", "viewinnewwin", "False");
|
||||||
//$pref->change ("phpwebhosting", "viewonserver", "False");
|
//$pref->change ("phpwebhosting", "viewonserver", "False");
|
||||||
|
$pref->change ("phpwebhosting", "viewtextplain", True);
|
||||||
//$pref->change ("phpwebhosting", "dotdot", "False");
|
//$pref->change ("phpwebhosting", "dotdot", "False");
|
||||||
//$pref->change ("phpwebhosting", "dotfiles", "False");
|
//$pref->change ("phpwebhosting", "dotfiles", "False");
|
||||||
|
|
||||||
|
@ -247,6 +247,18 @@ if ($download)
|
|||||||
|
|
||||||
if ($op == "view" && $file)
|
if ($op == "view" && $file)
|
||||||
{
|
{
|
||||||
|
$ls_array = $phpgw->vfs->ls ($file, array (RELATIVE_ALL), False, False, True);
|
||||||
|
|
||||||
|
if ($ls_array[0]["mime_type"])
|
||||||
|
{
|
||||||
|
$mime_type = $ls_array[0]["mime_type"];
|
||||||
|
}
|
||||||
|
elseif ($settings["viewtextplain"])
|
||||||
|
{
|
||||||
|
$mime_type = "text/plain";
|
||||||
|
}
|
||||||
|
|
||||||
|
header('Content-type: ' . $mime_type);
|
||||||
echo $phpgw->vfs->read ($file);
|
echo $phpgw->vfs->read ($file);
|
||||||
$phpgw->common->phpgw_exit ();
|
$phpgw->common->phpgw_exit ();
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
/*
|
/*
|
||||||
To add a preference, just add it here. Key is internal name, value is displayed name
|
To add a preference, just add it here. Key is internal name, value is displayed name
|
||||||
*/
|
*/
|
||||||
$other_checkboxes = array ("viewinnewwin" => "View documents in new window", "viewonserver" => "View documents on server (if available)", "dotdot" => "Show ..", "dotfiles" => "Show .files");
|
$other_checkboxes = array ("viewinnewwin" => "View documents in new window", "viewonserver" => "View documents on server (if available)", "viewtextplain" => "Unknown MIME-type defaults to text/plain when viewing", "dotdot" => "Show ..", "dotfiles" => "Show .files");
|
||||||
|
|
||||||
if ($submit)
|
if ($submit)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user