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;
 }
Example #2
0
 private function renderActionTargetAsText(HeraldActionRecord $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;
 }