Extracted HTML from files and into templates
[viewsvn.git] / log.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 $navbar = $viewsvn->paths->construct_breadcrumb($path, false);
16
17 // ###################################################################
18
19 // this is NOT supposed to allow for revision ranges
20 $logs = new SVNLog($repos, $relpath, 0, $viewsvn->paths->fetch_rev_num());
21
22 $isdir = $viewsvn->svn->common->isdir($path);
23
24 $nodes = '';
25
26 foreach ($logs->fetch() AS $log)
27 {
28 $props = '';
29
30 $prev = $viewsvn->svn->common->fetch_prev_rev($path, $log['rev']);
31
32 $link['view'] = (!$isdir ? $viewsvn->paths->out('view.php' . $viewsvn->paths->fetch_rev_str(false, $log['rev']), $path) : '');
33 $link['blame'] = $viewsvn->paths->out('blame.php' . $viewsvn->paths->fetch_rev_str(false, $log['rev']), $path);
34
35 $show['diffhead'] = $viewsvn->svn->common->fetch_head_rev($path) != $log['rev'];
36 if ($show['diffhead'])
37 {
38 $link['diffhead'] = $viewsvn->paths->out('diff.php' . $viewsvn->paths->fetch_rev_str(true, 'HEAD', $log['rev']), $path);
39 }
40
41 $show['diffprev'] = $prev != -1;
42 if ($show['diffprev'])
43 {
44 $link['diffprev'] = $viewsvn->paths->out('diff.php' . $viewsvn->paths->fetch_rev_str(true, $log['rev'], $prev), $path);
45 }
46
47 foreach ($log AS $key => $val)
48 {
49 if ($key != 'files')
50 {
51 $val = $viewsvn->svn->format($val);
52 eval('$props .= "' . $template->fetch('log_prop') . '";');
53 }
54 }
55
56 eval('$nodes .= "' . $template->fetch('log_node') . '";');
57 }
58
59 // ###################################################################
60
61 eval('$template->flush("' . $template->fetch('log') . '");');
62
63 /*=====================================================================*\
64 || ###################################################################
65 || # $HeadURL$
66 || # $Id$
67 || ###################################################################
68 \*=====================================================================*/
69 ?>