$prevRev = $history->entries[1]->rev; $prevPath = $history->entries[1]->path; $vars['prevrev'] = $prevRev; $vars['prevrevurl'] = $revurl . 'rev=' . $prevRev; //echo 'PREV='.$vars['prevrevurl'].'<br/>'; } // Save the entry from which we pull information for the current revision. $logEntry = isset($history->entries[0]) ? $history->entries[0] : null; $bugtraq = new Bugtraq($rep, $svnrep, $ppath); $vars['action'] = ''; $vars['rev'] = $rev; $vars['peg'] = $peg; $vars['path'] = htmlentities($ppath, ENT_QUOTES, 'UTF-8'); $vars['date'] = $logEntry ? $logEntry->date : ''; $vars['author'] = $logEntry ? $logEntry->author : ''; $vars['log'] = $logEntry ? nl2br($bugtraq->replaceIDs(create_anchors(xml_entities($logEntry->msg)))) : ''; $isDir = @$_REQUEST['isdir'] == 1 || $path == '' || $path == '/'; $vars['logurl'] = $config->getURL($rep, $path, 'log') . $passRevString . ($isDir ? '&isdir=1' : ''); $vars['loglink'] = '<a href="' . $vars['logurl'] . '">' . $lang['VIEWLOG'] . '</a>'; $dirPath = $isDir ? $path : dirname($path) . '/'; $vars['directoryurl'] = $config->getURL($rep, $dirPath, 'dir') . $passRevString . '#' . anchorForPath($dirPath); $vars['directorylink'] = '<a href="' . $vars['directoryurl'] . '">' . $lang['LISTING'] . '</a>'; if ($path != $dirPath) { $vars['filedetailurl'] = $config->getURL($rep, $path, 'file') . $passRevString; $vars['filedetaillink'] = '<a href="' . $vars['filedetailurl'] . '">' . $lang['FILEDETAIL'] . '</a>'; $vars['blameurl'] = $config->getURL($rep, $path, 'blame') . $passRevString; $vars['blamelink'] = '<a href="' . $vars['blameurl'] . '">' . $lang['BLAME'] . '</a>'; } if ($rep->isRssEnabled()) { $vars['rssurl'] = $config->getURL($rep, $path, 'rss') . ($peg ? 'peg=' . $peg : ''); $vars['rsslink'] = '<a href="' . $vars['rssurl'] . '">' . $lang['RSSFEED'] . '</a>';
} } // Find the parent path (or the whole path if it's already a directory) $pos = strrpos($rpath, '/'); $parent = substr($rpath, 0, $pos + 1); $compareValue = ($isDir ? $parent : $rpath) . '@' . $thisrev; $listing[$index]['compare_box'] = '<input type="checkbox" name="compare[]" value="' . $compareValue . '" onclick="checkCB(this)" />'; $url = $config->getURL($rep, $rpath, 'revision') . $thisRevString; $listing[$index]['revlink'] = '<a href="' . $url . '">' . $thisrev . '</a>'; $url = $config->getURL($rep, $rpath, $isDir ? 'dir' : 'file') . $thisRevString; $listing[$index]['revpathlink'] = '<a href="' . $url . '">' . $rpath . '</a>'; $listing[$index]['revpath'] = $rpath; $listing[$index]['revauthor'] = $revision->author; $listing[$index]['revdate'] = $revision->date; $listing[$index]['revage'] = $revision->age; $listing[$index]['revlog'] = nl2br($bugtraq->replaceIDs(create_anchors(xml_entities($revision->msg)))); $listing[$index]['rowparity'] = $row; if ($showchanges) { // Aggregate added/deleted/modified paths for display in table $modpaths = array(); foreach ($revision->mods as $mod) { $modpaths[$mod->action][] = $mod->path; } ksort($modpaths); foreach ($modpaths as $action => $paths) { sort($paths); $modpaths[$action] = $paths; } $listing[$index]['revadded'] = isset($modpaths['A']) ? implode('<br/>', $modpaths['A']) : ''; $listing[$index]['revdeleted'] = isset($modpaths['D']) ? implode('<br/>', $modpaths['D']) : ''; $listing[$index]['revmodified'] = isset($modpaths['M']) ? implode('<br/>', $modpaths['M']) : '';