@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
at upstream/main 64 lines 1.4 kB view raw
1<?php 2 3final class PHUIFormationExpanderView 4 extends AphrontAutoIDView { 5 6 private $tooltip; 7 private $columnItem; 8 9 public function setTooltip($tooltip) { 10 $this->tooltip = $tooltip; 11 return $this; 12 } 13 14 public function getTooltip() { 15 return $this->tooltip; 16 } 17 18 public function setColumnItem($column_item) { 19 $this->columnItem = $column_item; 20 return $this; 21 } 22 23 public function getColumnItem() { 24 return $this->columnItem; 25 } 26 27 public function render() { 28 $classes = array(); 29 $classes[] = 'phui-formation-view-expander'; 30 31 $is_right = $this->getColumnItem()->getIsRightAligned(); 32 if ($is_right) { 33 $icon = id(new PHUIIconView()) 34 ->setIcon('fa-chevron-left grey'); 35 $classes[] = 'phui-formation-view-expander-right'; 36 } else { 37 $icon = id(new PHUIIconView()) 38 ->setIcon('fa-chevron-right grey'); 39 $classes[] = 'phui-formation-view-expander-left'; 40 } 41 42 $icon_view = phutil_tag( 43 'div', 44 array( 45 'class' => 'phui-formation-view-expander-icon', 46 ), 47 $icon); 48 49 return javelin_tag( 50 'div', 51 array( 52 'id' => $this->getID(), 53 'class' => implode(' ', $classes), 54 'sigil' => 'has-tooltip', 55 'style' => 'display: none', 56 'meta' => array( 57 'tip' => $this->getTooltip(), 58 'align' => 'E', 59 ), 60 ), 61 $icon_view); 62 } 63 64}