$node = preg_replace('#(^/|/$)#', '', ($viewsvn->paths->relpath == '' ? $viewsvn->paths->path : $viewsvn->paths->relpath));
$latest = $controller->cachev->fetch_node($node);
-$link['log'] = $viewsvn->paths->out('log.php' . $viewsvn->paths->revstr, $viewsvn->paths->path);
+$link['log'] = $controller->out('log.php' . $viewsvn->paths->revstr);
$show['head'] = ($latest['revision'] != $viewsvn->paths->revnum AND $viewsvn->paths->revnum != 'HEAD');
if ($show['head'])
{
- $link['gohead'] = $viewsvn->paths->out('browse.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->out('browse.php' . $viewsvn->paths->fetch_rev_str(false, 'HEAD'));
+ $link['diffhead'] = $controller->out('diff.php' . $viewsvn->paths->fetch_rev_str(true, 'HEAD', $viewsvn->paths->revnum));
}
$show['prev'] = ($prev = $controller->cachev->fetch_prev_revision($viewsvn->paths->relpath, $viewsvn->paths->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->out('diff.php' . $viewsvn->paths->fetch_rev_str(true, $viewsvn->paths->revnum, $prev));
}
// ###################################################################
if ($item{ strlen($item) - 1 } == '/')
{
$show['directory'] = true;
- $browse = $viewsvn->paths->out('browse.php' . $viewsvn->paths->revstr, $viewsvn->paths->path . $item);
+ $browse = $controller->out('browse.php' . $viewsvn->paths->revstr, $controller->path . '/' . $item);
}
else
{
$show['directory'] = false;
- $view = $viewsvn->paths->out('view.php' . $viewsvn->paths->revstr, $viewsvn->paths->path . $item);
- $blame = $viewsvn->paths->out('blame.php' . $viewsvn->paths->revstr, $viewsvn->paths->path . $item);
+ $view = $controller->out('view.php' . $viewsvn->paths->revstr, $controller->path . '/' . $item);
+ $blame = $controller->out('blame.php' . $viewsvn->paths->revstr, $controller->path . '/' . $item);
}
- $log = $viewsvn->paths->out('log.php' . $viewsvn->paths->revstr, $viewsvn->paths->path . $item);
+ $log = $controller->out('log.php' . $viewsvn->paths->revstr, $controller->path . '/' . $item);
eval('$nodes .= "' . $template->fetch('browse_node') . '";');
}
$this->cachev = new cacheV($this);
}
+ // ###################################################################
+ /**
+ * Constructs a repository browser link
+ *
+ * @access public
+ *
+ * @param string Base path
+ * @param string Browser path, separated using '/'
+ *
+ * @return string Link path
+ */
+ function out($base, $addpath = null)
+ {
+ global $viewsvn;
+
+ if ($addpath === null)
+ {
+ $addpath = $this->path;
+ }
+
+ $url = Paths::fetch_arguments($base);
+ $addpath = Paths::sanitize($addpath);
+
+ // standard URL type
+ if ($this->registry->paths->type == 1)
+ {
+ return $url[0] . '?path=' . $addpath . ($url[1] ? '&' . $url[1] : '');
+ }
+ // advanced path system
+ else if ($this->registry->paths->type == 2)
+ {
+ return $url[0] . '/' . $this->repos . ($addpath{0} != '/' ? '/' : '') . $addpath . ($url[1] ? '?' . $url[1] : '');
+ }
+ }
+
// ###################################################################
/**
* Create path breadcrumb
{
$itembit .= $item;
$itembit .= (($count != $val OR $this->cachev->isdir($itembit)) ? '/' : '');
- $html .= '<a href="' . $this->path . '/' . $this->registry->paths->out('browse.php' . $this->revstr, $itembit) . '">' . $item . '</a>'. ($count != $val ? ' / ' : '');
+ $html .= '<a href="' . $this->registry->path . '/' . $this->out('browse.php' . $this->revstr, $itembit) . '">' . $item . '</a>'. ($count != $val ? ' / ' : '');
}
return $html;
$this->revnum = $this->revnum;
$this->revstr = $this->revstr;
}
-
- /**
- * Constructs a repository browser link
- *
- * @access public
- *
- * @param string Base path
- * @param string Browser path, separated using '/'
- *
- * @return string Link path
- */
- function out($base, $addpath)
- {
- global $viewsvn;
-
- $url = $this->fetch_arguments($base);
- $addpath = $this->sanitize($addpath);
- // standard URL type
- if ($this->type == 1)
- {
- return $url[0] . '?path=' . $addpath . ($url[1] ? '&' . $url[1] : '');
- }
- // advanced path system
- else if ($this->type == 2)
- {
- return $url[0] . ($addpath{0} != '/' ? '/' : '') . $addpath . ($url[1] ? '?' . $url[1] : '');
- }
- }
-
/**
* Parses an incoming path with the various methods
* and returns a universal form
$latest = $controller->cachev->fetch_node($viewsvn->paths->relpath);
-$link['log'] = $viewsvn->paths->out('log.php' . $viewsvn->paths->revstr, $viewsvn->paths->path);
+$link['log'] = $controller->out('log.php' . $viewsvn->paths->revstr);
$show['head'] = ($latest['revision'] != $viewsvn->paths->revnum AND $viewsvn->paths->revnum != 'HEAD');
if ($show['head'])
{
- $link['gohead'] = $viewsvn->paths->out('browse.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->out('browse.php' . $viewsvn->paths->fetch_rev_str(false, 'HEAD'));
+ $link['diffhead'] = $controller->out('diff.php' . $viewsvn->paths->fetch_rev_str(true, 'HEAD', $viewsvn->paths->revnum));
}
$show['prev'] = ($prev = $controller->cachev->fetch_prev_revision($viewsvn->paths->relpath, $viewsvn->paths->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->out('diff.php' . $viewsvn->paths->fetch_rev_str(true, $viewsvn->paths->revnum, $prev));
}
// ###################################################################