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 \*=====================================================================*/
23 * Common functions that aren't Xquery-related and advanced query systems
29 * This is a utility class that should be accessed in a static fashion. It
30 * is responsbile for various parsing mechanisms, mainly.
37 // ###################################################################
39 * Prints the file changed list
43 * @public array List of file changes
44 * @public string The repository
45 * @public integer Current revision
47 * @return string Processed HTML
49 function construct_file_changes($changes, $repos, $revision)
55 foreach ($changes AS $file)
57 switch ($file['action'])
61 $tooltip = $viewsvn->lang
->string('Added');
64 $class = 'file_delete';
65 $tooltip = $viewsvn->lang
->string('Deleted');
68 $class = 'file_modify';
69 $tooltip = $viewsvn->lang
->string('Modified');
72 $class = 'file_replace';
73 $tooltip = $viewsvn->lang
->string('Replaced');
77 $show['from'] = (bool
)$file['from'];
82 $tooltip = 'Moved/Copied';
83 preg_match('#(.*):([0-9]+)#', $file['from'], $matches);
84 $link['from'] = $viewsvn->path
. '/view.php/' . $repos . '/' . $matches[1] . Paths
::fetch_rev_str(false
, $matches[2]);
87 $link['file'] = $viewsvn->path
. '/view.php/' . $repos . $file['value'] . Paths
::fetch_rev_str(false
, $revision);
89 eval('$files .= "' . $viewsvn->template
->fetch('file_change') . '";');
95 // ###################################################################
97 * Generates a clean revision number
101 * @param integer Revision number
103 * @return mixed Cleaned revision or HEAD
105 function rev($revision)
107 if (($revision = intval($revision)) < 1)
115 /*=====================================================================*\
116 || ###################################################################
119 || ###################################################################
120 \*=====================================================================*/