Skip to content

Commit

Permalink
fixed fileurl and logurl in list-view for later deleted items (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirk-thomas committed Dec 8, 2010
1 parent 5290327 commit d39aec9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
7 changes: 7 additions & 0 deletions include/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ function createRevAndPegString($rev, $peg) {
return implode('&', $params);
}

function createDifferentRevAndPegString($rev, $peg) {
$params = array();
if ($rev && (!$peg || $rev != $peg)) $params[] = 'rev='.$rev;
if ($peg) $params[] = 'peg='.$peg;
return implode('&', $params);
}

function anchorForPath($path) {
global $config;

Expand Down
12 changes: 10 additions & 2 deletions listing.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,17 @@ function showDirFiles($svnrep, $subs, $level, $limit, $rev, $peg, $listing, $ind
$listing[$index]['node'] = 0; // t-node
$listing[$index]['path'] = $path.$file;
$listing[$index]['filename'] = $file;
$listing[$index]['fileurl'] = urlForPath($path.$file, $passRevString);
if ($isDir) {
$listing[$index]['fileurl'] = urlForPath($path.$file, $passRevString);
} else {
$listing[$index]['fileurl'] = urlForPath($path.$file, createDifferentRevAndPegString($passrev, $peg));
}
$listing[$index]['filelink'] = '<a href="'.$listing[$index]['fileurl'].'">'.$listing[$index]['filename'].'</a>';
$listing[$index]['logurl'] = $config->getURL($rep, $path.$file, 'log').$isDirString.$passRevString;
if ($isDir) {
$listing[$index]['logurl'] = $config->getURL($rep, $path.$file, 'log').$isDirString.$passRevString;
} else {
$listing[$index]['logurl'] = $config->getURL($rep, $path.$file, 'log').$isDirString.createDifferentRevAndPegString($passrev, $peg);
}

if ($treeview) {
$listing[$index]['compare_box'] = '<input type="checkbox" name="compare[]" value="'.$path.$file.'@'.$passrev.'" onclick="checkCB(this)" />';
Expand Down

0 comments on commit d39aec9

Please sign in to comment.