From 99e1d654dc4209727a82e723ca626c3a51229e8f Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 22 Jan 2006 18:43:09 +0000 Subject: [PATCH] - Got blame.php to work - Changing the library extensions to simply pass the controller (only done for SVNBlame at the moment) --- blame.php | 22 +++++++++++----------- includes/svnlib.php | 6 ++---- templates/default/blame.tpl | 8 ++++---- templates/default/blame_line.tpl | 2 +- 4 files changed, 18 insertions(+), 20 deletions(-) diff --git a/blame.php b/blame.php index 2f80cad..a190d49 100644 --- 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') . '";'); } diff --git a/includes/svnlib.php b/includes/svnlib.php index a57a1d5..e781239 100644 --- a/includes/svnlib.php +++ b/includes/svnlib.php @@ -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(); } diff --git a/templates/default/blame.tpl b/templates/default/blame.tpl index 7c0758b..11d8ee1 100644 --- a/templates/default/blame.tpl +++ b/templates/default/blame.tpl @@ -8,15 +8,15 @@ $headinclude $header -{@"View Log"} +{@"View Log"} - - {@"Go to HEAD"} - - {@"Diff to HEAD"} + - {@"Go to HEAD"} + - {@"Diff to HEAD"} - - {@"Diff to PREV"} + - {@"Diff to PREV"}
$navbar
diff --git a/templates/default/blame_line.tpl b/templates/default/blame_line.tpl index 536df27..b5f7e42 100644 --- a/templates/default/blame_line.tpl +++ b/templates/default/blame_line.tpl @@ -1,5 +1,5 @@ - $entry[rev] + $entry[rev] $entry[author] $entry[line_clean] -- 2.43.5