$navbar = $controller->construct_breadcrumb();
-print_r($controller);
-
// ###################################################################
$node = preg_replace('#(^/|/$)#', '', ($viewsvn->paths->relpath == '' ? $viewsvn->paths->path : $viewsvn->paths->relpath));
$revinfo['date'] = SVNCommon::format_date_string($revinfo['dateline']);
-$listing = $controller->library->ls($viewsvn->paths->repos, $viewsvn->paths->relpath, $viewsvn->paths->revnum);
+$listing = $controller->library->ls($controller->repos, $controller->path, $controller->revnum);
$nodes = '';
if ($item{ strlen($item) - 1 } == '/')
{
$show['directory'] = true;
- $browse = $controller->out('browse.php' . $viewsvn->paths->revstr, $controller->path . '/' . $item);
+ $browse = $controller->href_compound('browse.php', $item);
}
else
{
$show['directory'] = false;
- $view = $controller->out('view.php' . $viewsvn->paths->revstr, $controller->path . '/' . $item);
- $blame = $controller->out('blame.php' . $viewsvn->paths->revstr, $controller->path . '/' . $item);
+ $view = $controller->href_compound('view.php', $item);
+ $blame = $controller->href_compound('blame.php', $item);
}
- $log = $controller->out('log.php' . $viewsvn->paths->revstr, $controller->path . '/' . $item);
+ $log = $controller->href_compound('log.php', $item);
eval('$nodes .= "' . $template->fetch('browse_node') . '";');
}
function href_struct($base, $path)
{
$url = Paths::fetch_arguments($base);
- $path = Paths::sanitize($addpath);
+ $path = Paths::sanitize($path);
return $this->registry->path . '/' . $url[0] . '/' . $this->repos . ($path{0} != '/' ? '/' : '') . $path . ($url[1] ? '?' . $url[1] : '');
}
*
* @param string Base path (e.g. browse.php)
* @param string Attach path (or none for current)
+ * @param bool Attach the current revision string?
*
* @return string Constructed path
*/
- function href_compound($base, $attach = null)
+ function href_compound($base, $attach = null, $revstr = true)
{
- $url = Paths::fetch_arguments($base);
+ $url = Paths::fetch_arguments($base . ($revstr ? ((strpos($base, '?') !== false) ? '&' . $this->revstr : $this->revstr) : ''));
$attach = Paths::sanitize($attach);
if ($attach === null)
}
else
{
- $path = $this->path . ($attach{0} != '/' ? '/' : '') . $attach;
+ $path = $this->path . (($attach[0] != '/' AND $this->path[ strlen($this->path) - 1 ] != '/') ? '/' : '') . $attach;
}
- return $this->href_struct($base, $path);
+ return $this->href_struct($base . ($url[1] ? '?' . $url[1] : ''), $path);
}
// ###################################################################
$html = '/ ';
$itembit = '/';
- $temp = preg_split('#/#', $this->path, -1, PREG_SPLIT_NO_EMPTY);
+ $temp = preg_split('#/#', $this->fullpath, -1, PREG_SPLIT_NO_EMPTY);
$count = count($temp) - 1;
foreach ($temp AS $val => $item)
{
$itembit .= $item;
$itembit .= (($count != $val OR $this->cachev->isdir($itembit)) ? '/' : '');
- $html .= '<a href="' . $this->href_struct('browse.php' . $this->revstr, $itembit) . '">' . $item . '</a>'. ($count != $val ? ' / ' : '');
+ $html .= '<a href="' . $this->href_struct('browse.php' . $this->revstr, ($val == 0 ? '' : $itembit)) . '">' . $item . '</a>'. ($count != $val ? ' / ' : '');
}
return $html;
{
if (isset($viewsvn->in['rev']) AND is_null($high))
{
- $rev = $viewsvn->svn->rev($viewsvn->in['rev']);
+ $rev = SVNCommon::rev($viewsvn->in['rev']);
}
else if (is_null($high))
{
return $files;
}
+
+ /**
+ * Generates a clean revision number
+ *
+ * @access public
+ *
+ * @param integer Revision number
+ *
+ * @return mixed Cleaned revision or HEAD
+ */
+ function rev($revision)
+ {
+ if (($revision = intval($revision)) < 1)
+ {
+ $revision = 'HEAD';
+ }
+ return $revision;
+ }
}
/**
{
global $viewsvn;
- $revision = $this->rev($revision);
+ $revision = SVNCommon::rev($revision);
$repospath = $viewsvn->repos->fetch_path($repos, false);
return $this->svn($command . ' ' . $repospath . $path . '@' . $revision);
{
return $this->std('list', $repos, $path, $revision);
}
-
- /**
- * Generates a clean revision number
- *
- * @access public
- *
- * @param integer Revision number
- *
- * @return mixed Cleaned revision or HEAD
- */
- function rev($revision)
- {
- if (($revision = intval($revision)) < 1)
- {
- $revision = 'HEAD';
- }
- return $revision;
- }
}
/*=====================================================================*\
<div class="content" style="border-width: 0px 1px 1px 1px">
<if condition="$show['directory']">
- <a href="$viewsvn->path/$browse"><strong>$item</strong></a>
+ <a href="$browse"><strong>$item</strong></a>
<else />
- <a href="$viewsvn->path/$view">$item</a>
+ <a href="$view">$item</a>
</if>
<span class="nodelink">
- <if condition="!$show['directory']"><a href="$viewsvn->path/$blame">{@"Blame"}</a> - </if>
- <a href="$viewsvn->path/$log">{@"View Log"}</a>
+ <if condition="!$show['directory']"><a href="$blame">{@"Blame"}</a> - </if>
+ <a href="$log">{@"View Log"}</a>
</span>
</div>
\ No newline at end of file