Changeset View
Changeset View
Standalone View
Standalone View
src/applications/herald/adapter/HeraldAdapter.php
Show First 20 Lines • Show All 1,206 Lines • ▼ Show 20 Lines | if ($impl) { | ||||
$viewer, | $viewer, | ||||
$condition->getValue()); | $condition->getValue()); | ||||
} | } | ||||
$value = $condition->getValue(); | $value = $condition->getValue(); | ||||
if (!is_array($value)) { | if (!is_array($value)) { | ||||
$value = array($value); | $value = array($value); | ||||
} | } | ||||
switch ($condition->getFieldName()) { | |||||
case HeraldPreCommitRefAdapter::FIELD_REF_CHANGE: | |||||
$change_map = | |||||
PhabricatorRepositoryPushLog::getHeraldChangeFlagConditionOptions(); | |||||
foreach ($value as $index => $val) { | |||||
$name = idx($change_map, $val); | |||||
if ($name) { | |||||
$value[$index] = $name; | |||||
} | |||||
} | |||||
break; | |||||
default: | |||||
foreach ($value as $index => $val) { | foreach ($value as $index => $val) { | ||||
$handle = $handles->getHandleIfExists($val); | $handle = $handles->getHandleIfExists($val); | ||||
if ($handle) { | if ($handle) { | ||||
$value[$index] = $handle->renderLink(); | $value[$index] = $handle->renderLink(); | ||||
} | } | ||||
} | } | ||||
break; | |||||
} | |||||
$value = phutil_implode_html(', ', $value); | $value = phutil_implode_html(', ', $value); | ||||
btrahan: nice | |||||
return $value; | return $value; | ||||
} | } | ||||
private function renderActionTargetAsText( | private function renderActionTargetAsText( | ||||
HeraldAction $action, | HeraldAction $action, | ||||
PhabricatorHandleList $handles) { | PhabricatorHandleList $handles) { | ||||
$target = $action->getTarget(); | $target = $action->getTarget(); | ||||
▲ Show 20 Lines • Show All 316 Lines • Show Last 20 Lines |
nice