コード例 #1
0
ファイル: cvs.php プロジェクト: Artea/freebeer
 * See the enclosed file COPYING for license information (GPL).  If you
 * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
 */
@define('CHORA_BASE', dirname(__FILE__));
require_once CHORA_BASE . '/lib/base.php';
require_once HORDE_BASE . '/config/mime_drivers.php';
require_once HORDE_LIBS . 'Horde/MIME/Magic.php';
require_once HORDE_LIBS . 'Horde/MIME/Viewer.php';
require_once CHORA_BASE . '/config/mime_drivers.php';
if ($atdir) {
    Chora::checkError($dir = $VC->queryDir($where));
    $atticFlags = (bool) $acts['sa'];
    Chora::checkError($dir->browseDir(true, $atticFlags));
    $dir->applySort($acts['sbt'], $acts['ord']);
    Chora::checkError($dirList =& $dir->queryDirList());
    Chora::checkError($fileList = $dir->queryFileList($atticFlags));
    /* Decide what title to display. */
    if ($where == '') {
        $title = $conf['options']['introTitle'];
    } else {
        $title = sprintf(_("Source Directory of /%s"), Text::htmlallSpaces($where));
    }
    if (is_a($VC, 'VC_svn')) {
        // Showing deleted files is not supported in svn.
        $extraLink = '';
    } else {
        if ($acts['sa']) {
            $extraLink = '<a class="widget" href="' . Chora::url('cvs', $where . '/', array('sa' => 0)) . '">' . _("Hide Deleted Files") . '</a>';
        } else {
            $extraLink = '<a class="widget" href="' . Chora::url('cvs', $where . '/', array('sa' => 1)) . '">' . _("Show Deleted Files") . '</a>';
        }
コード例 #2
0
ファイル: annotate.php プロジェクト: Artea/freebeer
 * Copyright 2000-2004 Anil Madhavapeddy <*****@*****.**>
 *
 * See the enclosed file COPYING for license information (GPL).  If you
 * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
 */
define('CHORA_BASE', dirname(__FILE__));
require_once CHORA_BASE . '/lib/base.php';
/* Spawn the file object. */
$fl =& $VC->getFileObject($where);
/* Retrieve the desired revision from the GET variable. */
$rev = Util::getFormData('rev', '1.1');
if (!VC_Revision::valid($rev)) {
    Chora::fatal('404 Not Found', "Revision {$rev} not found");
}
$ann =& $VC->getAnnotateObject($fl);
Chora::checkError($lines = $ann->doAnnotate($rev));
$title = sprintf(_("Source Annotation of %s for version %s"), Text::htmlAllSpaces($where), $rev);
$extraLink = sprintf('<a href="%s">%s</a> <b>|</b> <a href="%s">%s</a>', Chora::url('co', $where, array('r' => $rev)), _("View"), Chora::url('co', $where, array('r' => $rev, 'p' => 1)), _("Download"));
require CHORA_TEMPLATES . '/common-header.inc';
Chora::menu();
require CHORA_TEMPLATES . '/headerbar.inc';
require CHORA_TEMPLATES . '/annotate/header.inc';
$author = '';
$style = 0;
foreach ($lines as $line) {
    $lineno = $line['lineno'];
    $prevAuthor = $author;
    $author = Chora::showAuthorName($line['author']);
    if ($prevAuthor != $author) {
        $style = ++$style % 3;
    }
コード例 #3
0
ファイル: co.php プロジェクト: Artea/freebeer
    $r = $file->queryRevision();
    header('Cache-Control: max-age=60, must-revalidate');
} else {
    header('Cache-Control: max-age=2419200');
}
/* Is this a valid revision being requested? */
if (!VC_Revision::valid($r)) {
    Chora::fatal('404 Not Found', "Revision Not Found: {$r} is not a valid RCS revision number");
}
/* Retrieve the actual checkout. */
$checkOut = $VC->getCheckout($file, $r);
/* Get the MIME type of the file, or at least our best guess at it. */
$mime_type = MIME_Magic::filenameToMIME($fullname);
/* Check error status, and either show error page, or the checkout
 * contents */
Chora::checkError($checkOut);
if (!$plain) {
    /* Pretty-print the checked out copy */
    $pretty =& Chora::pretty($mime_type, $checkOut);
    if (($pretty->getType() == 'text/html' || $pretty->getType() == 'text/plain') && $pretty->canDisplayInline()) {
        $title = sprintf(_("Checkout of %s (revision %s)"), basename($fullname), $r);
        $extraLink = sprintf('<a href="%s">%s</a> <b>|</b> <a href="%s">%s</a>', Chora::url('annotate', $where, array('rev' => $r)), _("Annotate"), Chora::url('co', $where, array('r' => $r, 'p' => 1)), _("Download"));
        /* Make sure this revision exists. */
        if (empty($file->logs[$r])) {
            Chora::fatal(sprintf(_("Revision %s for file %s not found."), $r, $file));
        }
        /* Get this revision's attributes in printable form. */
        $log = $file->logs[$r];
        $commitDate = strftime('%c', $log->date);
        $readableDate = VC_File::readableTime($log->date, true);
        $aid = $log->queryAuthor();