Changeset View
Changeset View
Standalone View
Standalone View
src/view/phui/PHUIButtonView.php
| Show All 21 Lines | final class PHUIButtonView extends AphrontTagView { | ||||
| private $dropdown; | private $dropdown; | ||||
| private $icon; | private $icon; | ||||
| private $iconFirst; | private $iconFirst; | ||||
| private $href = null; | private $href = null; | ||||
| private $title = null; | private $title = null; | ||||
| private $disabled; | private $disabled; | ||||
| private $name; | private $name; | ||||
| private $tooltip; | private $tooltip; | ||||
| private $noCSS; | |||||
| public function setName($name) { | public function setName($name) { | ||||
| $this->name = $name; | $this->name = $name; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getName() { | public function getName() { | ||||
| return $this->name; | return $this->name; | ||||
| ▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | public function setDropdown($dd) { | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function setTooltip($text) { | public function setTooltip($text) { | ||||
| $this->tooltip = $text; | $this->tooltip = $text; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function setNoCSS($no_css) { | |||||
| $this->noCSS = $no_css; | |||||
epriestley: "puppet"? | |||||
Done Inline ActionsNo puppet, No puppet. I'm not the puppet, you're the puppet. chad: No puppet, No puppet. I'm not the puppet, you're the puppet. | |||||
| return $this; | |||||
| } | |||||
| public function setIcon($icon, $first = true) { | public function setIcon($icon, $first = true) { | ||||
| if (!($icon instanceof PHUIIconView)) { | if (!($icon instanceof PHUIIconView)) { | ||||
| $icon = id(new PHUIIconView()) | $icon = id(new PHUIIconView()) | ||||
| ->setIcon($icon); | ->setIcon($icon); | ||||
| } | } | ||||
| $this->icon = $icon; | $this->icon = $icon; | ||||
| $this->iconFirst = $first; | $this->iconFirst = $first; | ||||
| return $this; | return $this; | ||||
| ▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | if ($this->tooltip) { | ||||
| Javelin::initBehavior('phabricator-tooltips'); | Javelin::initBehavior('phabricator-tooltips'); | ||||
| require_celerity_resource('aphront-tooltip-css'); | require_celerity_resource('aphront-tooltip-css'); | ||||
| $sigil = 'has-tooltip'; | $sigil = 'has-tooltip'; | ||||
| $meta = array( | $meta = array( | ||||
| 'tip' => $this->tooltip, | 'tip' => $this->tooltip, | ||||
| ); | ); | ||||
| } | } | ||||
| if ($this->noCSS) { | |||||
| $classes = array(); | |||||
| } | |||||
| return array( | return array( | ||||
| 'class' => $classes, | 'class' => $classes, | ||||
| 'href' => $this->href, | 'href' => $this->href, | ||||
| 'name' => $this->name, | 'name' => $this->name, | ||||
| 'title' => $this->title, | 'title' => $this->title, | ||||
| 'sigil' => $sigil, | 'sigil' => $sigil, | ||||
| 'meta' => $meta, | 'meta' => $meta, | ||||
| ); | ); | ||||
| Show All 30 Lines | |||||
"puppet"?