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

Clean up some PHUI/PHUIX button behaviors

Summary:
Ref T12733. Some minor issues:

- The `strlen(...)` test against `$this->text` fails if a caller does something like `setText(array(...))`. This is rare, but used in `DiffusionBrowseController`, from D15487.
- Add PHUIX examples for icon-only buttons.
- Remove unused `SIMPLE` constant now that no callsites remain.

Test Plan:
- Viewed a directory in Diffusion's "Browse" view in a Git repository, no longer saw a warning / error log.
- Viewed PHUIX Components UI examples.
- Grepped for `::SIMPLE`.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12733

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

+19 -3
+17
src/applications/uiexample/examples/PHUIXComponentsExample.php
··· 72 72 'color' => PHUIButtonView::GREEN, 73 73 'text' => pht('Environmental!'), 74 74 ), 75 + array( 76 + 'icon' => 'fa-cog', 77 + ), 78 + array( 79 + 'icon' => 'fa-cog', 80 + 'type' => PHUIButtonView::BUTTONTYPE_SIMPLE, 81 + ), 82 + array( 83 + 'text' => array('2 + 2', ' ', '=', ' ', '4'), 84 + ), 85 + array( 86 + 'color' => PHUIButtonView::GREY, 87 + 'text' => pht('Cancel'), 88 + ), 89 + array( 90 + 'text' => array('<strong />'), 91 + ), 75 92 ); 76 93 77 94 foreach ($buttons as $spec) {
+2 -3
src/view/phui/PHUIButtonView.php
··· 5 5 const GREEN = 'green'; 6 6 const GREY = 'grey'; 7 7 const DISABLED = 'disabled'; 8 - const SIMPLE = 'simple'; 9 8 10 9 const SMALL = 'small'; 11 10 const BIG = 'big'; ··· 175 174 $classes[] = 'has-icon'; 176 175 } 177 176 178 - if (strlen($this->text)) { 177 + if ($this->text !== null) { 179 178 $classes[] = 'has-text'; 180 179 } 181 180 ··· 238 237 $this->subtext); 239 238 } 240 239 241 - if (strlen($this->text)) { 240 + if ($this->text !== null) { 242 241 $text = phutil_tag( 243 242 'div', 244 243 array(