@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 72 lines 1.7 kB view raw
1<?php 2 3final class PHUILeftRightExample extends PhabricatorUIExample { 4 5 public function getName() { 6 return pht('Responsive left-right table'); 7 } 8 9 public function getDescription() { 10 return pht('Allows easily alignment of left/right UI elements.'); 11 } 12 13 public function renderExample() { 14 $request = $this->getRequest(); 15 $user = $request->getUser(); 16 17 $text = pht('This is a sample of some text.'); 18 $button = id(new PHUIButtonView()) 19 ->setTag('a') 20 ->setText(pht('Actions')) 21 ->setIcon('fa-bars'); 22 23 $content1 = id(new PHUILeftRightView()) 24 ->setLeft($text) 25 ->setRight($button) 26 ->setVerticalAlign(PHUILeftRightView::ALIGN_TOP); 27 28 $content2 = id(new PHUILeftRightView()) 29 ->setLeft($text) 30 ->setRight($button) 31 ->setVerticalAlign(PHUILeftRightView::ALIGN_MIDDLE); 32 33 $content3 = id(new PHUILeftRightView()) 34 ->setLeft($text) 35 ->setRight($button) 36 ->setVerticalAlign(PHUILeftRightView::ALIGN_BOTTOM); 37 38 39 $head2 = id(new PHUIHeaderView()) 40 ->setHeader('Align Top') 41 ->addClass('ml'); 42 43 $head3 = id(new PHUIHeaderView()) 44 ->setHeader(pht('Align Middle')) 45 ->addClass('ml'); 46 47 $head4 = id(new PHUIHeaderView()) 48 ->setHeader(pht('Align Bottom')) 49 ->addClass('ml'); 50 51 $wrap2 = id(new PHUIBoxView()) 52 ->appendChild($content1) 53 ->addMargin(PHUI::MARGIN_LARGE); 54 55 $wrap3 = id(new PHUIBoxView()) 56 ->appendChild($content2) 57 ->addMargin(PHUI::MARGIN_LARGE); 58 59 $wrap4 = id(new PHUIBoxView()) 60 ->appendChild($content3) 61 ->addMargin(PHUI::MARGIN_LARGE); 62 63 return array( 64 $head2, 65 $wrap2, 66 $head3, 67 $wrap3, 68 $head4, 69 $wrap4, 70 ); 71 } 72}