本文整理汇总了PHP中PhabricatorApplicationTransaction::renderChangeDetails方法的典型用法代码示例。如果您正苦于以下问题:PHP PhabricatorApplicationTransaction::renderChangeDetails方法的具体用法?PHP PhabricatorApplicationTransaction::renderChangeDetails怎么用?PHP PhabricatorApplicationTransaction::renderChangeDetails使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhabricatorApplicationTransaction
的用法示例。
在下文中一共展示了PhabricatorApplicationTransaction::renderChangeDetails方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderChangeDetails
public final function renderChangeDetails(PhabricatorUser $viewer)
{
$impl = $this->getTransactionImplementation();
$impl->setViewer($viewer);
$view = $impl->newChangeDetailView();
if ($view !== null) {
return $view;
}
return parent::renderChangeDetails($viewer);
}
示例2: renderChangeDetails
public function renderChangeDetails(PhabricatorUser $viewer)
{
switch ($this->getTransactionType()) {
case self::TYPE_DESCRIPTION:
$old = $this->getOldValue();
$new = $this->getNewValue();
return $this->renderTextCorpusChangeDetails($viewer, $old, $new);
case self::TYPE_PATHS:
$old = $this->getOldValue();
$new = $this->getNewValue();
$diffs = PhabricatorOwnersPath::getTransactionValueChanges($old, $new);
list($rem, $add) = $diffs;
$rows = array();
foreach ($rem as $ref) {
$rows[] = array('class' => 'diff-removed', 'change' => '-') + $ref;
}
foreach ($add as $ref) {
$rows[] = array('class' => 'diff-added', 'change' => '+') + $ref;
}
$rowc = array();
foreach ($rows as $key => $row) {
$rowc[] = $row['class'];
$rows[$key] = array($row['change'], $row['excluded'] ? pht('Exclude') : pht('Include'), $viewer->renderHandle($row['repositoryPHID']), $row['path']);
}
$table = id(new AphrontTableView($rows))->setRowClasses($rowc)->setHeaders(array(null, pht('Type'), pht('Repository'), pht('Path')))->setColumnClasses(array(null, null, null, 'wide'));
return $table;
}
return parent::renderChangeDetails($viewer);
}
示例3: renderChangeDetails
public function renderChangeDetails(PhabricatorUser $viewer)
{
switch ($this->getTransactionType()) {
case self::TYPE_DESCRIPTION:
$old = $this->getOldValue();
$new = $this->getNewValue();
return $this->renderTextCorpusChangeDetails($viewer, $old, $new);
}
return parent::renderChangeDetails($viewer);
}
示例4: renderChangeDetails
public function renderChangeDetails(PhabricatorUser $viewer)
{
switch ($this->getTransactionType()) {
case self::TYPE_CONTENT:
$old = $this->getOldValue();
$new = $this->getNewValue();
$files = id(new PhabricatorFileQuery())->setViewer($viewer)->withPHIDs(array_filter(array($old, $new)))->execute();
$files = mpull($files, null, 'getPHID');
$old_text = '';
if (idx($files, $old)) {
$old_text = $files[$old]->loadFileData();
}
$new_text = '';
if (idx($files, $new)) {
$new_text = $files[$new]->loadFileData();
}
return $this->renderTextCorpusChangeDetails($viewer, $old_text, $new_text);
}
return parent::renderChangeDetails($viewer);
}