Changeset View
Changeset View
Standalone View
Standalone View
src/view/layout/PhabricatorActionView.php
| Show All 12 Lines | final class PhabricatorActionView extends AphrontView { | ||||
| private $sigils = array(); | private $sigils = array(); | ||||
| private $metadata; | private $metadata; | ||||
| private $selected; | private $selected; | ||||
| private $openInNewWindow; | private $openInNewWindow; | ||||
| private $submenu = array(); | private $submenu = array(); | ||||
| private $hidden; | private $hidden; | ||||
| private $depth; | private $depth; | ||||
| private $id; | private $id; | ||||
| private $order; | |||||
| private $color; | |||||
| private $type; | |||||
| const TYPE_DIVIDER = 'type-divider'; | |||||
| const TYPE_LABEL = 'label'; | |||||
| const RED = 'action-item-red'; | |||||
| public function setSelected($selected) { | public function setSelected($selected) { | ||||
| $this->selected = $selected; | $this->selected = $selected; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getSelected() { | public function getSelected() { | ||||
| return $this->selected; | return $this->selected; | ||||
| Show All 17 Lines | public function getDownload() { | ||||
| return $this->download; | return $this->download; | ||||
| } | } | ||||
| public function setHref($href) { | public function setHref($href) { | ||||
| $this->href = $href; | $this->href = $href; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function setColor($color) { | |||||
| $this->color = $color; | |||||
| return $this; | |||||
| } | |||||
| public function addSigil($sigil) { | public function addSigil($sigil) { | ||||
| $this->sigils[] = $sigil; | $this->sigils[] = $sigil; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getHref() { | public function getHref() { | ||||
| return $this->href; | return $this->href; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | final class PhabricatorActionView extends AphrontView { | ||||
| public function getID() { | public function getID() { | ||||
| if (!$this->id) { | if (!$this->id) { | ||||
| $this->id = celerity_generate_unique_node_id(); | $this->id = celerity_generate_unique_node_id(); | ||||
| } | } | ||||
| return $this->id; | return $this->id; | ||||
| } | } | ||||
| public function setOrder($order) { | |||||
| $this->order = $order; | |||||
| return $this; | |||||
| } | |||||
| public function getOrder() { | |||||
| return $this->order; | |||||
| } | |||||
| public function setType($type) { | |||||
| $this->type = $type; | |||||
| return $this; | |||||
| } | |||||
| public function getType() { | |||||
| return $this->type; | |||||
| } | |||||
| public function setSubmenu(array $submenu) { | public function setSubmenu(array $submenu) { | ||||
| $this->submenu = $submenu; | $this->submenu = $submenu; | ||||
| if (!$this->getHref()) { | if (!$this->getHref()) { | ||||
| $this->setHref('#'); | $this->setHref('#'); | ||||
| } | } | ||||
| return $this; | return $this; | ||||
| ▲ Show 20 Lines • Show All 150 Lines • ▼ Show 20 Lines | public function render() { | ||||
| if ($this->submenu) { | if ($this->submenu) { | ||||
| $classes[] = 'phabricator-action-view-submenu'; | $classes[] = 'phabricator-action-view-submenu'; | ||||
| } | } | ||||
| if ($this->getHref()) { | if ($this->getHref()) { | ||||
| $classes[] = 'phabricator-action-view-href'; | $classes[] = 'phabricator-action-view-href'; | ||||
| } | } | ||||
| if ($this->icon) { | |||||
| $classes[] = 'action-has-icon'; | |||||
| } | |||||
| if ($this->color) { | |||||
| $classes[] = $this->color; | |||||
| } | |||||
| if ($this->type) { | |||||
| $classes[] = 'phabricator-action-view-'.$this->type; | |||||
| } | |||||
| $style = array(); | $style = array(); | ||||
| if ($this->hidden) { | if ($this->hidden) { | ||||
| $style[] = 'display: none;'; | $style[] = 'display: none;'; | ||||
| } | } | ||||
| if ($this->depth) { | if ($this->depth) { | ||||
| $indent = ($this->depth * 16); | $indent = ($this->depth * 16); | ||||
| Show All 34 Lines | |||||