Changeset View
Changeset View
Standalone View
Standalone View
src/view/phui/PHUIWorkpanelView.php
| <?php | <?php | ||||
| final class PHUIWorkpanelView extends AphrontTagView { | final class PHUIWorkpanelView extends AphrontTagView { | ||||
| private $cards = array(); | private $cards = array(); | ||||
| private $header; | private $header; | ||||
| private $subheader = null; | private $subheader = null; | ||||
| private $footerAction; | private $footerAction; | ||||
| private $headerActions = array(); | private $headerActions = array(); | ||||
| private $headerTag; | private $headerTag; | ||||
| private $headerIcon; | private $headerIcon; | ||||
| private $href; | |||||
| public function setHeaderIcon($icon) { | public function setHeaderIcon($icon) { | ||||
| $this->headerIcon = $icon; | $this->headerIcon = $icon; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getHeaderIcon() { | public function getHeaderIcon() { | ||||
| return $this->headerIcon; | return $this->headerIcon; | ||||
| Show All 24 Lines | public function addHeaderAction(PHUIIconView $action) { | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function setHeaderTag(PHUITagView $tag) { | public function setHeaderTag(PHUITagView $tag) { | ||||
| $this->headerTag = $tag; | $this->headerTag = $tag; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function setHref($href) { | |||||
| $this->href = $href; | |||||
| return $this; | |||||
| } | |||||
| public function getHref() { | |||||
| return $this->href; | |||||
| } | |||||
| protected function getTagAttributes() { | protected function getTagAttributes() { | ||||
| return array( | return array( | ||||
| 'class' => 'phui-workpanel-view', | 'class' => 'phui-workpanel-view', | ||||
| ); | ); | ||||
| } | } | ||||
| protected function getTagContent() { | protected function getTagContent() { | ||||
| require_celerity_resource('phui-workpanel-view-css'); | require_celerity_resource('phui-workpanel-view-css'); | ||||
| Show All 20 Lines | protected function getTagContent() { | ||||
| if ($this->headerTag) { | if ($this->headerTag) { | ||||
| $header->addTag($this->headerTag); | $header->addTag($this->headerTag); | ||||
| } | } | ||||
| foreach ($this->headerActions as $action) { | foreach ($this->headerActions as $action) { | ||||
| $header->addActionIcon($action); | $header->addActionIcon($action); | ||||
| } | } | ||||
| $href = $this->getHref(); | |||||
| if ($href !== null) { | |||||
| $header->setHref($href); | |||||
| } | |||||
| $body = phutil_tag( | $body = phutil_tag( | ||||
| 'div', | 'div', | ||||
| array( | array( | ||||
| 'class' => 'phui-workpanel-body', | 'class' => 'phui-workpanel-body', | ||||
| ), | ), | ||||
| $this->cards); | $this->cards); | ||||
| $view = id(new PHUIBoxView()) | $view = id(new PHUIBoxView()) | ||||
| Show All 12 Lines | |||||