1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-29 17:00:59 +01:00
phorge-phorge/src/view/phui/PHUIStatusItemView.php
epriestley 2d733f88a1 Split users apart from projects/packages in reviewer and audit UIs
Summary: Ref T1279. Show separate sections for "Reviewers" and "Project Reviewers" (Differential) and for "Auditors" and "Package/Project Auditors" (Diffusion/Audit).

Test Plan:
  - Looked at a commit. Saw separation.
  - Looked at a revision. Saw separation.

Reviewers: chad, btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1279

Differential Revision: https://secure.phabricator.com/D7233
2013-10-05 14:10:49 -07:00

95 lines
1.8 KiB
PHP

<?php
final class PHUIStatusItemView extends AphrontTagView {
private $icon;
private $iconLabel;
private $target;
private $note;
private $highlighted;
public function setIcon($icon, $label = null) {
$this->icon = $icon;
$this->iconLabel = $label;
return $this;
}
public function setTarget($target) {
$this->target = $target;
return $this;
}
public function setNote($note) {
$this->note = $note;
return $this;
}
public function setHighlighted($highlighted) {
$this->highlighted = $highlighted;
return $this;
}
protected function canAppendChild() {
return false;
}
protected function getTagName() {
return 'tr';
}
protected function getTagAttributes() {
$classes = array();
if ($this->highlighted) {
$classes[] = 'phui-status-item-highlighted';
}
return array(
'class' => $classes,
);
}
protected function getTagContent() {
$icon = null;
if ($this->icon) {
$icon = id(new PHUIIconView())
->setSpriteSheet(PHUIIconView::SPRITE_STATUS)
->setSpriteIcon($this->icon);
if ($this->iconLabel) {
Javelin::initBehavior('phabricator-tooltips');
$icon->addSigil('has-tooltip');
$icon->setMetadata(
array(
'tip' => $this->iconLabel,
'size' => 240,
));
}
}
$icon_cell = phutil_tag(
'td',
array(),
$icon);
$target_cell = phutil_tag(
'td',
array(
'class' => 'phui-status-item-target',
),
$this->target);
$note_cell = phutil_tag(
'td',
array(
'class' => 'phui-status-item-note',
),
$this->note);
return array(
$icon_cell,
$target_cell,
$note_cell,
);
}
}