- Got blame.php to work
authorRobert Sesek <rsesek@bluestatic.org>
Sun, 22 Jan 2006 18:43:09 +0000 (18:43 +0000)
committerRobert Sesek <rsesek@bluestatic.org>
Sun, 22 Jan 2006 18:43:09 +0000 (18:43 +0000)
- Changing the library extensions to simply pass the controller (only done for SVNBlame at the moment)

blame.php
includes/svnlib.php
templates/default/blame.tpl
templates/default/blame_line.tpl

index 2f80cad6c75b5d6ee114f3597644e783e172c779..a190d493a7d58d81d6e0bc23a05d36ef97fb1568 100644 (file)
--- a/blame.php
+++ b/blame.php
@@ -26,37 +26,37 @@ $fetchtemplates = array(
 
 require_once('./global.php');
 
-$navbar = $viewsvn->paths->construct_breadcrumb($viewsvn->paths->path, false);
+$navbar = $controller->construct_breadcrumb();
 
 // ###################################################################
 
-$latest = $cachev->fetch_node($viewsvn->paths->relpath);
+$latest = $controller->cachev->fetch_node();
 
-$link['log'] = $viewsvn->paths->out('log.php' . $viewsvn->paths->revstr, $viewsvn->paths->path);
+$link['log'] = $controller->href_compound('log.php');
 
-$show['head'] = ($latest['revision'] != $viewsvn->paths->revnum AND $viewsvn->paths->revnum != 'HEAD');
+$show['head'] = ($latest['revision'] != $controller->revnum AND $controller->revnum != 'HEAD');
 if ($show['head'])
 {
-       $link['gohead'] = $viewsvn->paths->out('blame.php' . $viewsvn->paths->fetch_rev_str(false, 'HEAD'), $viewsvn->paths->path);
-       $link['diffhead'] = $viewsvn->paths->out('diff.php' . $viewsvn->paths->fetch_rev_str(true, 'HEAD', $viewsvn->paths->revnum), $viewsvn->paths->path);
+       $link['gohead'] = $controller->href_compound('blame.php', null, Paths::fetch_rev_str(false, 'HEAD'));
+       $link['diffhead'] = $controller->href_compound('diff.php', null, Paths::fetch_rev_str(true, 'HEAD', $contoller->revnum));
 }
 
-$show['prev'] = ($prev = $cachev->fetch_prev_revision($viewsvn->paths->relpath, $viewsvn->paths->revnum));
+$show['prev'] = ($prev = $controller->cachev->fetch_prev_revision($controller->revnum));
 if ($show['prev'])
 {
-       $link['diffprev'] = $viewsvn->paths->out('diff.php' . $viewsvn->paths->fetch_rev_str(true, $viewsvn->paths->revnum, $prev), $viewsvn->paths->path);
+       $link['diffprev'] = $controller->href_compound('diff.php', null, Paths::fetch_rev_str(true, $controller->revnum, $prev));
 }
 
 // ###################################################################
 
-$blame = new SVNBlame($viewsvn->paths->repos, $viewsvn->paths->relpath, $viewsvn->paths->revnum);
+$blame = new SVNBlame($controller);
 
 $lines = '';
 
 foreach ($blame->fetch() AS $entry)
 {
-       $entry['view_link'] = $viewsvn->paths->out('view.php' . $viewsvn->paths->fetch_rev_str(false, $entry['rev']), $viewsvn->paths->path);
-       $entry['line_clean'] = $viewsvn->svn->format($entry['line']);
+       $entry['view_link'] = $controller->href_compound('view.php', null, Paths::fetch_rev_str(false, $entry['rev']));
+       $entry['line_clean'] = SVNCommon::format($entry['line']);
        eval('$lines .= "' . $template->fetch('blame_line') . '";');
 }
 
index a57a1d5375455a385dbc79abf4aacfe9a0d5426d..e781239676efc77ef4e9efab8758453936c1693f 100644 (file)
@@ -270,11 +270,9 @@ class SVNBlame
        * @param        string  Path
        * @param        integer Revision
        */
-       function SVNBlame($repos, $path, $revision)
+       function SVNBlame(&$controller)
        {
-               global $viewsvn;
-               
-               $this->rawoutput = $viewsvn->svn->blame($repos, $path, $revision);
+               $this->rawoutput = $controller->library->command('blame');
                $this->process();
        }
        
index 7c0758b5a4be507dec478611c16d55479bb36497..11d8ee193efc26b55b7642d3209416909b6cf483 100644 (file)
@@ -8,15 +8,15 @@ $headinclude
 
 $header
 
-<a href="$viewsvn->path/$link[log]">{@"View Log"}</a>
+<a href="$link[log]">{@"View Log"}</a>
 
 <if condition="$show['head']">
-       - <a href="$viewsvn->path/$link[gohead]">{@"Go to HEAD"}</a>
-       - <a href="$viewsvn->path/$link[diffhead]">{@"Diff to HEAD"}</a>
+       - <a href="$link[gohead]">{@"Go to HEAD"}</a>
+       - <a href="$link[diffhead]">{@"Diff to HEAD"}</a>
 </if>
 
 <if condition="$show['prev']">
-       - <a href="$viewsvn->path/$link[diffprev]">{@"Diff to PREV"}</a>
+       - <a href="$link[diffprev]">{@"Diff to PREV"}</a>
 </if>
 
 <div class="head" style="border-width: 1px">$navbar</div>
index 536df2749301bb72ed0def1c1621ee8cc0d91847..b5f7e429f16972dd6739533743b1d36c8b91956c 100644 (file)
@@ -1,5 +1,5 @@
 <tr>
-       <td class="lineheader" style="border-width: 0px 1px 1px 1px"><a href="$viewsvn->path/$entry[view_link]">$entry[rev]</a></td>
+       <td class="lineheader" style="border-width: 0px 1px 1px 1px"><a href="$entry[view_link]">$entry[rev]</a></td>
        <td class="lineheader" style="border-width: 0px 1px 1px 0px">$entry[author]</td>
        <td class="code" style="border-width: 0px 1px 1px 0px">$entry[line_clean]</td>
 </tr>