@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
fork

Configure Feed

Select the types of activity you want to include in your feed.

Make "simple" a "button type", not a "color"

Summary:
Ref M1476. Currently, `setColor('simple')` is meaningful. Instead, `setButtonType('simple')`.

Depends on D18047.

Test Plan: Looked at UI examples, Phame, Auth. Notifications mooted by D18047.

Reviewers: chad

Reviewed By: chad

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

+37 -15
+1 -1
src/applications/auth/controller/config/PhabricatorAuthListController.php
··· 103 103 104 104 $button = id(new PHUIButtonView()) 105 105 ->setTag('a') 106 - ->setColor(PHUIButtonView::SIMPLE) 106 + ->setButtonType(PHUIButtonView::BUTTONTYPE_SIMPLE) 107 107 ->setHref($this->getApplicationURI('config/new/')) 108 108 ->setIcon('fa-plus') 109 109 ->setDisabled(!$can_manage)
+1 -1
src/applications/guides/view/PhabricatorGuideListView.php
··· 30 30 ->setText(pht('Skip')) 31 31 ->setTag('a') 32 32 ->setHref($skip_href) 33 - ->setColor(PHUIButtonView::SIMPLE); 33 + ->setButtonType(PHUIButtonView::BUTTONTYPE_SIMPLE); 34 34 $list_item->setSideColumn($skip); 35 35 } 36 36 $list->addItem($list_item);
+1 -1
src/applications/phame/query/PhameBlogSearchEngine.php
··· 98 98 ->setTag('a') 99 99 ->setText('New Post') 100 100 ->setHref($this->getApplicationURI('/post/edit/?blog='.$id)) 101 - ->setColor(PHUIButtonView::SIMPLE); 101 + ->setButtonType(PHUIButtonView::BUTTONTYPE_SIMPLE); 102 102 $item->setSideColumn($button); 103 103 } 104 104
+5 -5
src/applications/uiexample/examples/PHUIBoxExample.php
··· 62 62 ); 63 63 64 64 $button = id(new PHUIButtonView()) 65 - ->setTag('a') 66 - ->setColor(PHUIButtonView::SIMPLE) 67 - ->setIcon('fa-heart') 68 - ->setText(pht('Such Wow')) 69 - ->addClass(PHUI::MARGIN_SMALL_RIGHT); 65 + ->setTag('a') 66 + ->setButtonType(PHUIButtonView::BUTTONTYPE_SIMPLE) 67 + ->setIcon('fa-heart') 68 + ->setText(pht('Such Wow')) 69 + ->addClass(PHUI::MARGIN_SMALL_RIGHT); 70 70 71 71 $badge1 = id(new PHUIBadgeMiniView()) 72 72 ->setIcon('fa-bug')
+2 -2
src/applications/uiexample/examples/PHUIButtonBarExample.php
··· 36 36 foreach ($icons as $text => $icon) { 37 37 $button = id(new PHUIButtonView()) 38 38 ->setTag('a') 39 - ->setColor(PHUIButtonView::SIMPLE) 39 + ->setButtonType(PHUIButtonView::BUTTONTYPE_SIMPLE) 40 40 ->setTitle($text) 41 41 ->setText($text); 42 42 ··· 47 47 foreach ($icons as $text => $icon) { 48 48 $button = id(new PHUIButtonView()) 49 49 ->setTag('a') 50 - ->setColor(PHUIButtonView::SIMPLE) 50 + ->setButtonType(PHUIButtonView::BUTTONTYPE_SIMPLE) 51 51 ->setTitle($text) 52 52 ->setTooltip($text) 53 53 ->setIcon($icon);
+4 -4
src/applications/uiexample/examples/PHUIButtonExample.php
··· 129 129 'Subscribe' => 'fa-check-circle bluegrey', 130 130 'Edit' => 'fa-pencil bluegrey', 131 131 ); 132 - $colors = array( 133 - PHUIButtonView::SIMPLE, 132 + $designs = array( 133 + PHUIButtonView::BUTTONTYPE_SIMPLE, 134 134 ); 135 135 $column = array(); 136 - foreach ($colors as $color) { 136 + foreach ($designs as $design) { 137 137 foreach ($icons as $text => $icon) { 138 138 $column[] = id(new PHUIButtonView()) 139 139 ->setTag('a') 140 - ->setColor($color) 140 + ->setButtonType($design) 141 141 ->setIcon($icon) 142 142 ->setText($text) 143 143 ->addClass(PHUI::MARGIN_SMALL_RIGHT);
+22
src/view/phui/PHUIButtonView.php
··· 10 10 const SMALL = 'small'; 11 11 const BIG = 'big'; 12 12 13 + const BUTTONTYPE_DEFAULT = 'buttontype.default'; 14 + const BUTTONTYPE_SIMPLE = 'buttontype.simple'; 15 + 13 16 private $size; 14 17 private $text; 15 18 private $subtext; ··· 25 28 private $tooltip; 26 29 private $noCSS; 27 30 private $hasCaret; 31 + private $buttonType = self::BUTTONTYPE_DEFAULT; 28 32 29 33 public function setName($name) { 30 34 $this->name = $name; ··· 103 107 return $this->hasCaret; 104 108 } 105 109 110 + public function setButtonType($button_type) { 111 + $this->buttonType = $button_type; 112 + return $this; 113 + } 114 + 115 + public function getButtonType() { 116 + return $this->buttonType; 117 + } 118 + 106 119 public function setIcon($icon, $first = true) { 107 120 if (!($icon instanceof PHUIIconView)) { 108 121 $icon = id(new PHUIIconView()) ··· 167 180 168 181 if ($this->disabled) { 169 182 $classes[] = 'disabled'; 183 + } 184 + 185 + switch ($this->getButtonType()) { 186 + case self::BUTTONTYPE_DEFAULT: 187 + // Nothing special for default buttons. 188 + break; 189 + case self::BUTTONTYPE_SIMPLE: 190 + $classes[] = 'simple'; 191 + break; 170 192 } 171 193 172 194 $sigil = null;
+1 -1
src/view/phui/PHUIDocumentViewPro.php
··· 79 79 $toc[] = id(new PHUIButtonView()) 80 80 ->setTag('a') 81 81 ->setIcon('fa-align-left') 82 - ->setColor(PHUIButtonView::SIMPLE) 82 + ->setButtonType(PHUIButtonView::BUTTONTYPE_SIMPLE) 83 83 ->addClass('phui-document-toc') 84 84 ->addSigil('jx-toggle-class') 85 85 ->setMetaData(array(