@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

Add setImage to PHUIActionPanelView

Summary: Additonal option to use newly made images in these views.

Test Plan:
Built an example in UIExamples.

{F5071682}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D18299

+35 -3
+2 -2
resources/celerity/map.php
··· 139 139 'rsrc/css/phui/object-item/phui-oi-list-view.css' => 'bf094950', 140 140 'rsrc/css/phui/object-item/phui-oi-simple-ui.css' => 'a8beebea', 141 141 'rsrc/css/phui/phui-action-list.css' => '6ee16164', 142 - 'rsrc/css/phui/phui-action-panel.css' => '91c7b835', 142 + 'rsrc/css/phui/phui-action-panel.css' => 'b4798122', 143 143 'rsrc/css/phui/phui-badge.css' => '22c0cf4f', 144 144 'rsrc/css/phui/phui-basic-nav-view.css' => 'a0705f53', 145 145 'rsrc/css/phui/phui-big-info-view.css' => 'd13afcde', ··· 818 818 'phortune-invoice-css' => '476055e2', 819 819 'phrequent-css' => 'ffc185ad', 820 820 'phriction-document-css' => '4282e4ad', 821 - 'phui-action-panel-css' => '91c7b835', 821 + 'phui-action-panel-css' => 'b4798122', 822 822 'phui-badge-view-css' => '22c0cf4f', 823 823 'phui-basic-nav-view-css' => 'a0705f53', 824 824 'phui-big-info-view-css' => 'd13afcde',
+6 -1
src/applications/uiexample/examples/PHUIActionPanelExample.php
··· 11 11 } 12 12 13 13 public function renderExample() { 14 + $viewer = $this->getRequest()->getUser(); 14 15 15 16 $view = id(new AphrontMultiColumnView()) 16 17 ->setFluidLayout(true); 18 + 19 + $credit = PhabricatorFile::loadBuiltin( 20 + $viewer, 'projects/v3/creditcard.png'); 21 + $image = $credit->getBestURI(); 17 22 18 23 /* Action Panels */ 19 24 $panel1 = id(new PHUIActionPanelView()) ··· 53 58 54 59 /* Action Panels */ 55 60 $panel1 = id(new PHUIActionPanelView()) 56 - ->setIcon('fa-credit-card') 61 + ->setImage($image) 57 62 ->setHeader(pht('Account Balance')) 58 63 ->setHref('#') 59 64 ->setSubHeader(pht('You were last billed $2,245.12 on Dec 12, 2014.'))
+21
src/view/phui/PHUIActionPanelView.php
··· 4 4 5 5 private $href; 6 6 private $fontIcon; 7 + private $image; 7 8 private $header; 8 9 private $subHeader; 9 10 private $bigText; ··· 26 27 27 28 public function setIcon($image) { 28 29 $this->fontIcon = $image; 30 + return $this; 31 + } 32 + 33 + public function setImage($image) { 34 + $this->image = $image; 29 35 return $this; 30 36 } 31 37 ··· 87 93 'class' => 'phui-action-panel-icon', 88 94 ), 89 95 $fonticon); 96 + } 97 + 98 + if ($this->image) { 99 + $image = phutil_tag( 100 + 'img', 101 + array( 102 + 'class' => 'phui-action-panel-image', 103 + 'src' => $this->image, 104 + )); 105 + $icon = phutil_tag( 106 + 'span', 107 + array( 108 + 'class' => 'phui-action-panel-icon', 109 + ), 110 + $image); 90 111 } 91 112 92 113 $header = null;
+6
webroot/rsrc/css/phui/phui-action-panel.css
··· 47 47 display: table-cell; 48 48 } 49 49 50 + .phui-action-panel-image { 51 + width: 48px; 52 + height: 48px; 53 + margin: 0 auto; 54 + } 55 + 50 56 .phui-action-panel-icon a { 51 57 display: block; 52 58 }