2 /*=====================================================================*\
3 || ###################################################################
4 || # ViewSVN [#]version[#]
5 || # Copyright ©2002-[#]year[#] Iris Studios, Inc.
7 || # This program is free software; you can redistribute it and/or modify
8 || # it under the terms of the GNU General Public License as published by
9 || # the Free Software Foundation; version [#]gpl[#] of the License.
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
25 * This class represents one node in SVN. For each node that you need
26 * to display information about, create a new instance of this class.
27 * Generally, however, this one instance should be able to handle
28 * the needs of the entire class.
30 * @author Iris Studios, Inc.
31 * @copyright Copyright ©2002 - [#]year[#], Iris Studios, Inc.
53 * Xquery method library
67 * Full, universal path of the node
74 * Repository of the path
81 * The full path to the repository
88 * Relative path in the repository
94 // ###################################################################
100 function Node_Controller($nodepath)
105 $this->fullpath
= $nodepath;
107 $temp = preg_split('#/#', $this->fullpath
, -1, PREG_SPLIT_NO_EMPTY
);
109 $this->repos
= $temp[0];
112 $this->path
= '/' . implode('/', $temp);
115 $this->registry
=& $viewsvn;
117 $this->repospath
= $this->registry
->repos
->fetch_path($this->repos
);
119 require_once('./includes/shellcmd.php');
120 $this->xquery
= new Shell($this);
122 require_once('./includes/svnlib.php');
123 $this->library
= new SVNLib($this);
125 require_once('./includes/cachev.php');
126 $this->cachev
= new cacheV($this);
129 // ###################################################################
131 * Constructs a repository browser link
135 * @param string Base path
136 * @param string Browser path, separated using '/'
138 * @return string Link path
140 function out($base, $addpath = null
)
144 if ($addpath === null
)
146 $addpath = $this->path
;
149 $url = Paths
::fetch_arguments($base);
150 $addpath = Paths
::sanitize($addpath);
153 if ($this->registry
->paths
->type
== 1)
155 return $url[0] . '?path=' . $addpath . ($url[1] ?
'&' . $url[1] : '');
157 // advanced path system
158 else if ($this->registry
->paths
->type
== 2)
160 return $url[0] . '/' . $this->repos
. ($addpath{0} != '/' ?
'/' : '') . $addpath . ($url[1] ?
'?' . $url[1] : '');
164 // ###################################################################
166 * Create path breadcrumb
170 * @return string Breadcrumb HTML
172 function construct_breadcrumb()
177 $temp = preg_split('#/#', $this->path
, -1, PREG_SPLIT_NO_EMPTY
);
178 $count = count($temp) - 1;
180 foreach ($temp AS $val => $item)
183 $itembit .= (($count != $val OR $this->cachev
->isdir($itembit)) ?
'/' : '');
184 $html .= '<a href="' . $this->registry
->path
. '/' . $this->out('browse.php' . $this->revstr
, $itembit) . '">' . $item . '</a>'. ($count != $val ?
' / ' : '');
191 /*=====================================================================*\
192 || ###################################################################
195 || ###################################################################
196 \*=====================================================================*/