コード例 #1
0
ファイル: patchsets.php プロジェクト: Artea/freebeer
@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.
            $allDiffsLink = '';
        }
コード例 #2
0
ファイル: Chora.php プロジェクト: Artea/freebeer
 /**
  * Output an error page.
  *
  * @param string $msg  The verbose error message to be displayed.
  */
 function fatal($msg)
 {
     global $registry, $conf, $notification, $browser, $prefs;
     /* Don't store the bad file in the user's preferences. */
     $prefs->setValue('last_file', '');
     include CHORA_TEMPLATES . '/common-header.inc';
     $notification->push($msg, 'horde.error');
     Chora::menu();
     include $registry->getParam('templates', 'horde') . '/common-footer.inc';
     exit;
 }