/WebSVN/filedetails.php
118,6 → 118,20
exit;
}
 
// Explicitly requested file as attachment
if (isset($_REQUEST['getfile']))
{
$base = basename($path);
 
header("Content-Type: application/octet-stream");
header("Content-Length: $size");
header("Content-Disposition: inline; filename=".urlencode($base));
 
$svnrep->getFileContents($path, "", $rev);
 
exit;
}
 
// There's no associated MIME type. Show the file using WebSVN.
 
$url = $config->getURL($rep, $path, "file");
143,6 → 157,9
$url = $config->getURL($rep, $path, "blame");
$vars["blamelink"] = "<a href=\"${url}rev=$passrev&amp;sc=$showchanged\">${lang["BLAME"]}</a>";
 
$url = $config->getURL($rep, $path, "get");
$vars["getfile"] = "<a href=\"${url}getfile&amp;rev=$passrev&amp;sc=$showchanged\">${lang["GETFILE"]}</a>";
 
$listing = array ();
 
$vars["version"] = $version;
/WebSVN/languages/czech.inc
121,3 → 121,5
 
// $lang["NOBR"] = "<nobr>";
// $lang["ENDNOBR"] = "</nobr>";
 
$lang["GETFILE"] = "Stáhnout jako soubor";
/WebSVN/languages/english.inc
122,3 → 122,5
 
// $lang["NOBR"] = "<nobr>";
// $lang["ENDNOBR"] = "</nobr>";
 
$lang["GETFILE"] = "Get as a File";
/WebSVN/listing.php
83,6 → 83,35
return $url;
}
 
function fileLinkGetFile($path, $file)
{
global $rep, $passrev, $showchanged, $config;
 
if ($path == "" || $path{0} != "/")
$ppath = "/".$path;
else
$ppath = $path;
 
if ($ppath{strlen($ppath)-1} != "/")
$ppath .= "/";
 
if ($file{0} == "/")
$pfile = substr($file, 1);
else
$pfile = $file;
 
$isDir = $pfile{strlen($pfile) - 1} == "/";
 
if (!$isDir)
{
$url = $config->getURL($rep, $ppath.$pfile, "file");
$url = removeURLSeparator($url);
$url = "<a href=\"${url}&getfile\">Get</a>";
}
 
return $url;
}
 
function showDirFiles($svnrep, $subs, $level, $limit, $rev, $listing, $index, $treeview = true)
{
global $rep, $passrev, $showchanged, $config, $lang;
89,6 → 118,20
 
$path = "";
 
// Explicitly requested file as attachment
if (isset($_REQUEST['getfile']))
{
$base = basename($path);
 
header("Content-Type: application/octet-stream");
header("Content-Length: $size");
header("Content-Disposition: inline; filename=".urlencode($base));
 
$svnrep->getFileContents($path, "", $rev);
 
exit;
}
 
if (!$treeview)
$level = $limit;
 
149,7 → 192,7
if ($access)
{
$listing[$index]["rowparity"] = ($index % 2)?"1":"0";
$listing[$index]["rowparity"] = ($index % 2)?"L1":"L0";
if ($treeview)
$listing[$index]["compare_box"] = "<input type=\"checkbox\" name=\"compare[]\" value=\"".fileLink($path, $file, true)."@$passrev\" onclick=\"checkCB(this)\" />";
161,6 → 204,11
else
$listing[$index]["filelink"] = fileLink($path, $file);
if ($isDir)
$listing[$index]["filelinkgetfile"] = "";
else
$listing[$index]["filelinkgetfile"] = fileLinkGetFile($path, $file);
 
// The history command doesn't return with a trailing slash. We need to remember here if the
// file is a directory or not!
/WebSVN/templates/MLAB/file.tmpl
9,10 → 9,10
[websvn:goyoungestlink]<p>
[websvn-endtest]
[websvn:prevdifflink] - [websvn:blamelink]
[websvn:prevdifflink] - [websvn:blamelink] - [websvn:getfile]
<p>
<table width="100%" border=0><tr><td>
[websvn-getlisting]
</td></tr></table>
[websvn-endtest]
<div style="display:none">{FILE END}</div>
<div style="display:none">{FILE END}</div>