Differential D12525 Diff 30083 src/applications/project/typeahead/PhabricatorProjectLogicalOrNotDatasource.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/typeahead/PhabricatorProjectLogicalOrNotDatasource.php
Show First 20 Lines • Show All 79 Lines • ▼ Show 20 Lines | protected function didLoadResults(array $results) { | ||||
$function = $this->getCurrentFunction(); | $function = $this->getCurrentFunction(); | ||||
$return_any = ($function !== 'not'); | $return_any = ($function !== 'not'); | ||||
$return_not = ($function !== 'any'); | $return_not = ($function !== 'any'); | ||||
$return = array(); | $return = array(); | ||||
foreach ($results as $result) { | foreach ($results as $result) { | ||||
$result | $result | ||||
->setTokenType(PhabricatorTypeaheadTokenView::TYPE_FUNCTION) | ->setTokenType(PhabricatorTypeaheadTokenView::TYPE_FUNCTION) | ||||
->setIcon('fa-asterisk'); | ->setIcon('fa-asterisk') | ||||
->setColor(null); | |||||
if ($return_any) { | if ($return_any) { | ||||
$return[] = id(clone $result) | $return[] = id(clone $result) | ||||
->setPHID('any('.$result->getPHID().')') | ->setPHID('any('.$result->getPHID().')') | ||||
->setDisplayName(pht('In Any: %s', $result->getDisplayName())) | ->setDisplayName(pht('In Any: %s', $result->getDisplayName())) | ||||
->setName($result->getName().' any'); | ->setName($result->getName().' any'); | ||||
} | } | ||||
Show All 32 Lines | final class PhabricatorProjectLogicalOrNotDatasource | ||||
public function renderFunctionTokens($function, array $argv_list) { | public function renderFunctionTokens($function, array $argv_list) { | ||||
$phids = array(); | $phids = array(); | ||||
foreach ($argv_list as $argv) { | foreach ($argv_list as $argv) { | ||||
$phids[] = head($argv); | $phids[] = head($argv); | ||||
} | } | ||||
$tokens = $this->renderTokens($phids); | $tokens = $this->renderTokens($phids); | ||||
foreach ($tokens as $token) { | foreach ($tokens as $token) { | ||||
$token->setColor(null); | |||||
if ($token->isInvalid()) { | if ($token->isInvalid()) { | ||||
if ($function == 'any') { | if ($function == 'any') { | ||||
$token->setValue(pht('In Any: Invalid Project')); | $token->setValue(pht('In Any: Invalid Project')); | ||||
} else { | } else { | ||||
$token->setValue(pht('Not In: Invalid Project')); | $token->setValue(pht('Not In: Invalid Project')); | ||||
} | } | ||||
} else { | } else { | ||||
$token | $token | ||||
Show All 19 Lines |