Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phid/PhabricatorObjectHandle.php
Show All 25 Lines | final class PhabricatorObjectHandle | ||||
private $availability = self::AVAILABILITY_FULL; | private $availability = self::AVAILABILITY_FULL; | ||||
private $complete; | private $complete; | ||||
private $objectName; | private $objectName; | ||||
private $policyFiltered; | private $policyFiltered; | ||||
private $subtitle; | private $subtitle; | ||||
private $tokenIcon; | private $tokenIcon; | ||||
private $commandLineObjectName; | private $commandLineObjectName; | ||||
private $stateIcon; | |||||
private $stateColor; | |||||
private $stateName; | |||||
public function setIcon($icon) { | public function setIcon($icon) { | ||||
$this->icon = $icon; | $this->icon = $icon; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getIcon() { | public function getIcon() { | ||||
if ($this->getPolicyFiltered()) { | if ($this->getPolicyFiltered()) { | ||||
return 'fa-lock'; | return 'fa-lock'; | ||||
▲ Show 20 Lines • Show All 237 Lines • ▼ Show 20 Lines | final class PhabricatorObjectHandle | ||||
* PHIDs. | * PHIDs. | ||||
* | * | ||||
* @return bool True if the handle represents a complete object. | * @return bool True if the handle represents a complete object. | ||||
*/ | */ | ||||
public function isComplete() { | public function isComplete() { | ||||
return $this->complete; | return $this->complete; | ||||
} | } | ||||
public function setStateIcon($state_icon) { | |||||
$this->stateIcon = $state_icon; | |||||
return $this; | |||||
} | |||||
public function getStateIcon() { | |||||
return $this->stateIcon; | |||||
} | |||||
public function setStateColor($state_color) { | |||||
$this->stateColor = $state_color; | |||||
return $this; | |||||
} | |||||
public function getStateColor() { | |||||
return $this->stateColor; | |||||
} | |||||
public function setStateName($state_name) { | |||||
$this->stateName = $state_name; | |||||
return $this; | |||||
} | |||||
public function getStateName() { | |||||
return $this->stateName; | |||||
} | |||||
public function renderStateIcon() { | |||||
$icon = $this->getStateIcon(); | |||||
if ($icon === null) { | |||||
$icon = 'fa-question-circle-o'; | |||||
} | |||||
$color = $this->getStateColor(); | |||||
$name = $this->getStateName(); | |||||
if ($name === null) { | |||||
$name = pht('Unknown'); | |||||
} | |||||
return id(new PHUIIconView()) | |||||
->setIcon($icon, $color) | |||||
->addSigil('has-tooltip') | |||||
->setMetadata( | |||||
array( | |||||
'tip' => $name, | |||||
)); | |||||
} | |||||
public function renderLink($name = null) { | public function renderLink($name = null) { | ||||
return $this->renderLinkWithAttributes($name, array()); | return $this->renderLinkWithAttributes($name, array()); | ||||
} | } | ||||
public function renderHovercardLink($name = null) { | public function renderHovercardLink($name = null) { | ||||
Javelin::initBehavior('phui-hovercards'); | Javelin::initBehavior('phui-hovercards'); | ||||
▲ Show 20 Lines • Show All 111 Lines • Show Last 20 Lines |