| Line 1... |
Line 1... |
| 1 |
<?php |
1 |
<?php |
| 2 |
# vim:et:ts=3:sts=3:sw=3:fdm=marker: |
2 |
# vim:et:ts=3:sts=3:sw=3:fdm=marker: |
| 3 |
|
3 |
|
| 4 |
// WebSVN - Subversion repository viewing via the web using PHP |
4 |
// WebSVN - Subversion repository viewing via the web using PHP |
| 5 |
// Copyright © 2004-2006 Tim Armes, Matt Sicker |
5 |
// Copyright © 2004-2006 Tim Armes, Matt Sicker |
| 6 |
// |
6 |
// |
| 7 |
// This program is free software; you can redistribute it and/or modify |
7 |
// This program is free software; you can redistribute it and/or modify |
| 8 |
// it under the terms of the GNU General Public License as published by |
8 |
// it under the terms of the GNU General Public License as published by |
| 9 |
// the Free Software Foundation; either version 2 of the License, or |
9 |
// the Free Software Foundation; either version 2 of the License, or |
| 10 |
// (at your option) any later version. |
10 |
// (at your option) any later version. |
| 11 |
// |
11 |
// |
| 12 |
// This program is distributed in the hope that it will be useful, |
12 |
// This program is distributed in the hope that it will be useful, |
| 13 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
// GNU General Public License for more details. |
15 |
// GNU General Public License for more details. |
| 16 |
// |
16 |
// |
| 17 |
// You should have received a copy of the GNU General Public License |
17 |
// You should have received a copy of the GNU General Public License |
| 18 |
// along with this program; if not, write to the Free Software |
18 |
// along with this program; if not, write to the Free Software |
| 19 |
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 |
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 20 |
// |
20 |
// |
| 21 |
// -- |
21 |
// -- |
| 22 |
// |
22 |
// |
| 23 |
// log.php |
23 |
// log.php |
| 24 |
// |
24 |
// |
| 25 |
// Show the logs for the given path |
25 |
// Show the logs for the given path |
| 26 |
|
26 |
|
| 27 |
require_once("include/setup.inc"); |
27 |
require_once("include/setup.inc"); |
| 28 |
require_once("include/svnlook.inc"); |
28 |
require_once("include/svnlook.inc"); |
| 29 |
require_once("include/utils.inc"); |
29 |
require_once("include/utils.inc"); |
| 30 |
require_once("include/template.inc"); |
30 |
require_once("include/template.inc"); |
| 31 |
require_once("include/bugtraq.inc"); |
31 |
require_once("include/bugtraq.inc"); |
| 32 |
|
32 |
|
| 33 |
$page = (int)@$_REQUEST["page"]; |
33 |
$page = (int)@$_REQUEST["page"]; |
| 34 |
$all = (@$_REQUEST["all"] == 1)?1:0; |
34 |
$all = (@$_REQUEST["all"] == 1)?1:0; |
| 35 |
$isDir = (@$_REQUEST["isdir"] == 1)?1:0; |
35 |
$isDir = (@$_REQUEST["isdir"] == 1)?1:0; |
| 36 |
$dosearch = (@$_REQUEST["logsearch"] == 1)?1:0; |
36 |
$dosearch = (@$_REQUEST["logsearch"] == 1)?1:0; |
| 37 |
$search = trim(@$_REQUEST["search"]); |
37 |
$search = trim(@$_REQUEST["search"]); |
| 38 |
$words = preg_split('#\s+#', $search); |
38 |
$words = preg_split('#\s+#', $search); |
| 39 |
$fromRev = (int)@$_REQUEST["fr"]; |
39 |
$fromRev = (int)@$_REQUEST["fr"]; |
| 40 |
$startrev = strtoupper(trim(@$_REQUEST["sr"])); |
40 |
$startrev = strtoupper(trim(@$_REQUEST["sr"])); |
| 41 |
$endrev = strtoupper(trim(@$_REQUEST["er"])); |
41 |
$endrev = strtoupper(trim(@$_REQUEST["er"])); |
| 42 |
$max = @$_REQUEST["max"]; |
42 |
$max = @$_REQUEST["max"]; |
| 43 |
|
43 |
|
| 44 |
// Max number of results to find at a time |
44 |
// Max number of results to find at a time |
| 45 |
$numSearchResults = 15; |
45 |
$numSearchResults = 15; |
| 46 |
|
46 |
|
| 47 |
if ($search == "") |
47 |
if ($search == "") |
| 48 |
$dosearch = false; |
48 |
$dosearch = false; |
| 49 |
|
49 |
|
| 50 |
// removeAccents |
50 |
// removeAccents |
| 51 |
// |
51 |
// |
| 52 |
// Remove all the accents from a string. This function doesn't seem |
52 |
// Remove all the accents from a string. This function doesn't seem |
| 53 |
// ideal, but expecting everyone to install 'unac' seems a little |
53 |
// ideal, but expecting everyone to install 'unac' seems a little |
| 54 |
// excessive as well... |
54 |
// excessive as well... |
| 55 |
|
55 |
|
| 56 |
function removeAccents($string) |
56 |
function removeAccents($string) |
| 57 |
{ |
57 |
{ |
| 58 |
return strtr($string, |
58 |
return strtr($string, |
| 59 |
"ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ", |
59 |
"ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ", |
| 60 |
"AAAAAAaaaaaaOOOOOOooooooEEEEeeeeCcIIIIiiiiUUUUuuuuyNn"); |
60 |
"AAAAAAaaaaaaOOOOOOooooooEEEEeeeeCcIIIIiiiiUUUUuuuuyNn"); |
| 61 |
} |
61 |
} |
| 62 |
|
62 |
|
| 63 |
// Normalise the search words |
63 |
// Normalise the search words |
| 64 |
foreach ($words as $index => $word) |
64 |
foreach ($words as $index => $word) |
| 65 |
{ |
65 |
{ |
| 66 |
$words[$index] = strtolower(removeAccents($word)); |
66 |
$words[$index] = strtolower(removeAccents($word)); |
| 67 |
|
67 |
|
| 68 |
// Remove empty string introduced by multiple spaces |
68 |
// Remove empty string introduced by multiple spaces |
| 69 |
if (empty($words[$index])) |
69 |
if (empty($words[$index])) |
| 70 |
unset($words[$index]); |
70 |
unset($words[$index]); |
| 71 |
} |
71 |
} |
| 72 |
|
72 |
|
| 73 |
if (empty($page)) $page = 1; |
73 |
if (empty($page)) $page = 1; |
| 74 |
|
74 |
|
| 75 |
// If searching, display all the results |
75 |
// If searching, display all the results |
| 76 |
$all = (bool) $dosearch; |
76 |
$all = (bool) $dosearch; |
| 77 |
|
77 |
|
| 78 |
$maxperpage = 20; |
78 |
$maxperpage = 20; |
| 79 |
|
79 |
|
| 80 |
// Make sure that we have a repository |
80 |
// Make sure that we have a repository |
| 81 |
if (!isset($rep)) |
81 |
if (!isset($rep)) |
| 82 |
{ |
82 |
{ |
| 83 |
echo $lang["NOREP"]; |
83 |
echo $lang["NOREP"]; |
| 84 |
exit; |
84 |
exit; |
| 85 |
} |
85 |
} |
| 86 |
|
86 |
|
| 87 |
$svnrep = new SVNRepository($rep); |
87 |
$svnrep = new SVNRepository($rep); |
| 88 |
|
88 |
|
| 89 |
$passrev = $rev; |
89 |
$passrev = $rev; |
| 90 |
|
90 |
|
| 91 |
// If there's no revision info, go to the lastest revision for this path |
91 |
// If there's no revision info, go to the lastest revision for this path |
| 92 |
$history = $svnrep->getLog($path, "", "", true); |
92 |
$history = $svnrep->getLog($path, "", "", true); |
| 93 |
$youngest = $history->entries[0]->rev; |
93 |
$youngest = $history->entries[0]->rev; |
| 94 |
|
94 |
|
| 95 |
if (empty($rev)) |
95 |
if (empty($rev)) |
| 96 |
$rev = $youngest; |
96 |
$rev = $youngest; |
| 97 |
|
97 |
|
| 98 |
// make sure path is prefixed by a / |
98 |
// make sure path is prefixed by a / |
| 99 |
$ppath = $path; |
99 |
$ppath = $path; |
| 100 |
if ($path == "" || $path{0} != "/") |
100 |
if ($path == "" || $path{0} != "/") |
| 101 |
$ppath = "/".$path; |
101 |
$ppath = "/".$path; |
| 102 |
|
102 |
|
| 103 |
$vars["action"] = $lang["LOG"]; |
103 |
$vars["action"] = $lang["LOG"]; |
| 104 |
$vars["repname"] = $rep->getDisplayName(); |
104 |
$vars["repname"] = $rep->getDisplayName(); |
| 105 |
$vars["rev"] = $rev; |
105 |
$vars["rev"] = $rev; |
| 106 |
$vars["path"] = $ppath; |
106 |
$vars["path"] = $ppath; |
| 107 |
|
107 |
|
| 108 |
createDirLinks($rep, $ppath, $passrev, $showchanged); |
108 |
createDirLinks($rep, $ppath, $passrev, $showchanged); |
| 109 |
|
109 |
|
| 110 |
$logurl = $config->getURL($rep, $path, "log"); |
110 |
$logurl = $config->getURL($rep, $path, "log"); |
| 111 |
|
111 |
|
| 112 |
if ($rev != $youngest) |
112 |
if ($rev != $youngest) |
| 113 |
$vars["goyoungestlink"] = "<a href=\"${logurl}sc=1\">${lang["GOYOUNGEST"]}</a>"; |
113 |
$vars["goyoungestlink"] = "<a href=\"${logurl}sc=1\">${lang["GOYOUNGEST"]}</a>"; |
| 114 |
else |
114 |
else |
| 115 |
$vars["goyoungestlink"] = ""; |
115 |
$vars["goyoungestlink"] = ""; |
| 116 |
|
116 |
|
| 117 |
// We get the bugtraq variable just once based on the HEAD |
117 |
// We get the bugtraq variable just once based on the HEAD |
| 118 |
$bugtraq = new Bugtraq($rep, $svnrep, $ppath); |
118 |
$bugtraq = new Bugtraq($rep, $svnrep, $ppath); |
| 119 |
|
119 |
|
| 120 |
if ($startrev != "HEAD") $startrev = (int)$startrev; |
120 |
if ($startrev != "HEAD") $startrev = (int)$startrev; |
| 121 |
if (empty($startrev)) $startrev = $rev; |
121 |
if (empty($startrev)) $startrev = $rev; |
| 122 |
if (empty($endrev)) $endrev = 1; |
122 |
if (empty($endrev)) $endrev = 1; |
| 123 |
|
123 |
|
| 124 |
if (empty($_REQUEST["max"])) |
124 |
if (empty($_REQUEST["max"])) |
| 125 |
{ |
125 |
{ |
| 126 |
if (empty($_REQUEST["logsearch"])) |
126 |
if (empty($_REQUEST["logsearch"])) |
| 127 |
$max = 30; |
127 |
$max = 30; |
| 128 |
else |
128 |
else |
| 129 |
$max = 0; |
129 |
$max = 0; |
| 130 |
} |
130 |
} |
| 131 |
else |
131 |
else |
| 132 |
{ |
132 |
{ |
| 133 |
$max = (int)$max; |
133 |
$max = (int)$max; |
| 134 |
if ($max < 0) $max = 30; |
134 |
if ($max < 0) $max = 30; |
| 135 |
} |
135 |
} |
| 136 |
|
136 |
|
| 137 |
$history = $svnrep->getLog($path, $startrev, $endrev, true, $max); |
137 |
$history = $svnrep->getLog($path, $startrev, $endrev, true, $max); |
| 138 |
$vars["logsearch_moreresultslink"] = ""; |
138 |
$vars["logsearch_moreresultslink"] = ""; |
| 139 |
$vars["pagelinks"] = ""; |
139 |
$vars["pagelinks"] = ""; |
| 140 |
$vars["showalllink"] = ""; |
140 |
$vars["showalllink"] = ""; |
| 141 |
$listing = array(); |
141 |
$listing = array(); |
| 142 |
|
142 |
|
| 143 |
if (!empty($history)) |
143 |
if (!empty($history)) |
| 144 |
{ |
144 |
{ |
| 145 |
// Get the number of separate revisions |
145 |
// Get the number of separate revisions |
| 146 |
$revisions = count($history->entries); |
146 |
$revisions = count($history->entries); |
| 147 |
|
147 |
|
| 148 |
if ($all) |
148 |
if ($all) |
| 149 |
{ |
149 |
{ |
| 150 |
$firstrevindex = 0; |
150 |
$firstrevindex = 0; |
| 151 |
$lastrevindex = $revisions - 1; |
151 |
$lastrevindex = $revisions - 1; |
| 152 |
$pages = 1; |
152 |
$pages = 1; |
| 153 |
} |
153 |
} |
| 154 |
else |
154 |
else |
| 155 |
{ |
155 |
{ |
| 156 |
// Calculate the number of pages |
156 |
// Calculate the number of pages |
| 157 |
$pages = floor($revisions / $maxperpage); |
157 |
$pages = floor($revisions / $maxperpage); |
| 158 |
if (($revisions % $maxperpage) > 0) $pages++; |
158 |
if (($revisions % $maxperpage) > 0) $pages++; |
| 159 |
|
159 |
|
| 160 |
if ($page > $pages) $page = $pages; |
160 |
if ($page > $pages) $page = $pages; |
| 161 |
|
161 |
|
| 162 |
// Word out where to start and stop |
162 |
// Word out where to start and stop |
| 163 |
$firstrevindex = ($page - 1) * $maxperpage; |
163 |
$firstrevindex = ($page - 1) * $maxperpage; |
| 164 |
$lastrevindex = $firstrevindex + $maxperpage - 1; |
164 |
$lastrevindex = $firstrevindex + $maxperpage - 1; |
| 165 |
if ($lastrevindex > $revisions - 1) $lastrevindex = $revisions - 1; |
165 |
if ($lastrevindex > $revisions - 1) $lastrevindex = $revisions - 1; |
| 166 |
} |
166 |
} |
| 167 |
|
167 |
|
| 168 |
$history = $svnrep->getLog($path, $history->entries[$firstrevindex ]->rev, $history->entries[$lastrevindex]->rev, false, 0); |
168 |
$history = $svnrep->getLog($path, $history->entries[$firstrevindex ]->rev, $history->entries[$lastrevindex]->rev, false, 0); |
| 169 |
|
169 |
|
| 170 |
$row = 0; |
170 |
$row = 0; |
| 171 |
$index = 0; |
171 |
$index = 0; |
| 172 |
$listing = array(); |
172 |
$listing = array(); |
| 173 |
$found = false; |
173 |
$found = false; |
| 174 |
|
174 |
|
| 175 |
foreach ($history->entries as $r) |
175 |
foreach ($history->entries as $r) |
| 176 |
{ |
176 |
{ |
| 177 |
// Assume a good match |
177 |
// Assume a good match |
| 178 |
$match = true; |
178 |
$match = true; |
| 179 |
$thisrev = $r->rev; |
179 |
$thisrev = $r->rev; |
| 180 |
|
180 |
|
| 181 |
// Check the log for the search words, if searching |
181 |
// Check the log for the search words, if searching |
| 182 |
if ($dosearch) |
182 |
if ($dosearch) |
| 183 |
{ |
183 |
{ |
| 184 |
if ((empty($fromRev) || $fromRev > $thisrev)) |
184 |
if ((empty($fromRev) || $fromRev > $thisrev)) |
| 185 |
{ |
185 |
{ |
| 186 |
// Turn all the HTML entities into real characters. |
186 |
// Turn all the HTML entities into real characters. |
| 187 |
|
187 |
|
| 188 |
// Make sure that each word in the search in also in the log |
188 |
// Make sure that each word in the search in also in the log |
| 189 |
foreach($words as $word) |
189 |
foreach($words as $word) |
| 190 |
{ |
190 |
{ |
| 191 |
if (strpos(strtolower(removeAccents($r->msg)), $word) === false) |
191 |
if (strpos(strtolower(removeAccents($r->msg)), $word) === false) |
| 192 |
{ |
192 |
{ |
| 193 |
$match = false; |
193 |
$match = false; |
| 194 |
break; |
194 |
break; |
| 195 |
} |
195 |
} |
| 196 |
} |
196 |
} |
| 197 |
|
197 |
|
| 198 |
if ($match) |
198 |
if ($match) |
| 199 |
{ |
199 |
{ |
| 200 |
$numSearchResults--; |
200 |
$numSearchResults--; |
| 201 |
$found = true; |
201 |
$found = true; |
| 202 |
} |
202 |
} |
| 203 |
} |
203 |
} |
| 204 |
else |
204 |
else |
| 205 |
$match = false; |
205 |
$match = false; |
| 206 |
} |
206 |
} |
| 207 |
|
207 |
|
| 208 |
if ($match) |
208 |
if ($match) |
| 209 |
{ |
209 |
{ |
| 210 |
// Add the trailing slash if we need to (svnlook history doesn't return trailing slashes!) |
210 |
// Add the trailing slash if we need to (svnlook history doesn't return trailing slashes!) |
| 211 |
$rpath = $r->path; |
211 |
$rpath = $r->path; |
| 212 |
|
212 |
|
| 213 |
if (empty($rpath)) |
213 |
if (empty($rpath)) |
| 214 |
$rpath = "/"; |
214 |
$rpath = "/"; |
| 215 |
else if ($isDir && $rpath{strlen($rpath) - 1} != "/") |
215 |
else if ($isDir && $rpath{strlen($rpath) - 1} != "/") |
| 216 |
$rpath .= "/"; |
216 |
$rpath .= "/"; |
| 217 |
|
217 |
|
| 218 |
// Find the parent path (or the whole path if it's already a directory) |
218 |
// Find the parent path (or the whole path if it's already a directory) |
| 219 |
$pos = strrpos($rpath, "/"); |
219 |
$pos = strrpos($rpath, "/"); |
| 220 |
$parent = substr($rpath, 0, $pos + 1); |
220 |
$parent = substr($rpath, 0, $pos + 1); |
| 221 |
|
221 |
|
| 222 |
$url = $config->getURL($rep, $parent, "dir"); |
222 |
$url = $config->getURL($rep, $parent, "dir"); |
| 223 |
$listing[$index]["revlink"] = "<a href=\"${url}rev=$thisrev&sc=1\">$thisrev</a>"; |
223 |
$listing[$index]["revlink"] = "<a href=\"${url}rev=$thisrev&sc=1\">$thisrev</a>"; |
| 224 |
|
224 |
|
| 225 |
if ($isDir) |
225 |
if ($isDir) |
| 226 |
{ |
226 |
{ |
| 227 |
$listing[$index]["compare_box"] = "<input type=\"checkbox\" name=\"compare[]\" value=\"$parent@$thisrev\" onclick=\"checkCB(this)\" />"; |
227 |
$listing[$index]["compare_box"] = "<input type=\"checkbox\" name=\"compare[]\" value=\"$parent@$thisrev\" onclick=\"checkCB(this)\" />"; |
| 228 |
$url = $config->getURL($rep, $rpath, "dir"); |
228 |
$url = $config->getURL($rep, $rpath, "dir"); |
| 229 |
$listing[$index]["revpathlink"] = "<a href=\"${url}rev=$thisrev&sc=$showchanged\">$rpath</a>"; |
229 |
$listing[$index]["revpathlink"] = "<a href=\"${url}rev=$thisrev&sc=$showchanged\">$rpath</a>"; |
| 230 |
} |
230 |
} |
| 231 |
else |
231 |
else |
| 232 |
{ |
232 |
{ |
| 233 |
$listing[$index]["compare_box"] = "<input type=\"checkbox\" name=\"compare[]\" value=\"$rpath@$thisrev\" onclick=\"checkCB(this)\" />"; |
233 |
$listing[$index]["compare_box"] = "<input type=\"checkbox\" name=\"compare[]\" value=\"$rpath@$thisrev\" onclick=\"checkCB(this)\" />"; |
| 234 |
$url = $config->getURL($rep, $rpath, "file"); |
234 |
$url = $config->getURL($rep, $rpath, "file"); |
| 235 |
$listing[$index]["revpathlink"] = "<a href=\"${url}rev=$thisrev&sc=$showchanged\">$rpath</a>"; |
235 |
$listing[$index]["revpathlink"] = "<a href=\"${url}rev=$thisrev&sc=$showchanged\">$rpath</a>"; |
| 236 |
} |
236 |
} |
| 237 |
|
237 |
|
| 238 |
$listing[$index]["revauthor"] = $r->author; |
238 |
$listing[$index]["revauthor"] = $r->author; |
| 239 |
$listing[$index]["revage"] = $r->age; |
239 |
$listing[$index]["revage"] = $r->age; |
| 240 |
$listing[$index]["revlog"] = nl2br($bugtraq->replaceIDs(create_anchors($r->msg))); |
240 |
$listing[$index]["revlog"] = nl2br($bugtraq->replaceIDs(create_anchors($r->msg))); |
| 241 |
$listing[$index]["rowparity"] = "$row"; |
241 |
$listing[$index]["rowparity"] = "$row"; |
| 242 |
|
242 |
|
| 243 |
$row = 1 - $row; |
243 |
$row = 1 - $row; |
| 244 |
$index++; |
244 |
$index++; |
| 245 |
} |
245 |
} |
| 246 |
|
246 |
|
| 247 |
// If we've reached the search limit, stop here... |
247 |
// If we've reached the search limit, stop here... |
| 248 |
if (!$numSearchResults) |
248 |
if (!$numSearchResults) |
| 249 |
{ |
249 |
{ |
| 250 |
$url = $config->getURL($rep, $path, "log"); |
250 |
$url = $config->getURL($rep, $path, "log"); |
| 251 |
$vars["logsearch_moreresultslink"] = "<a href=\"${url}rev=$rev&&sc=$showchanged&isdir=$isDir&logsearch=1&search=$search&fr=$thisrev\">${lang["MORERESULTS"]}</a>"; |
251 |
$vars["logsearch_moreresultslink"] = "<a href=\"${url}rev=$rev&sc=$showchanged&isdir=$isDir&logsearch=1&search=$search&fr=$thisrev\">${lang["MORERESULTS"]}</a>"; |
| 252 |
break; |
252 |
break; |
| 253 |
} |
253 |
} |
| 254 |
} |
254 |
} |
| 255 |
|
255 |
|
| 256 |
$vars["logsearch_resultsfound"] = true; |
256 |
$vars["logsearch_resultsfound"] = true; |
| 257 |
|
257 |
|
| 258 |
if ($dosearch && !$found) |
258 |
if ($dosearch && !$found) |
| 259 |
{ |
259 |
{ |
| 260 |
if ($fromRev == 0) |
260 |
if ($fromRev == 0) |
| 261 |
{ |
261 |
{ |
| 262 |
$vars["logsearch_nomatches"] = true; |
262 |
$vars["logsearch_nomatches"] = true; |
| 263 |
$vars["logsearch_resultsfound"] = false; |
263 |
$vars["logsearch_resultsfound"] = false; |
| 264 |
} |
264 |
} |
| 265 |
else |
265 |
else |
| 266 |
$vars["logsearch_nomorematches"] = true; |
266 |
$vars["logsearch_nomorematches"] = true; |
| 267 |
} |
267 |
} |
| 268 |
else if ($dosearch && $numSearchResults > 0) |
268 |
else if ($dosearch && $numSearchResults > 0) |
| 269 |
{ |
269 |
{ |
| 270 |
$vars["logsearch_nomorematches"] = true; |
270 |
$vars["logsearch_nomorematches"] = true; |
| 271 |
} |
271 |
} |
| 272 |
|
272 |
|
| 273 |
// Work out the paging options |
273 |
// Work out the paging options |
| 274 |
|
274 |
|
| 275 |
if ($pages > 1) |
275 |
if ($pages > 1) |
| 276 |
{ |
276 |
{ |
| 277 |
$prev = $page - 1; |
277 |
$prev = $page - 1; |
| 278 |
$next = $page + 1; |
278 |
$next = $page + 1; |
| 279 |
echo "<p><center>"; |
279 |
echo "<p><center>"; |
| 280 |
|
280 |
|
| 281 |
if ($page > 1) $vars["pagelinks"] .= "<a href=\"${logurl}rev=$rev&sr=$startrev&er=$endrev&sc=$showchanged&max=$max&page=$prev\">< ${lang["PREV"]}</a> "; |
281 |
if ($page > 1) $vars["pagelinks"] .= "<a href=\"${logurl}rev=$rev&sr=$startrev&er=$endrev&sc=$showchanged&max=$max&page=$prev\">< ${lang["PREV"]}</a> "; |
| 282 |
for ($p = 1; $p <= $pages; $p++) |
282 |
for ($p = 1; $p <= $pages; $p++) |
| 283 |
{ |
283 |
{ |
| 284 |
if ($p != $page) |
284 |
if ($p != $page) |
| 285 |
$vars["pagelinks"].= "<a href=\"${logurl}rev=$rev&sr=$startrev&er=$endrev&sc=$showchanged&max=$max&page=$p\">$p</a> "; |
285 |
$vars["pagelinks"].= "<a href=\"${logurl}rev=$rev&sr=$startrev&er=$endrev&sc=$showchanged&max=$max&page=$p\">$p</a> "; |
| 286 |
else |
286 |
else |
| 287 |
$vars["pagelinks"] .= "<b>$p </b>"; |
287 |
$vars["pagelinks"] .= "<b>$p </b>"; |
| 288 |
} |
288 |
} |
| 289 |
if ($page < $pages) $vars["pagelinks"] .=" <a href=\"${logurl}rev=$rev&sr=$startrev&er=$endrev&sc=$showchanged&max=$max&page=$next\">${lang["NEXT"]} ></a>"; |
289 |
if ($page < $pages) $vars["pagelinks"] .=" <a href=\"${logurl}rev=$rev&sr=$startrev&er=$endrev&sc=$showchanged&max=$max&page=$next\">${lang["NEXT"]} ></a>"; |
| 290 |
|
290 |
|
| 291 |
$vars["showalllink"] = "<a href=\"${logurl}rev=$rev&sr=$startrev&er=$endrev&sc=$showchanged&all=1&max=$max\">${lang["SHOWALL"]}</a>"; |
291 |
$vars["showalllink"] = "<a href=\"${logurl}rev=$rev&sr=$startrev&er=$endrev&sc=$showchanged&all=1&max=$max\">${lang["SHOWALL"]}</a>"; |
| 292 |
echo "</center>"; |
292 |
echo "</center>"; |
| 293 |
} |
293 |
} |
| 294 |
} |
294 |
} |
| 295 |
|
295 |
|
| 296 |
// Create the project change combo box |
296 |
// Create the project change combo box |
| 297 |
|
297 |
|
| 298 |
$url = $config->getURL($rep, $path, "log"); |
298 |
$url = $config->getURL($rep, $path, "log"); |
| 299 |
# XXX: forms don't have the name attribute, but _everything_ has the id attribute, |
299 |
# XXX: forms don't have the name attribute, but _everything_ has the id attribute, |
| 300 |
# so what you're trying to do (if anything?) should be done via that ~J |
300 |
# so what you're trying to do (if anything?) should be done via that ~J |
| 301 |
$vars["logsearch_form"] = "<form action=\"$url\" method=\"post\" name=\"logsearchform\">"; |
301 |
$vars["logsearch_form"] = "<form action=\"$url\" method=\"post\" name=\"logsearchform\">"; |
| 302 |
|
302 |
|
| 303 |
$vars["logsearch_startbox"] = "<input name=\"sr\" size=\"5\" value=\"$startrev\" />"; |
303 |
$vars["logsearch_startbox"] = "<input name=\"sr\" size=\"5\" value=\"$startrev\" />"; |
| 304 |
$vars["logsearch_endbox" ] = "<input name=\"er\" size=\"5\" value=\"$endrev\" />"; |
304 |
$vars["logsearch_endbox" ] = "<input name=\"er\" size=\"5\" value=\"$endrev\" />"; |
| 305 |
$vars["logsearch_maxbox" ] = "<input name=\"max\" size=\"5\" value=\"".($max==0?"":$max)."\" />"; |
305 |
$vars["logsearch_maxbox" ] = "<input name=\"max\" size=\"5\" value=\"".($max==0?"":$max)."\" />"; |
| 306 |
$vars["logsearch_inputbox"] = "<input name=\"search\" value=\"$search\" />"; |
306 |
$vars["logsearch_inputbox"] = "<input name=\"search\" value=\"$search\" />"; |
| 307 |
|
307 |
|
| 308 |
$vars["logsearch_submit"] = "<input type=\"submit\" value=\"${lang["GO"]}\" />"; |
308 |
$vars["logsearch_submit"] = "<input type=\"submit\" value=\"${lang["GO"]}\" />"; |
| 309 |
$vars["logsearch_endform"] = "<input type=\"hidden\" name=\"logsearch\" value=\"1\" />". |
309 |
$vars["logsearch_endform"] = "<input type=\"hidden\" name=\"logsearch\" value=\"1\" />". |
| 310 |
"<input type=\"hidden\" name=\"op\" value=\"log\" />". |
310 |
"<input type=\"hidden\" name=\"op\" value=\"log\" />". |
| 311 |
"<input type=\"hidden\" name=\"rev\" value=\"$rev\" />". |
311 |
"<input type=\"hidden\" name=\"rev\" value=\"$rev\" />". |
| 312 |
"<input type=\"hidden\" name=\"sc\" value=\"$showchanged\" />". |
312 |
"<input type=\"hidden\" name=\"sc\" value=\"$showchanged\" />". |
| 313 |
"<input type=\"hidden\" name=\"isdir\" value=\"$isDir\" />". |
313 |
"<input type=\"hidden\" name=\"isdir\" value=\"$isDir\" />". |
| 314 |
"</form>"; |
314 |
"</form>"; |
| 315 |
|
315 |
|
| 316 |
$url = $config->getURL($rep, $path, "log"); |
316 |
$url = $config->getURL($rep, $path, "log"); |
| 317 |
$vars["logsearch_clearloglink"] = "<a href=\"${url}rev=$rev&sc=$showchanged&isdir=$isDir\">${lang["CLEARLOG"]}</a>"; |
317 |
$vars["logsearch_clearloglink"] = "<a href=\"${url}rev=$rev&sc=$showchanged&isdir=$isDir\">${lang["CLEARLOG"]}</a>"; |
| 318 |
|
318 |
|
| 319 |
$url = $config->getURL($rep, "/", "comp"); |
319 |
$url = $config->getURL($rep, "/", "comp"); |
| 320 |
$vars["compare_form"] = "<form action=\"$url\" method=\"post\" name=\"compareform\">"; |
320 |
$vars["compare_form"] = "<form action=\"$url\" method=\"post\" name=\"compareform\">"; |
| 321 |
$vars["compare_submit"] = "<input name=\"comparesubmit\" type=\"submit\" value=\"${lang["COMPAREREVS"]}\" />"; |
321 |
$vars["compare_submit"] = "<input name=\"comparesubmit\" type=\"submit\" value=\"${lang["COMPAREREVS"]}\" />"; |
| 322 |
$vars["compare_endform"] = "<input type=\"hidden\" name=\"op\" value=\"comp\" /><input type=\"hidden\" name=\"sc\" value=\"$showchanged\" /></form>"; |
322 |
$vars["compare_endform"] = "<input type=\"hidden\" name=\"op\" value=\"comp\" /><input type=\"hidden\" name=\"sc\" value=\"$showchanged\" /></form>"; |
| 323 |
|
323 |
|
| 324 |
$vars["version"] = $version; |
324 |
$vars["version"] = $version; |
| 325 |
|
325 |
|
| 326 |
if (!$rep->hasReadAccess($path, false)) |
326 |
if (!$rep->hasReadAccess($path, false)) |
| 327 |
$vars["noaccess"] = true; |
327 |
$vars["noaccess"] = true; |
| 328 |
|
328 |
|
| 329 |
parseTemplate($rep->getTemplatePath()."header.tmpl", $vars, $listing); |
329 |
parseTemplate($rep->getTemplatePath()."header.tmpl", $vars, $listing); |
| 330 |
parseTemplate($rep->getTemplatePath()."log.tmpl", $vars, $listing); |
330 |
parseTemplate($rep->getTemplatePath()."log.tmpl", $vars, $listing); |
| 331 |
parseTemplate($rep->getTemplatePath()."footer.tmpl", $vars, $listing); |
331 |
parseTemplate($rep->getTemplatePath()."footer.tmpl", $vars, $listing); |
| 332 |
|
332 |
|
| 333 |
?> |
333 |
?> |