$label";
return $anchor;
}
function image($src, $alt = '', $title = '')
{
$image = "
[{$matches[1]}] ";
$clean_path = $matches[2];
}
// Tag Commit
else if(preg_match("%^{$changelog['tags']}$sep([^$sep]+)(.*)$%", $path, $matches))
{
$text .= "[{$matches[1]}] ";
$clean_path = $matches[2];
}
else
$clean_path = $path;
if($clean_path == '') $clean_path = $pathsep;
if($action == '')
$text .= "{$clean_path}";
else
$text .= "{$clean_path}";
return $text;
}
function svnlog_format_change($revision, $action, $path, $copy_path = '', $copy_revision = '')
{
global $icons, $changelog;
$output = '';
$output .= " " . image($icons[$action], $action) . " ";
$output .= svnlog_format_path($path, $action);
if($changelog['diff_url'] != '')
{
$output .= " [";
switch($action)
{
case 'M':
$previous_revision = $revision - 1;
$output .= anchor("{$changelog['diff_url']}{$path}?" .
"r1={$previous_revision}&r2={$revision}" .
"&pathrev={$revision}", "diff");
$output .= ", " . anchor("{$changelog['diff_url']}{$path}?" .
"view=log&pathrev={$revision}", "log");
break;
case 'D':
$previous_revision = $revision - 1;
$output .= anchor("{$changelog['diff_url']}{$path}?view=log" .
"&pathrev={$previous_revision}", "old log");
break;
default: // 'A' and 'R' are basically the same for needed links.
$output .= anchor("{$changelog['diff_url']}{$path}?view=log" .
"&pathrev={$revision}", "log");
break;
}
if($changelog['link_files'] && $action != 'D')
$output .= ", " . anchor("{$changelog['svn_root']}{$path}", "file");
$output .= "]";
}
else if($changelog['link_files'] && $action != 'D')
{
$output .= " [";
$output .= anchor("{$changelog['svn_root']}{$path}", "file");
$output .= "]";
}
if($copy_path != '')
{
if($changelog['diff_url'] != '')
$output .= " (copied from " . anchor("{$changelog['diff_url']}{$copy_path}?" .
"view=log&pathrev={$copy_revision}", "r{$copy_revision}") . " of ";
else
$output .= " (copied from r{$copy_revision} of ";
$output .= svnlog_format_path($copy_path) . ")";
}
$output .= "
\n";
return $output;
}
function svnlog_format_message($message)
{
$formatted = array();
$tokenized = explode("\n", $message);
foreach($tokenized as $line)
{
$line = htmlspecialchars($line); $x = 0;
while($x < strlen($line)) { if($line[$x] != ' ') break; $x++; }
$space = str_repeat(' ', (int)($x / 2));
$line = $space . substr($line, $x - ($x % 2));
$formatted[] = ' ' . $line;
}
if(trim(end($tokenized)) == '') array_pop($formatted);
return implode($formatted, "\n
");
}
if(!function_exists('http_build_query'))
{
function http_build_query($data, $prefix = null, $separator = null, $key = null)
{
$res = array();
foreach((array)$data as $k => $v)
{
$tmp_key = is_int($k) ? $prefix . $k : $k;
if($key) $tmp_key = $key.'['.$tmp_key.']';
if(is_array($v) || is_object($v))
$res[] = http_build_query($v, $prefix, $separator, $tmp_key);
else
$res[] = urlencode($tmp_key) . "=" . urlencode($v);
}
if($separator == null) $separator = ini_get('arg_separator.output');
return implode($separator, $res);
}
}
?>