Line 81... |
Line 81... |
81 |
} |
81 |
} |
82 |
|
82 |
|
83 |
return $url; |
83 |
return $url; |
84 |
} |
84 |
} |
85 |
|
85 |
|
- |
|
86 |
function fileLinkGetFile($path, $file) |
- |
|
87 |
{ |
- |
|
88 |
global $rep, $passrev, $showchanged, $config; |
- |
|
89 |
|
- |
|
90 |
if ($path == "" || $path{0} != "/") |
- |
|
91 |
$ppath = "/".$path; |
- |
|
92 |
else |
- |
|
93 |
$ppath = $path; |
- |
|
94 |
|
- |
|
95 |
if ($ppath{strlen($ppath)-1} != "/") |
- |
|
96 |
$ppath .= "/"; |
- |
|
97 |
|
- |
|
98 |
if ($file{0} == "/") |
- |
|
99 |
$pfile = substr($file, 1); |
- |
|
100 |
else |
- |
|
101 |
$pfile = $file; |
- |
|
102 |
|
- |
|
103 |
$isDir = $pfile{strlen($pfile) - 1} == "/"; |
- |
|
104 |
|
- |
|
105 |
if (!$isDir) |
- |
|
106 |
{ |
- |
|
107 |
$url = $config->getURL($rep, $ppath.$pfile, "file"); |
- |
|
108 |
$url = removeURLSeparator($url); |
- |
|
109 |
$url = "<a href=\"${url}&getfile\">Get</a>"; |
- |
|
110 |
} |
- |
|
111 |
|
- |
|
112 |
return $url; |
- |
|
113 |
} |
- |
|
114 |
|
86 |
function showDirFiles($svnrep, $subs, $level, $limit, $rev, $listing, $index, $treeview = true) |
115 |
function showDirFiles($svnrep, $subs, $level, $limit, $rev, $listing, $index, $treeview = true) |
87 |
{ |
116 |
{ |
88 |
global $rep, $passrev, $showchanged, $config, $lang; |
117 |
global $rep, $passrev, $showchanged, $config, $lang; |
89 |
|
118 |
|
90 |
$path = ""; |
119 |
$path = ""; |
91 |
|
120 |
|
- |
|
121 |
// Explicitly requested file as attachment |
- |
|
122 |
if (isset($_REQUEST['getfile'])) |
- |
|
123 |
{ |
- |
|
124 |
$base = basename($path); |
- |
|
125 |
|
- |
|
126 |
header("Content-Type: application/octet-stream"); |
- |
|
127 |
header("Content-Length: $size"); |
- |
|
128 |
header("Content-Disposition: inline; filename=".urlencode($base)); |
- |
|
129 |
|
- |
|
130 |
$svnrep->getFileContents($path, "", $rev); |
- |
|
131 |
|
- |
|
132 |
exit; |
- |
|
133 |
} |
- |
|
134 |
|
92 |
if (!$treeview) |
135 |
if (!$treeview) |
93 |
$level = $limit; |
136 |
$level = $limit; |
94 |
|
137 |
|
95 |
for ($n = 0; $n <= $level; $n++) |
138 |
for ($n = 0; $n <= $level; $n++) |
96 |
{ |
139 |
{ |
Line 147... |
Line 190... |
147 |
} |
190 |
} |
148 |
} |
191 |
} |
149 |
|
192 |
|
150 |
if ($access) |
193 |
if ($access) |
151 |
{ |
194 |
{ |
152 |
$listing[$index]["rowparity"] = ($index % 2)?"1":"0"; |
195 |
$listing[$index]["rowparity"] = ($index % 2)?"L1":"L0"; |
153 |
|
196 |
|
154 |
if ($treeview) |
197 |
if ($treeview) |
155 |
$listing[$index]["compare_box"] = "<input type=\"checkbox\" name=\"compare[]\" value=\"".fileLink($path, $file, true)."@$passrev\" onclick=\"checkCB(this)\" />"; |
198 |
$listing[$index]["compare_box"] = "<input type=\"checkbox\" name=\"compare[]\" value=\"".fileLink($path, $file, true)."@$passrev\" onclick=\"checkCB(this)\" />"; |
156 |
else |
199 |
else |
157 |
$listing[$index]["compare_box"] = ""; |
200 |
$listing[$index]["compare_box"] = ""; |
Line 159... |
Line 202... |
159 |
if ($openDir) |
202 |
if ($openDir) |
160 |
$listing[$index]["filelink"] = "<b>".fileLink($path, $file)."</b>"; |
203 |
$listing[$index]["filelink"] = "<b>".fileLink($path, $file)."</b>"; |
161 |
else |
204 |
else |
162 |
$listing[$index]["filelink"] = fileLink($path, $file); |
205 |
$listing[$index]["filelink"] = fileLink($path, $file); |
163 |
|
206 |
|
- |
|
207 |
if ($isDir) |
- |
|
208 |
$listing[$index]["filelinkgetfile"] = ""; |
- |
|
209 |
else |
- |
|
210 |
$listing[$index]["filelinkgetfile"] = fileLinkGetFile($path, $file); |
- |
|
211 |
|
164 |
// The history command doesn't return with a trailing slash. We need to remember here if the |
212 |
// The history command doesn't return with a trailing slash. We need to remember here if the |
165 |
// file is a directory or not! |
213 |
// file is a directory or not! |
166 |
|
214 |
|
167 |
$listing[$index]["isDir"] = $isDir; |
215 |
$listing[$index]["isDir"] = $isDir; |
168 |
|
216 |
|