예제 #1
0
 private function renderActionTargetAsText(HeraldAction $action, PhabricatorHandleList $handles)
 {
     $target = $action->getTarget();
     if (!is_array($target)) {
         $target = array($target);
     }
     foreach ($target as $index => $val) {
         switch ($action->getAction()) {
             case self::ACTION_FLAG:
                 $target[$index] = PhabricatorFlagColor::getColorName($val);
                 break;
             default:
                 $handle = $handles->getHandleIfExists($val);
                 if ($handle) {
                     $target[$index] = $handle->renderLink();
                 }
                 break;
         }
     }
     $target = phutil_implode_html(', ', $target);
     return $target;
 }
예제 #2
0
 private function renderActionTargetAsText(HeraldActionRecord $action, PhabricatorHandleList $handles)
 {
     // TODO: This should be driven through HeraldAction.
     $target = $action->getTarget();
     if (!is_array($target)) {
         $target = array($target);
     }
     foreach ($target as $index => $val) {
         switch ($action->getAction()) {
             default:
                 $handle = $handles->getHandleIfExists($val);
                 if ($handle) {
                     $target[$index] = $handle->renderLink();
                 }
                 break;
         }
     }
     $target = phutil_implode_html(', ', $target);
     return $target;
 }
 private function getCompleteHandles(PhabricatorHandleList $handles)
 {
     $phids = array();
     foreach ($handles as $phid => $handle) {
         if (!$handle->isComplete()) {
             continue;
         }
         $phids[] = $phid;
     }
     return $handles->newSublist($phids);
 }