Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phid/PhabricatorObjectHandle.php
Show All 24 Lines | final class PhabricatorObjectHandle | ||||
public function getIcon() { | public function getIcon() { | ||||
if ($this->icon) { | if ($this->icon) { | ||||
return $this->icon; | return $this->icon; | ||||
} | } | ||||
return $this->getTypeIcon(); | return $this->getTypeIcon(); | ||||
} | } | ||||
public function getIconColor() { | |||||
return 'bluegrey'; | |||||
} | |||||
public function getTypeIcon() { | public function getTypeIcon() { | ||||
if ($this->getPHIDType()) { | if ($this->getPHIDType()) { | ||||
return $this->getPHIDType()->getTypeIcon(); | return $this->getPHIDType()->getTypeIcon(); | ||||
} | } | ||||
return null; | return null; | ||||
} | } | ||||
public function setPolicyFiltered($policy_filered) { | public function setPolicyFiltered($policy_filered) { | ||||
▲ Show 20 Lines • Show All 209 Lines • ▼ Show 20 Lines | return phutil_tag( | ||||
array( | array( | ||||
'href' => $uri, | 'href' => $uri, | ||||
'class' => implode(' ', $classes), | 'class' => implode(' ', $classes), | ||||
'title' => $title, | 'title' => $title, | ||||
), | ), | ||||
array($icon, $name)); | array($icon, $name)); | ||||
} | } | ||||
public function renderTag() { | |||||
return id(new PHUITagView()) | |||||
->setType(PHUITagView::TYPE_OBJECT) | |||||
->setIcon($this->getIcon().' '.$this->getIconColor()) | |||||
->setHref($this->getURI()) | |||||
->setName($this->getLinkName()); | |||||
} | |||||
public function getLinkName() { | public function getLinkName() { | ||||
switch ($this->getType()) { | switch ($this->getType()) { | ||||
case PhabricatorPeoplePHIDTypeUser::TYPECONST: | case PhabricatorPeoplePHIDTypeUser::TYPECONST: | ||||
$name = $this->getName(); | $name = $this->getName(); | ||||
break; | break; | ||||
default: | default: | ||||
$name = $this->getFullName(); | $name = $this->getFullName(); | ||||
break; | break; | ||||
Show All 34 Lines |