Change log.php to view.php for regular files
[viewsvn.git] / browse.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 $fetchtemplates = array(
14 'browse_node',
15 'browse'
16 );
17
18 require_once('./global.php');
19
20 $navbar = $viewsvn->paths->construct_breadcrumb($path);
21
22 // ###################################################################
23
24 $link['log'] = $viewsvn->paths->out('log.php' . $viewsvn->paths->fetch_rev_str(), $path);
25
26 $show['head'] = ($viewsvn->svn->common->fetch_head_rev($path) != $viewsvn->paths->fetch_rev_num() AND $viewsvn->paths->fetch_rev_num() != 'HEAD');
27 if ($show['head'])
28 {
29 $link['gohead'] = $viewsvn->paths->out('browse.php' . $viewsvn->paths->fetch_rev_str(false, 'HEAD'), $path);
30 $link['diffhead'] = $viewsvn->paths->out('diff.php' . $viewsvn->paths->fetch_rev_str(true, 'HEAD', $viewsvn->paths->fetch_rev_num()), $path);
31 }
32
33 $show['prev'] = (($prev = $viewsvn->svn->common->fetch_prev_rev($path, $viewsvn->paths->fetch_rev_num())) != -1 ? true : false);
34 if ($show['prev'])
35 {
36 $link['diffprev'] = $viewsvn->paths->out('diff.php' . $viewsvn->paths->fetch_rev_str(true, $viewsvn->paths->fetch_rev_num(), $prev), $path);
37 }
38
39 // ###################################################################
40
41 // #*# finish extracting this tpl
42 echo '<pre>' . print_r($viewsvn->svn->common->fetch_log($path, $viewsvn->paths->fetch_rev_num()), true) . '</pre>';
43
44 $listing = $viewsvn->svn->ls($repos, $relpath, $viewsvn->paths->fetch_rev_num());
45
46 $nodes = '';
47
48 foreach ($listing AS $item)
49 {
50 if ($item{ strlen($item) - 1 } == '/')
51 {
52 $show['directory'] = true;
53 $browse = $viewsvn->paths->out('browse.php' . $viewsvn->paths->fetch_rev_str(), $path . $item);
54 }
55 else
56 {
57 $show['directory'] = false;
58 $view = $viewsvn->paths->out('view.php' . $viewsvn->paths->fetch_rev_str(), $path . $item);
59 $blame = $viewsvn->paths->out('blame.php' . $viewsvn->paths->fetch_rev_str(), $path . $item);
60 }
61
62 $log = $viewsvn->paths->out('log.php' . $viewsvn->paths->fetch_rev_str(), $path . $item);
63
64 eval('$nodes .= "' . $template->fetch('browse_node') . '";');
65 }
66
67 // ###################################################################
68
69 eval('$template->flush("' . $template->fetch('browse') . '");');
70
71 /*=====================================================================*\
72 || ###################################################################
73 || # $HeadURL$
74 || # $Id$
75 || ###################################################################
76 \*=====================================================================*/
77 ?>