Changeset View
Changeset View
Standalone View
Standalone View
src/view/phui/PHUIHeaderView.php
| Show All 16 Lines | final class PHUIHeaderView extends AphrontTagView { | ||||
| private $tall; | private $tall; | ||||
| private $properties = array(); | private $properties = array(); | ||||
| private $actionLinks = array(); | private $actionLinks = array(); | ||||
| private $buttonBar = null; | private $buttonBar = null; | ||||
| private $policyObject; | private $policyObject; | ||||
| private $epoch; | private $epoch; | ||||
| private $actionIcons = array(); | private $actionIcons = array(); | ||||
| private $badges = array(); | private $badges = array(); | ||||
| private $href; | |||||
| public function setHeader($header) { | public function setHeader($header) { | ||||
| $this->header = $header; | $this->header = $header; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function setNoBackground($nada) { | public function setNoBackground($nada) { | ||||
| $this->noBackground = $nada; | $this->noBackground = $nada; | ||||
| ▲ Show 20 Lines • Show All 109 Lines • ▼ Show 20 Lines | public function setEpoch($epoch) { | ||||
| } else { | } else { | ||||
| $when = pht('%s Day(s) Ago', new PhutilNumber($age)); | $when = pht('%s Day(s) Ago', new PhutilNumber($age)); | ||||
| } | } | ||||
| $this->setStatus('fa-clock-o bluegrey', null, pht('Updated %s', $when)); | $this->setStatus('fa-clock-o bluegrey', null, pht('Updated %s', $when)); | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function setHref($href) { | |||||
| $this->href = $href; | |||||
| return $this; | |||||
| } | |||||
| public function getHref() { | |||||
| return $this->href; | |||||
| } | |||||
| protected function getTagName() { | protected function getTagName() { | ||||
| return 'div'; | return 'div'; | ||||
| } | } | ||||
| protected function getTagAttributes() { | protected function getTagAttributes() { | ||||
| require_celerity_resource('phui-header-view-css'); | require_celerity_resource('phui-header-view-css'); | ||||
| $classes = array(); | $classes = array(); | ||||
| ▲ Show 20 Lines • Show All 127 Lines • ▼ Show 20 Lines | if ($this->actionIcons || $this->tags) { | ||||
| $action_list); | $action_list); | ||||
| } | } | ||||
| if ($this->headerIcon) { | if ($this->headerIcon) { | ||||
| $icon = id(new PHUIIconView()) | $icon = id(new PHUIIconView()) | ||||
| ->setIcon($this->headerIcon); | ->setIcon($this->headerIcon); | ||||
| $left[] = $icon; | $left[] = $icon; | ||||
| } | } | ||||
| $header_content = $this->header; | |||||
| $href = $this->getHref(); | |||||
| if ($href !== null) { | |||||
| $header_content = phutil_tag( | |||||
| 'a', | |||||
| array( | |||||
| 'href' => $href, | |||||
| ), | |||||
| $header_content); | |||||
| } | |||||
| $left[] = phutil_tag( | $left[] = phutil_tag( | ||||
| 'span', | 'span', | ||||
| array( | array( | ||||
| 'class' => 'phui-header-header', | 'class' => 'phui-header-header', | ||||
| ), | ), | ||||
| $this->header); | $header_content); | ||||
| if ($this->subheader || $this->badges) { | if ($this->subheader || $this->badges) { | ||||
| $badges = null; | $badges = null; | ||||
| if ($this->badges) { | if ($this->badges) { | ||||
| $badges = new PHUIBadgeBoxView(); | $badges = new PHUIBadgeBoxView(); | ||||
| $badges->addItems($this->badges); | $badges->addItems($this->badges); | ||||
| $badges->setCollapsed(true); | $badges->setCollapsed(true); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 177 Lines • Show Last 20 Lines | |||||