Something went wrong. Try again.
@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
Something went wrong. Try again.
PHP
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119<?php
final class PHUIStatusItemView extends AphrontTagView {
private $icon; private $iconLabel; private $iconColor; private $target; private $note; private $highlighted; private $isExiled;
const ICON_ACCEPT = 'fa-check-circle'; const ICON_REJECT = 'fa-times-circle'; const ICON_LEFT = 'fa-chevron-circle-left'; const ICON_RIGHT = 'fa-chevron-circle-right'; const ICON_UP = 'fa-chevron-circle-up'; const ICON_DOWN = 'fa-chevron-circle-down'; const ICON_QUESTION = 'fa-question-circle'; const ICON_WARNING = 'fa-exclamation-circle'; const ICON_INFO = 'fa-info-circle'; const ICON_ADD = 'fa-plus-circle'; const ICON_MINUS = 'fa-minus-circle'; const ICON_OPEN = 'fa-circle-o'; const ICON_CLOCK = 'fa-clock-o'; const ICON_STAR = 'fa-star';
public function setIcon($icon, $color = null, $label = null) { $this->icon = $icon; $this->iconLabel = $label; $this->iconColor = $color; 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; }
public function setIsExiled($is_exiled) { $this->isExiled = $is_exiled; 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'; }
if ($this->isExiled) { $classes[] = 'phui-status-item-exiled'; }
return array( 'class' => $classes, ); }
protected function getTagContent() {
$icon = null; if ($this->icon) { $icon = id(new PHUIIconView()) ->setIcon($this->icon.' '.$this->iconColor);
if ($this->iconLabel) { Javelin::initBehavior('phabricator-tooltips'); $icon->addSigil('has-tooltip'); $icon->setMetadata( array( 'tip' => $this->iconLabel, 'size' => 240, )); } }
$target_cell = phutil_tag( 'td', array( 'class' => 'phui-status-item-target', ), array( $icon, $this->target, ));
$note_cell = phutil_tag( 'td', array( 'class' => 'phui-status-item-note', ), $this->note);
return array( $target_cell, $note_cell, ); }}