Changeset View
Changeset View
Standalone View
Standalone View
src/view/phui/PHUIObjectItemView.php
Show First 20 Lines • Show All 867 Lines • ▼ Show 20 Lines | private function renderStatusIcon($icon, $label) { | ||||
$icon = id(new PHUIIconView()) | $icon = id(new PHUIIconView()) | ||||
->setIcon($icon); | ->setIcon($icon); | ||||
$options = array( | $options = array( | ||||
'class' => 'phui-oi-status-icon', | 'class' => 'phui-oi-status-icon', | ||||
); | ); | ||||
if (strlen($label)) { | if (phutil_nonempty_string($label)) { | ||||
$options['sigil'] = 'has-tooltip'; | $options['sigil'] = 'has-tooltip'; | ||||
$options['meta'] = array('tip' => $label, 'size' => 300); | $options['meta'] = array('tip' => $label, 'size' => 300); | ||||
} | } | ||||
return javelin_tag('div', $options, $icon); | return javelin_tag('div', $options, $icon); | ||||
} | } | ||||
private function renderHandleIcon(PhabricatorObjectHandle $handle, $label) { | private function renderHandleIcon(PhabricatorObjectHandle $handle, $label) { | ||||
Javelin::initBehavior('phabricator-tooltips'); | Javelin::initBehavior('phabricator-tooltips'); | ||||
$options = array( | $options = array( | ||||
'class' => 'phui-oi-handle-icon', | 'class' => 'phui-oi-handle-icon', | ||||
'style' => 'background-image: url('.$handle->getImageURI().')', | 'style' => 'background-image: url('.$handle->getImageURI().')', | ||||
); | ); | ||||
if (strlen($label)) { | if (phutil_nonempty_string($label)) { | ||||
$options['sigil'] = 'has-tooltip'; | $options['sigil'] = 'has-tooltip'; | ||||
$options['meta'] = array('tip' => $label, 'align' => 'E'); | $options['meta'] = array('tip' => $label, 'align' => 'E'); | ||||
} | } | ||||
return javelin_tag('span', $options, ''); | return javelin_tag('span', $options, ''); | ||||
} | } | ||||
} | } |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0