Adding language settings to config.php so that people can control the language output...
[viewsvn.git] / log.php
1 <?php
2 /*=====================================================================*\
3 || ###################################################################
4 || # ViewSVN [#]version[#]
5 || # Copyright ©2002-[#]year[#] Blue Static
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 'pagenav_bit',
26 'pagenav'
27 );
28
29 define('SVN', '$Id$');
30
31 require_once('./global.php');
32
33 $navbar = ConstructNavbar();
34
35 $paginate = BSRegister::LoadModule('Pagination');
36
37 function _PageBitCallback($baselink, $nolink, $number, $paginator)
38 {
39 eval('$data = "' . BSRegister::Get('template')->fetch('pagenav_bit') . '";');
40 return $data;
41 }
42
43 function _PageNavCallback($baselink, $nextpage, $prevpage, $show, $pagebits, $paginator)
44 {
45 eval('$data = "' . BSRegister::Get('template')->fetch('pagenav') . '";');
46 return $data;
47 }
48
49 $paginate->setPageLinks(2);
50 $paginate->setPageVar('p');
51 $paginate->setMaxPerPage(20);
52 $paginate->setDefaultPerPage(20);
53 $paginate->setBitProcessor('_PageBitCallback');
54 $paginate->setNavigatorProcessor('_PageNavCallback');
55 $paginate->processIncomingData();
56
57 // ###################################################################
58
59 $logs = BSXml::Parse($lib->run('log --xml ' . $lib->arg($repos->fetchPath($input->in['repos']) . '/' . $input->in['path']), true));
60
61 $nodes = '';
62
63 BSXml::UnifyNode($logs['log']['logentry']);
64
65 $paginate->setTotal(sizeof($logs['log']['logentry']));
66 $paginate->splitPages();
67
68 $i = $paginate->fetchLimit() - $paginate->getPerPage();
69 $i = ($i <= 0 ? 0: $i);
70 for (; $i < $paginate->fetchLimit($paginate->getPage()); $i++)
71 {
72
73 $log = $logs['log']['logentry'][$i];
74
75 $log['author'] = $log['author']['value'];
76 $log['date'] = FormatSvnDate($log['date']['value']);
77 $log['message_clean'] = FormatLogMessage($log['msg']['value']);
78
79 $link['view'] = ConstructLink('view', $input->in['repos'], $input->in['path'], $log['revision']);
80 $link['blame'] = ConstructLink('blame', $input->in['repos'], $input->in['path'], $log['revision']);
81 $link['diff'] = ConstructLink('diff', $input->in['repos'], $input->in['path'], $log['revision']);
82
83 eval('$nodes .= "' . $template->fetch('log_node') . '";');
84 }
85
86 $pagenav = $paginate->constructPageNav(ConstructLink('log', $input->in['repos'], $input->in['path'], 0) . '&amp;', false);
87
88 // ###################################################################
89
90 eval('$template->flush("' . $template->fetch('log') . '");');
91
92 /*=====================================================================*\
93 || ###################################################################
94 || # $HeadURL$
95 || # $Id$
96 || ###################################################################
97 \*=====================================================================*/
98 ?>