@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
1<?php
2
3final class PHUILeftRightView extends AphrontTagView {
4
5 private $left;
6 private $right;
7 private $verticalAlign;
8
9 const ALIGN_TOP = 'top';
10 const ALIGN_MIDDLE = 'middle';
11 const ALIGN_BOTTOM = 'bottom';
12
13 public function setLeft($left) {
14 $this->left = $left;
15 return $this;
16 }
17
18 public function setRight($right) {
19 $this->right = $right;
20 return $this;
21 }
22
23 public function setVerticalAlign($align) {
24 $this->verticalAlign = $align;
25 return $this;
26 }
27
28 protected function getTagAttributes() {
29 require_celerity_resource('phui-left-right-css');
30
31 $classes = array();
32 $classes[] = 'phui-left-right-view';
33
34 if ($this->verticalAlign) {
35 $classes[] = 'phui-lr-view-'.$this->verticalAlign;
36 }
37
38 return array('class' => implode(' ', $classes));
39 }
40
41 protected function getTagName() {
42 return 'div';
43 }
44
45 protected function getTagContent() {
46 $left = phutil_tag_div('phui-left-view', $this->left);
47 $right = phutil_tag_div('phui-right-view', $this->right);
48
49 return phutil_tag_div('phui-lr-container', array($left, $right));
50 }
51}