Convert a commit-name into whatever the user wants.
public static showAuthorName ( string $name, $fullname = false ) : string | ||
$name | string | Account name. |
return | string | The transformed name. |
$rev = $row[$i]; // if ($VC->isValidRevision($rev) && ($VC->sizeof($rev) % 2)) { if ($VC->isValidRevision($rev)) { /* This is a branch point, so put the info out. */ $bg = isset($branch_colors[$rev]) ? $branch_colors[$rev] : '#e9e9e9'; $symname = $fl->branches[$rev]; require CHORA_TEMPLATES . '/history/branch_cell.inc'; } elseif (preg_match('|^:|', $rev)) { /* This is a continuation cell, so render it with the * branch colour. */ // $bgbr = $VC->strip(preg_replace('|^\:|', '', $rev), 1); $bg = isset($branch_colors[$bgbr]) ? $branch_colors[$bgbr] : '#e9e9e9'; require CHORA_TEMPLATES . '/history/blank.inc'; } elseif ($VC->isValidRevision($rev)) { /* This cell contains a revision, so render it. */ // $bgbr = $VC->strip($rev, 1); $bg = isset($branch_colors[$bgbr]) ? $branch_colors[$bgbr] : '#e9e9e9'; $log = $fl->getLog($rev); $author = Chora::showAuthorName($log->getAuthor()); $date = strftime('%e %b %Y', $log->getDate()); $lines = $log->getChanges(); require CHORA_TEMPLATES . '/history/rev.inc'; } else { /* Exhausted other possibilities, just show a blank cell. */ require CHORA_TEMPLATES . '/history/blank.inc'; } } echo '</tr>'; } require CHORA_TEMPLATES . '/history/footer.inc'; $page_output->footer();
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 = ''; } $files = array(); $dir = dirname($where); foreach ($patchset['members'] as $member) { $file = array(); $mywhere = is_a($VC, 'VC_svn') ? $member['file'] : $dir . DIRECTORY_SEPARATOR . $member['file'];
} 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'; } require CHORA_TEMPLATES . '/annotate/footer.inc'; $page_output->footer();
} /* Otherwise, this cell has content; determine what it is */ $rev = $row[$i]; if (VC_Revision::valid($rev) && VC_Revision::sizeof($rev) % 2) { /* This is a branch point, so put the info out */ $bg = isset($branchColours[$rev]) ? $branchColours[$rev] : 'white'; $symname = $fl->branches[$rev]; require CHORA_TEMPLATES . '/history/branch_cell.inc'; } elseif (preg_match('|^:|', $rev)) { /* This is a continuation cell, so render it with the branch colour */ $bgbr = VC_Revision::strip(preg_replace('|^\\:|', '', $rev), 1); $bg = isset($branchColours[$bgbr]) ? $branchColours[$bgbr] : 'white'; require CHORA_TEMPLATES . '/history/blank.inc'; } elseif (VC_Revision::valid($rev)) { /* This cell contains a revision, so render it */ $bgbr = VC_Revision::strip($rev, 1); $bg = isset($branchColours[$bgbr]) ? $branchColours[$bgbr] : 'white'; $log = $fl->logs[$rev]; $author = Chora::showAuthorName($log->queryAuthor()); $date = strftime('%e %b %Y', $log->queryDate()); $lines = $log->queryChangedLines(); require CHORA_TEMPLATES . '/history/rev.inc'; } else { /* Exhausted other possibilities, just show a blank cell */ require CHORA_TEMPLATES . '/history/blank.inc'; } } require CHORA_TEMPLATES . '/history/row_end.inc'; } require CHORA_TEMPLATES . '/history/footer.inc'; require $registry->getParam('templates', 'horde') . '/common-footer.inc';
} ?> </div> <?php } ?> <div class="commit-message"><?php echo Chora::formatLogMessage($logMessage['log']); ?> </div> <div class="commit-author"> <div class="commit-author-avatar"> <img src="http://www.gravatar.com/avatar/<?php echo md5(strtolower(trim(Chora::getAuthorEmail($logMessage['author'])))); ?> ?d=mm&s=40" /> </div> <?php echo Chora::showAuthorName($logMessage['author'], true); ?> <br /> <?php echo Chora::formatDate($logMessage['date']); ?> </div> <div class="clear"> </div> </div>
* less, then let the revision through, since it was * committed before the branch actually took place */ if (VC_Revision::cmp($rev, $baseRev) > 0) { continue; } } else { continue; } } } $textURL = Chora::url('co', $where, array('r' => $rev)); $commitDate = strftime('%c', $lg->date); $readableDate = VC_File::readableTime($lg->date, true); $aid = $lg->queryAuthor(); $author = Chora::showAuthorName($aid, true); if (!empty($lg->tags)) { $commitTags = implode(', ', $lg->tags); } else { $commitTags = ''; } $branchPointsArr = array(); foreach ($lg->querySymbolicBranches() as $symb => $bra) { $branchPointsArr[] = '<a href="' . Chora::url('cvs', $where, array('onb' => $bra)) . '">' . $symb . '</a>'; } /* Calculate the current branch name and revision. */ $branchPoints = implode(' , ', $branchPointsArr); $branchRev = VC_Revision::strip($rev, 1); if (@isset($fl->branches[$branchRev])) { $branchName = $fl->branches[$branchRev]; } else {