Differential D20804 Diff 49608 src/applications/transactions/storage/PhabricatorModularTransactionType.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/storage/PhabricatorModularTransactionType.php
Show First 20 Lines • Show All 209 Lines • ▼ Show 20 Lines | abstract class PhabricatorModularTransactionType | ||||
final protected function renderPolicy($phid, $mode) { | final protected function renderPolicy($phid, $mode) { | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
$handles = $viewer->loadHandles(array($phid)); | $handles = $viewer->loadHandles(array($phid)); | ||||
$policy = PhabricatorPolicy::newFromPolicyAndHandle( | $policy = PhabricatorPolicy::newFromPolicyAndHandle( | ||||
$phid, | $phid, | ||||
$handles[$phid]); | $handles[$phid]); | ||||
if ($this->isTextMode()) { | $ref = $policy->newRef($viewer); | ||||
return $this->renderValue($policy->getFullName()); | |||||
} | |||||
if ($this->isTextMode()) { | |||||
$name = $ref->getPolicyDisplayName(); | |||||
} else { | |||||
$storage = $this->getStorage(); | $storage = $this->getStorage(); | ||||
if ($policy->getType() == PhabricatorPolicyType::TYPE_CUSTOM) { | $name = $ref->newTransactionLink($mode, $storage); | ||||
$policy->setHref('/transactions/'.$mode.'/'.$storage->getPHID().'/'); | |||||
$policy->setWorkflow(true); | |||||
} | } | ||||
return $this->renderValue($policy->renderDescription()); | return $this->renderValue($name); | ||||
} | } | ||||
final protected function renderHandleList(array $phids) { | final protected function renderHandleList(array $phids) { | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
$display = $viewer->renderHandleList($phids) | $display = $viewer->renderHandleList($phids) | ||||
->setAsInline(true); | ->setAsInline(true); | ||||
if ($this->isTextMode()) { | if ($this->isTextMode()) { | ||||
▲ Show 20 Lines • Show All 262 Lines • Show Last 20 Lines |