Adding language settings to config.php so that people can control the language output...
[viewsvn.git] / browse.php
index 0a95e9665258bb420a84b0f084869208e11d1afa..00ccbebbd8405802f429d11ee2c067c70f0e007b 100644 (file)
@@ -2,7 +2,7 @@
 /*=====================================================================*\
 || ###################################################################
 || # ViewSVN [#]version[#]
-|| # Copyright ©2002-[#]year[#] Iris Studios, Inc.
+|| # 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
@@ -25,36 +25,42 @@ $fetchtemplates = array(
        'property'
 );
 
+define('SVN', '$Id$');
+
 require_once('./global.php');
 
 $navbar = ConstructNavbar();
 
 // ###################################################################
 
-$revision = new Revision($input->in['repos'], $input->in['rev']);
-
-// ###################################################################
-
-/*
-$show['props'] = false;
-$proplist = '';
-if (sizeof($latest['properties']) > 0)
+$revision = $headRev = new Revision($input->in['repos'], $input->in['rev'], $input->in['path']);
+if ($input->in['rev'])
 {
-       $show['props'] = true;
-       foreach ($latest['properties'] AS $propname => $propval)
+       $headRev = new Revision($input->in['repos'], 0, $input->in['path']);
+       if ($headRev->revision != $revision->revision)
        {
-               $data = sprintf($lang->string('Property <strong>%1$s</strong> set to <em>%2$s</em>'), $propname, $propval);
-               eval('$proplist .= "' . $template->fetch('property') . '";');
+               $show['head'] = true;
+               $link['gohead'] = ConstructLink('browse', $input->in['repos'], $input->in['path'], 0);
        }
 }
-*/
+
+if ($revision->revision - 1 > 0)
+{
+       $show['diff'] = true;
+       $link['diff'] = ConstructLink('diff', $input->in['repos'], $input->in['path'], $revision->revision);
+}
 
 // ###################################################################
 
-// $revinfo['message_clean'] = SVNCommon::format_log_message($revinfo['message']);
-// $revinfo['date'] = SVNCommon::format_date_string($revinfo['dateline']);
+$props = $revision->getPropsForPath($input->in['path']);
+$show['props'] = (sizeof($props) > 0);
+$proplist = FormatPropList($props);
+
+// ###################################################################
 
-$listing = BSXml::Parse($lib->run('ls --xml -r' . $revision->revision . ' ' . $lib->arg($repos->fetchPath($input->in['repos']) . $input->in['path']), true));
+$revision->getRevisionInfo();
+
+$listing = BSXml::Parse($lib->run('ls --xml -r' . $revision->revision . ' ' . $lib->arg($repos->fetchPath($input->in['repos']) . $input->in['path']) . '@' . $revision->revision, true));
 
 BSXml::UnifyNode($listing['lists']['list']['entry']);
 $nodes = '';
@@ -62,11 +68,14 @@ foreach ($listing['lists']['list']['entry'] AS $item)
 {
        $isDir = ($item['kind'] == 'dir');
        $item = $item['name']['value'];
+       $itemLink = ConstructLink(($isDir ? 'browse' : 'view'), $input->in['repos'], $input->in['path'] . '/' . $item, $input->in['rev']);
        eval('$nodes .= "' . $template->fetch('browse_node') . '";');
 }
 
 // ###################################################################
 
+$link['log'] = ConstructLink('log', $input->in['repos'], $input->in['path'], $input->in['rev']);
+
 eval('$template->flush("' . $template->fetch('browse') . '");');
 
 /*=====================================================================*\