} exit; } if (!$VC->isValidRevision($rev)) { Chora::fatal(sprintf(_("Revision %s not found"), $rev), '404 Not Found'); } try { $lines = $VC->annotate($fl, $rev); } catch (Horde_Vcs_Exception $e) { Chora::fatal($e); } $title = sprintf(_("Source Annotation (revision %s) for:"), $rev); $page_output->addScriptFile('annotate.js'); $page_output->addInlineJsVars(array('var Chora' => array('ANNOTATE_URL' => (string) Horde::url('annotate.php', true)->add(array('actionID' => 'log', 'rt' => $sourceroot, 'f' => $where, 'rev' => '')), 'loading_text' => _("Loading...")))); Chora::header($title); echo Chora::getFileViews($where, $rev)->render('annotate'); require CHORA_TEMPLATES . '/annotate/header.inc'; $author = ''; $style = 0; while (list(, $line) = each($lines)) { $lineno = $line['lineno']; $author = Chora::showAuthorName($line['author']); $prevRev = $rev; $rev = $line['rev']; if ($prevRev != $rev) { $style = ++$style % 2; } $prev = $fl->getPreviousRevision($rev); $line = $GLOBALS['injector']->getInstance('Horde_Core_Factory_TextFilter')->filter($line['line'], 'space2html', array('encode' => true, 'encode_all' => true)); include CHORA_TEMPLATES . '/annotate/line.inc'; }
* 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'; // Exit if cvsps isn't active or it's not a subversion repository. if (empty($conf['paths']['cvsps']) && !is_a($VC, 'VC_svn')) { header('Location: ' . Chora::url('cvs', $where)); exit; } if (@is_dir($fullname)) { Chora::fatal('No patchsets for directories yet.'); } elseif ($VC->isFile($fullname)) { $ps = $VC->getPatchsetObject($where); $title = sprintf(_("Patchsets for %s"), Text::htmlallspaces($where)); $upwhere = preg_replace('|[^/]+$|', '', $where); $extraLink = Chora::getFileViews(); require CHORA_TEMPLATES . '/common-header.inc'; Chora::menu(); require CHORA_TEMPLATES . '/headerbar.inc'; foreach ($ps->_patchsets as $id => $patchset) { $commitDate = strftime('%c', $patchset['date']); $readableDate = VC_File::readableTime($patchset['date'], true); $author = Chora::showAuthorName($patchset['author'], true); if (is_a($VC, 'VC_svn')) { // The diff should be from the top of the source tree so // as to get all files. $topDir = substr($where, 0, strpos($where, '/', 1)); // Subversion supports patchset diffs natively. $allDiffsLink = Horde::link(Chora::url('diff', $topDir, array('r1' => $id - 1, 'r2' => $id, 'ty' => 'u')), _("Diff All Files")) . _("Diff All Files") . '</a>'; } else { // Not supported in any other VC systems yet.
$rendered = '<div class="fixed">' . $GLOBALS['injector']->getInstance('Horde_Core_Factory_TextFilter')->filter($data['data'], 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO)) . '</div>'; } elseif (strpos($mime_type, 'image/') !== false) { $rendered = Horde::img(Horde::selfUrl(true)->add('p', 1), '', '', ''); } elseif ($pretty->canRender('inline')) { $data = $pretty->render('inline'); $data = reset($data); $rendered = $data['data']; } else { $rendered = Horde::link(Horde::selfUrl(true)->add('p', 1)) . Horde::img('download.png') . ' ' . sprintf(_("Download revision %s"), $r) . '</a>'; } /* Get this revision's attributes in printable form. */ $log = $file->getLog($r); $title = sprintf(_("Revision %s (%s ago) for:"), $r, Chora::readableTime($log->getDate(), true)); $page_output->addScriptFile('stripe.js', 'horde'); Chora::header($title); echo Chora::getFileViews($where, $r)->render('co'); require CHORA_TEMPLATES . '/checkout/checkout.inc'; $page_output->footer(); exit; } /* Download the file. */ // Get data. $content = ''; while ($line = fgets($checkOut)) { $content .= $line; } fclose($checkOut); // Get name. $filename = $file->getFileName(); if ($browser->getBrowser() == 'opera') { $filename = strtr($filename, ' ', '_');