Changeset View
Changeset View
Standalone View
Standalone View
src/view/phui/PHUIButtonView.php
| <?php | <?php | ||||
| final class PHUIButtonView extends AphrontTagView { | final class PHUIButtonView extends AphrontTagView { | ||||
| const GREEN = 'green'; | const GREEN = 'green'; | ||||
| const GREY = 'grey'; | const GREY = 'grey'; | ||||
| const DISABLED = 'disabled'; | const DISABLED = 'disabled'; | ||||
| const SIMPLE = 'simple'; | |||||
| const SMALL = 'small'; | const SMALL = 'small'; | ||||
| const BIG = 'big'; | const BIG = 'big'; | ||||
| const BUTTONTYPE_DEFAULT = 'buttontype.default'; | const BUTTONTYPE_DEFAULT = 'buttontype.default'; | ||||
| const BUTTONTYPE_SIMPLE = 'buttontype.simple'; | const BUTTONTYPE_SIMPLE = 'buttontype.simple'; | ||||
| private $size; | private $size; | ||||
| ▲ Show 20 Lines • Show All 153 Lines • ▼ Show 20 Lines | protected function getTagAttributes() { | ||||
| if ($this->dropdown) { | if ($this->dropdown) { | ||||
| $classes[] = 'dropdown'; | $classes[] = 'dropdown'; | ||||
| } | } | ||||
| if ($this->icon) { | if ($this->icon) { | ||||
| $classes[] = 'has-icon'; | $classes[] = 'has-icon'; | ||||
| } | } | ||||
| if (strlen($this->text)) { | if ($this->text !== null) { | ||||
| $classes[] = 'has-text'; | $classes[] = 'has-text'; | ||||
| } | } | ||||
| if ($this->iconFirst == false) { | if ($this->iconFirst == false) { | ||||
| $classes[] = 'icon-last'; | $classes[] = 'icon-last'; | ||||
| } | } | ||||
| if ($this->disabled) { | if ($this->disabled) { | ||||
| ▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | if ($this->icon) { | ||||
| $subtext = phutil_tag( | $subtext = phutil_tag( | ||||
| 'div', | 'div', | ||||
| array( | array( | ||||
| 'class' => 'phui-button-subtext', | 'class' => 'phui-button-subtext', | ||||
| ), | ), | ||||
| $this->subtext); | $this->subtext); | ||||
| } | } | ||||
| if (strlen($this->text)) { | if ($this->text !== null) { | ||||
| $text = phutil_tag( | $text = phutil_tag( | ||||
| 'div', | 'div', | ||||
| array( | array( | ||||
| 'class' => 'phui-button-text', | 'class' => 'phui-button-text', | ||||
| ), | ), | ||||
| array( | array( | ||||
| $text, | $text, | ||||
| $subtext, | $subtext, | ||||
| Show All 16 Lines | |||||