Exemplo n.º 1
0
            break;
        case 'diff':
            $file = 'diff.php';
            break;
        case 'blame':
            $file = 'blame.php';
            break;
        case 'rss':
            $file = 'rss.php';
            break;
        case 'dl':
            $file = 'dl.php';
            break;
        case 'comp':
            $file = 'comp.php';
            break;
        default:
            $svnrep = new SVNRepository($rep);
            if ($svnrep->isFile($path, $rev)) {
                $file = 'filedetails.php';
            } else {
                $file = 'listing.php';
            }
            break;
    }
    // Now include the file that handles it
    include $locwebsvnreal . '/' . $file;
} else {
    print '<p>MultiViews must be configured in include/config.php in order to use this file.</p>';
    exit;
}
Exemplo n.º 2
0
        $vars['rssurl'] = $config->getURL($rep, $path, 'rss') . ($peg ? 'peg=' . $peg : '');
        $vars['rsslink'] = '<a href="' . $vars['rssurl'] . '">' . $lang['RSSFEED'] . '</a>';
    }
    $changes = $logEntry ? $logEntry->mods : array();
    if (!is_array($changes)) {
        $changes = array();
    }
    usort($changes, 'SVNLogEntry_compare');
    $row = 0;
    $prevRevString = createRevAndPegString($rev - 1, $rev - 1);
    $thisRevString = createRevAndPegString($rev, $peg ? $peg : $rev);
    foreach ($changes as $file) {
        $linkRevString = $file->action == 'D' ? $prevRevString : $thisRevString;
        // NOTE: This is a hack (runs `svn info` on each path) to see if it's a file.
        // `svn log --verbose --xml` should really provide this info, but doesn't yet.
        $isFile = $svnrep->isFile($file->path, $rev);
        if (!$isFile && $file->path != '/') {
            $file->path .= '/';
        }
        $listing[] = array('path' => $file->path, 'added' => $file->action == 'A', 'deleted' => $file->action == 'D', 'modified' => $file->action == 'M', 'detailurl' => $config->getURL($rep, $file->path, $isFile ? 'file' : 'dir') . $linkRevString, 'logurl' => $config->getURL($rep, $file->path, 'log') . $linkRevString . ($isFile ? '' : '&amp;isdir=1'), 'diffurl' => $isFile && $file->action == 'M' ? $config->getURL($rep, $file->path, 'diff') . $linkRevString : '', 'blameurl' => $isFile && $file->action == 'M' ? $config->getURL($rep, $file->path, 'blame') . $linkRevString : '', 'rowparity' => $row);
        $row = 1 - $row;
    }
    if (isset($prevRev)) {
        $vars['compareurl'] = $config->getURL($rep, '/', 'comp') . 'compare[]=' . urlencode($prevPath) . '@' . $prevRev . '&amp;compare[]=' . urlencode($path) . '@' . $rev;
        $vars['comparelink'] = '<a href="' . $vars['compareurl'] . '">' . $lang['DIFFPREV'] . '</a>';
    }
    if (!$rep->hasReadAccess($path, true)) {
        $vars['error'] = $lang['NOACCESS'];
    }
    $vars['restricted'] = !$rep->hasReadAccess($path, false);
}