Dead code stripping
[viewsvn.git] / browse.php
1 <?php
2 /*=====================================================================*\
3 || ###################################################################
4 || # ViewSVN [#]version[#]
5 || # Copyright ©2002-[#]year[#] Iris Studios, Inc.
6 || #
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
9 || # the Free Software Foundation; version [#]gpl[#] of the License.
10 || #
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 || # more details.
15 || #
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
21
22 $fetchtemplates = array(
23 'browse_node',
24 'browse'
25 );
26
27 require_once('./global.php');
28
29 $navbar = $controller->construct_breadcrumb();
30
31 // ###################################################################
32
33 $latest = $controller->cachev->fetch_node();
34
35 $link['log'] = $controller->href_compound('log.php');
36
37 $show['head'] = ($latest['revision'] != $controller->revctx);
38 if ($show['head'])
39 {
40 $link['gohead'] = $controller->href_compound('browse.php', null, Paths::fetch_rev_str(false, 'HEAD'));
41 $link['diffhead'] = $controller->href_compound('diff.php', null, Paths::fetch_rev_str(true, 'HEAD', $controller->revctx));
42 }
43
44 $show['prev'] = ($controller->cachev->fetch_prev_revision($controller->revctx) != -1);
45 if ($show['prev'])
46 {
47 $link['diffprev'] = $controller->href_compound('diff.php', null, Paths::fetch_rev_str(false, $controller->revctx));
48 }
49
50 // ###################################################################
51
52 $revinfo = $controller->cachev->fetch_revision($controller->revctx);
53
54 $revinfo['message_clean'] = SVNCommon::format_log_message($revinfo['message']);
55 $revinfo['date'] = SVNCommon::format_date_string($revinfo['dateline']);
56
57 $listing = $controller->library->command('ls');
58
59 $nodes = '';
60
61 foreach ($listing AS $item)
62 {
63 if ($item[ strlen($item) - 1 ] == '/')
64 {
65 $show['directory'] = true;
66 $browse = $controller->href_compound('browse.php', $item);
67 }
68 else
69 {
70 $show['directory'] = false;
71 $view = $controller->href_compound('view.php', $item);
72 $blame = $controller->href_compound('blame.php', $item);
73 }
74
75 $log = $controller->href_compound('log.php', $item);
76
77 eval('$nodes .= "' . $template->fetch('browse_node') . '";');
78 }
79
80 // ###################################################################
81
82 eval('$template->flush("' . $template->fetch('browse') . '");');
83
84 /*=====================================================================*\
85 || ###################################################################
86 || # $HeadURL$
87 || # $Id$
88 || ###################################################################
89 \*=====================================================================*/
90 ?>