Differential D16155 Diff 38866 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 80 Lines • ▼ Show 20 Lines | protected function didLoadResults(array $results) { | ||||
$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); | ->setColor(null) | ||||
->resetAttributes() | |||||
->addAttribute(pht('Function')); | |||||
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('any '.$result->getName()); | ->setName('any '.$result->getName()) | ||||
->addAttribute(pht('Include results tagged with this project.')); | |||||
} | } | ||||
if ($return_not) { | if ($return_not) { | ||||
$return[] = id(clone $result) | $return[] = id(clone $result) | ||||
->setPHID('not('.$result->getPHID().')') | ->setPHID('not('.$result->getPHID().')') | ||||
->setDisplayName(pht('Not In: %s', $result->getDisplayName())) | ->setDisplayName(pht('Not In: %s', $result->getDisplayName())) | ||||
->setName('not '.$result->getName()); | ->setName('not '.$result->getName()) | ||||
->addAttribute(pht('Exclude results tagged with this project.')); | |||||
} | } | ||||
} | } | ||||
return $return; | return $return; | ||||
} | } | ||||
protected function evaluateFunction($function, array $argv_list) { | protected function evaluateFunction($function, array $argv_list) { | ||||
$phids = array(); | $phids = array(); | ||||
▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines |