$this->cachev = new cacheV($this);
}
+ // ###################################################################
+ /**
+ * Produces a link href that allows for a completely different path
+ * than the one in the controller. This is used for navigating upstream.
+ *
+ * @access public
+ *
+ * @param string Base path (e.g. browse.php)
+ * @param string New relative path
+ *
+ * @return string Constructed path
+ */
+ function href_struct($base, $path)
+ {
+ $url = Paths::fetch_arguments($base);
+ $path = Paths::sanitize($addpath);
+
+ return $this->registry->path . '/' . $url[0] . '/' . $this->repos . ($path{0} != '/' ? '/' : '') . $path . ($url[1] ? '?' . $url[1] : '');
+ }
+
+ // ###################################################################
+ /**
+ * Compounds a path by adding another level. This is used for navigating
+ * downstream.
+ *
+ * @access public
+ *
+ * @param string Base path (e.g. browse.php)
+ * @param string Attach path (or none for current)
+ *
+ * @return string Constructed path
+ */
+ function href_compound($base, $attach = null)
+ {
+ $url = Paths::fetch_arguments($base);
+ $attach = Paths::sanitize($attach);
+
+ if ($attach === null)
+ {
+ $path = $this->path;
+ }
+ else
+ {
+ $path = $this->path . ($attach{0} != '/' ? '/' : '') . $attach;
+ }
+
+ return $this->href_struct($base, $path);
+ }
+
// ###################################################################
/**
* Constructs a repository browser link
{
$itembit .= $item;
$itembit .= (($count != $val OR $this->cachev->isdir($itembit)) ? '/' : '');
- $html .= '<a href="' . $this->registry->path . '/' . $this->out('browse.php' . $this->revstr, $itembit) . '">' . $item . '</a>'. ($count != $val ? ' / ' : '');
+ $html .= '<a href="' . $this->href_struct('browse.php' . $this->revstr, $itembit) . '">' . $item . '</a>'. ($count != $val ? ' / ' : '');
}
return $html;