Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phid/PhabricatorObjectHandle.php
Show First 20 Lines • Show All 294 Lines • ▼ Show 20 Lines | final class PhabricatorObjectHandle | ||||
public function isComplete() { | public function isComplete() { | ||||
return $this->complete; | return $this->complete; | ||||
} | } | ||||
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, $context_phid = null) { | ||||
Javelin::initBehavior('phui-hovercards'); | Javelin::initBehavior('phui-hovercards'); | ||||
$hovercard_spec = array( | |||||
'objectPHID' => $this->getPHID(), | |||||
); | |||||
if ($context_phid) { | |||||
$hovercard_spec['contextPHID'] = $context_phid; | |||||
} | |||||
$attributes = array( | $attributes = array( | ||||
'sigil' => 'hovercard', | 'sigil' => 'hovercard', | ||||
'meta' => array( | 'meta' => array( | ||||
'hovercardSpec' => array( | 'hovercardSpec' => $hovercard_spec, | ||||
'objectPHID' => $this->getPHID(), | |||||
), | |||||
), | ), | ||||
); | ); | ||||
return $this->renderLinkWithAttributes($name, $attributes); | return $this->renderLinkWithAttributes($name, $attributes); | ||||
} | } | ||||
private function renderLinkWithAttributes($name, array $attributes) { | private function renderLinkWithAttributes($name, array $attributes) { | ||||
if ($name === null) { | if ($name === null) { | ||||
▲ Show 20 Lines • Show All 161 Lines • Show Last 20 Lines |