Adding language settings to config.php so that people can control the language output...
[viewsvn.git] / view.php
index 75ffd72ac5d7371725887cababe0623422013542..b2aa13bebb64c89a75deab12832f804b1f674d0e 100644 (file)
--- a/view.php
+++ b/view.php
@@ -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
 \*=====================================================================*/
 
 $fetchtemplates = array(
-       'view'
+       'view',
+       'property'
 );
 
+define('SVN', '$Id$');
+
 require_once('./global.php');
 
-$navbar = $controller->construct_breadcrumb();
+$navbar = ConstructNavbar();
 
 // ###################################################################
 
-$latest = $controller->cachev->fetch_node();
-
-$link['log'] = $controller->href_compound('log.php');
-
-$show['head'] = ($latest['revision'] != $controller->revnum AND $controller->revnum != 'HEAD');
-if ($show['head'])
+$revision = $headRev = new Revision($input->in['repos'], $input->in['rev'], $input->in['path']);
+if ($input->in['rev'])
 {
-       $link['gohead'] = $controller->href_compound('view.php', null, Paths::fetch_rev_str(false, 'HEAD'));
-       $link['diffhead'] = $controller->href_compound('diff.php', null, Paths::fetch_rev_str(true, 'HEAD', $controller->revctx));
+       $headRev = new Revision($input->in['repos'], 0, $input->in['path']);
+       if ($headRev->revision != $revision->revision)
+       {
+               $show['head'] = true;
+               $link['gohead'] = ConstructLink('view', $input->in['repos'], $input->in['path'], 0);
+       }
 }
 
-$show['prev'] = ($prev = $controller->cachev->fetch_prev_revision($controller->revctx));
-if ($show['prev'])
+if ($revision->revision - 1 > 0)
 {
-       $link['diffprev'] = $controller->href_compound('diff.php', null, Paths::fetch_rev_str(true, $controller->revctx, $prev['revision']));
+       $show['diff'] = true;
+       $link['diff'] = ConstructLink('diff', $input->in['repos'], $input->in['path'], $revision->revision);
 }
 
+$link['log'] = ConstructLink('log', $input->in['repos'], $input->in['path'], 0);
+
 // ###################################################################
 
-$logmsg = $controller->cachev->fetch_revision($controller->revctx);
-unset($logmsg['files']);
+$revision->getRevisionInfo();
 
-$logmsg['message_clean'] = SVNCommon::format_log_message($logmsg['message']);
-$logmsg['date'] = SVNCommon::format_date_string($logmsg['dateline']);
+$catdata = $lib->run('cat -r' . $revision->revision . ' ' . $lib->arg($repos->fetchPath($input->in['repos']) . $input->in['path']), true);
 
-$catdata = implode("\n", $controller->library->command('cat'));
+// ###################################################################
+
+$props = $revision->getPropsForPath($input->in['path']);
+$show['props'] = (sizeof($props) > 0);
+$proplist = FormatPropList($props);
+
+// ###################################################################
 
 // get language information
 require_once('./includes/file_types.php');
-$extension = $funct->fetch_extension($controller->path);
+$extension = BSFunctions::FetchExtension($input->in['path']);
 $language = (isset($filetypes["$extension"]) ? $filetypes["$extension"] : null);
 
 // initialize GeSHi
@@ -91,7 +100,7 @@ $geshi->set_tab_width(5);
 // parse the code
 $catdata = $geshi->parse_code();
 
-$viewsvn->debug("time in GeSHi = " . $funct->fetch_microtime_diff($mtstart));
+BSRegister::Debug("time in GeSHi = " . BSFunctions::FetchMicrotimeDiff($mtstart));
 
 // ###################################################################