Moving definitions of common variables to global.php
[viewsvn.git] / blame.php
1 <?php
2 /*=====================================================================*\
3 || ################################################################### ||
4 || # ViewSVN [#]version[#]
5 || # --------------------------------------------------------------- # ||
6 || # Copyright ©2002-[#]year[#] by Iris Studios, Inc. All Rights Reserved. # ||
7 || # This file may not be reproduced in any way without permission. # ||
8 || # --------------------------------------------------------------- # ||
9 || # User License Agreement at http://www.iris-studios.com/license/ # ||
10 || ################################################################### ||
11 \*=====================================================================*/
12
13 require_once('./global.php');
14
15 echo $viewsvn->paths->construct_breadcrumb($path, false);
16
17 echo '<br />';
18
19 echo '<a href="/viewsvn/' . $viewsvn->paths->out('log.php' . $viewsvn->paths->fetch_rev_str(), $path) . '">View Log</a>';
20
21 if ($viewsvn->svn->common->fetch_head_rev($path) != $viewsvn->paths->fetch_rev_num() AND $viewsvn->paths->fetch_rev_num() != 'HEAD')
22 {
23 echo ' - <a href="/viewsvn/' . $viewsvn->paths->out('blame.php' . $viewsvn->paths->fetch_rev_str(false, 'HEAD'), $path) . '">Go to HEAD</a>';
24 echo ' - <a href="/viewsvn/' . $viewsvn->paths->out('diff.php' . $viewsvn->paths->fetch_rev_str(true, 'HEAD', $viewsvn->paths->fetch_rev_num()), $path) . '">Diff to HEAD</a>';
25 }
26
27 $prev = $viewsvn->svn->common->fetch_prev_rev($path, $viewsvn->paths->fetch_rev_num());
28 if ($prev != -1)
29 {
30 echo ' - <a href="/viewsvn/' . $viewsvn->paths->out('diff.php' . $viewsvn->paths->fetch_rev_str(true, $viewsvn->paths->fetch_rev_num(), $prev), $path) . '">Diff to PREV</a>';
31 }
32
33 $blame = new SVNBlame($repos, $relpath, $viewsvn->paths->fetch_rev_num());
34
35 echo '<table cellspacing="1" cellpadding="1" style="background-color: #EFEFEF; font: 11px monospace" width="100%">';
36
37 foreach ($blame->fetch() AS $entry)
38 {
39 echo '
40 <tr style="background-color: white">
41 <td>' . $entry['rev'] . '</td>
42 <td>' . $entry['author'] . '</td>
43 <td>' . str_replace(array(' ', "\t"), array('&nbsp;', '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'), htmlspecialchars($entry['line'])) . '</td>
44 </tr>';
45 }
46
47 echo '
48 </table>';
49
50 /*=====================================================================*\
51 || ###################################################################
52 || # $HeadURL$
53 || # $Id$
54 || ###################################################################
55 \*=====================================================================*/
56 ?>