fullpath = $nodepath; $temp = preg_split('#/#', $this->fullpath, -1, PREG_SPLIT_NO_EMPTY); $this->repos = $temp[0]; unset($temp[0]); $this->path = '/' . implode('/', $temp); // objects $this->registry =& $viewsvn; $this->repospath = $this->registry->repos->fetch_path($this->repos); $this->revnum = Paths::fetch_rev_num(); $this->revstr = Paths::fetch_rev_str(); require_once('./includes/shellcmd.php'); $this->xquery = new Shell($this); require_once('./includes/svnlib.php'); $this->library = new SVNLib($this); require_once('./includes/cachev.php'); $this->cachev = new cacheV($this); $this->revctx = $this->cachev->fetch_revision_context($this->revnum); $this->revctx = $this->revctx['revision']; } // ################################################################### /** * 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($path); 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) * @param bool Attach a given revision string, null for none * * @return string Constructed path */ function href_compound($base, $attach = null, $revstr = null) { $url = Paths::fetch_arguments($base . ($revstr === null ? ((strpos($base, '?') !== false) ? '&' . $this->revstr : $this->revstr) : $revstr)); if ($attach === null) { $path = $this->path; } else { $attach = Paths::sanitize($attach); $path = $this->path . (($attach[0] != '/' AND $this->path[ strlen($this->path) - 1 ] != '/') ? '/' : '') . $attach; } return $this->href_struct($base . ($url[1] ? '?' . $url[1] : ''), $path); } // ################################################################### /** * Create path breadcrumb * * @access public * * @return string Breadcrumb HTML */ function construct_breadcrumb() { $html = '/ '; $temp = preg_split('#/#', $this->fullpath, -1, PREG_SPLIT_NO_EMPTY); $count = sizeof($temp) - 1; $donerepos = false; foreach ($temp AS $val => $item) { if ($donerepos != false) { $itembit .= $item; $this->registry->debug($item . " > " . $itembit); $itembit .= (($count != $val OR $this->cachev->isdir($itembit)) ? '/' : ''); } $donerepos = true; $html .= '' . $item . ''. ($count != $val ? ' / ' : ''); } return $html; } } /*=====================================================================*\ || ################################################################### || # $HeadURL$ || # $Id$ || ################################################################### \*=====================================================================*/ ?>