Clean up ConstructNavbar() so we don't have to make repeated calls to BSRegister...
[viewsvn.git] / log.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 'log_node',
24 'log'
25 );
26
27 require_once('./global.php');
28
29 $navbar = $controller->construct_breadcrumb();
30
31 // ###################################################################
32
33 // this is NOT supposed to allow for revision ranges
34 $logs = new SVNLog($controller);
35
36 $isdir = $controller->cachev->isdir();
37
38 $nodes = '';
39
40 foreach ($logs->fetch() AS $log)
41 {
42 $prev = $controller->cachev->fetch_prev_revision($log['rev']);
43 $prev = $prev['revision'];
44
45 $link['view'] = $controller->href_compound(($isdir ? 'browse.php' : 'view.php'), null, Paths::fetch_rev_str(false, $log['rev']));
46 $link['blame'] = $controller->href_compound('blame.php', null, Paths::fetch_rev_str(false, $log['rev']));
47
48 $show['diffhead'] = $controller->cachev->fetch_head_revision() != $log['rev'];
49 if ($show['diffhead'])
50 {
51 $link['diffhead'] = $controller->href_compound('diff.php', null, Paths::fetch_rev_str(true, 'HEAD', $log['rev']));
52 }
53
54 $show['diffprev'] = ($prev !== null);
55 if ($show['diffprev'])
56 {
57 $link['diffprev'] = $controller->href_compound('diff.php', null, Paths::fetch_rev_str(true, $log['rev'], $prev));
58 }
59
60 $log['message_clean'] = SVNCommon::format_log_message($log['message']);
61
62 eval('$nodes .= "' . $template->fetch('log_node') . '";');
63 }
64
65 // ###################################################################
66
67 eval('$template->flush("' . $template->fetch('log') . '");');
68
69 /*=====================================================================*\
70 || ###################################################################
71 || # $HeadURL$
72 || # $Id$
73 || ###################################################################
74 \*=====================================================================*/
75 ?>