Adding language settings to config.php so that people can control the language output...
[viewsvn.git] / log.php
diff --git a/log.php b/log.php
index 3829e68a513d43b41351fc1362a17ba2db67d228..d7b3ac7100cd725264ae99adf3f2932a1d9ee6a7 100644 (file)
--- a/log.php
+++ b/log.php
@@ -1,46 +1,93 @@
 <?php
 /*=====================================================================*\
-|| ################################################################### ||
+|| ###################################################################
 || # ViewSVN [#]version[#]
-|| # --------------------------------------------------------------- # ||
-|| # Copyright ©2002-[#]year[#] by Iris Studios, Inc. All Rights Reserved. # ||
-|| # This file may not be reproduced in any way without permission.  # ||
-|| # --------------------------------------------------------------- # ||
-|| # User License Agreement at http://www.iris-studios.com/license/  # ||
-|| ################################################################### ||
+|| # Copyright ©2002-[#]year[#] Blue Static
+|| #
+|| # This program is free software; you can redistribute it and/or modify
+|| # it under the terms of the GNU General Public License as published by
+|| # the Free Software Foundation; version [#]gpl[#] of the License.
+|| #
+|| # This program is distributed in the hope that it will be useful, but
+|| # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+|| # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+|| # more details.
+|| #
+|| # You should have received a copy of the GNU General Public License along
+|| # with this program; if not, write to the Free Software Foundation, Inc.,
+|| # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+|| ###################################################################
 \*=====================================================================*/
 
+$fetchtemplates = array(
+       'log_node',
+       'log',
+       'pagenav_bit',
+       'pagenav'
+);
+
+define('SVN', '$Id$');
+
 require_once('./global.php');
 
-$path = $viewsvn->paths->parse();
-$repos = $viewsvn->paths->fetch_repos($path);
-$relpath = $viewsvn->paths->fetch_path($path);
+$navbar = ConstructNavbar();
 
-echo $viewsvn->paths->construct_breadcrumb($path, false);
+$paginate = BSRegister::LoadModule('Pagination');
 
-$logs = new SVNLog($repos, $relpath, 0, 0);
+function _PageBitCallback($baselink, $nolink, $number, $paginator)
+{
+       eval('$data = "' . BSRegister::Get('template')->fetch('pagenav_bit') . '";');
+       return $data;
+}
+
+function _PageNavCallback($baselink, $nextpage, $prevpage, $show, $pagebits, $paginator)
+{
+       eval('$data = "' . BSRegister::Get('template')->fetch('pagenav') . '";');
+       return $data;
+}
 
-echo '<ul>';
-echo "\n";
+$paginate->setPageLinks(2);
+$paginate->setPageVar('p');
+$paginate->setMaxPerPage(20);
+$paginate->setDefaultPerPage(20);
+$paginate->setBitProcessor('_PageBitCallback');
+$paginate->setNavigatorProcessor('_PageNavCallback');
+$paginate->processIncomingData();
 
-foreach ($logs->fetch() AS $log)
+// ###################################################################
+
+$logs = BSXml::Parse($lib->run('log --xml ' . $lib->arg($repos->fetchPath($input->in['repos']) . '/' . $input->in['path']), true));
+
+$nodes = '';
+
+BSXml::UnifyNode($logs['log']['logentry']);
+
+$paginate->setTotal(sizeof($logs['log']['logentry']));
+$paginate->splitPages();
+
+$i = $paginate->fetchLimit() - $paginate->getPerPage();
+$i = ($i <= 0 ? 0: $i);
+for (; $i < $paginate->fetchLimit($paginate->getPage()); $i++)
 {
-       echo '<li>' . $log['rev'];
-       echo "\n";
-       echo '<ul>';
-       echo "\n";
-       foreach ($log AS $key => $val)
-       {
-               echo '<li>' . $key . ': ' . nl2br($val) . '</li>';
-               echo "\n";
-       }
-       echo '</ul>';
-       echo "\n";
-       echo '</li>';
-       echo "\n";
+
+       $log = $logs['log']['logentry'][$i];
+       
+       $log['author'] = $log['author']['value'];
+       $log['date'] = FormatSvnDate($log['date']['value']);
+       $log['message_clean'] = FormatLogMessage($log['msg']['value']);
+       
+       $link['view'] = ConstructLink('view', $input->in['repos'], $input->in['path'], $log['revision']);
+       $link['blame'] = ConstructLink('blame', $input->in['repos'], $input->in['path'], $log['revision']);
+       $link['diff'] = ConstructLink('diff', $input->in['repos'], $input->in['path'], $log['revision']);
+       
+       eval('$nodes .= "' . $template->fetch('log_node') . '";');
 }
 
-echo '</ul>';
+$pagenav = $paginate->constructPageNav(ConstructLink('log', $input->in['repos'], $input->in['path'], 0) . '&amp;', false);
+
+// ###################################################################
+
+eval('$template->flush("' . $template->fetch('log') . '");');
 
 /*=====================================================================*\
 || ###################################################################