Changeset View
Changeset View
Standalone View
Standalone View
src/view/phui/PHUIPinboardItemView.php
<?php | <?php | ||||
final class PHUIPinboardItemView extends AphrontView { | final class PHUIPinboardItemView extends AphrontView { | ||||
private $imageURI; | private $imageURI; | ||||
private $uri; | private $uri; | ||||
private $header; | private $header; | ||||
private $iconBlock = array(); | private $iconBlock = array(); | ||||
private $disabled; | private $disabled; | ||||
private $object; | |||||
private $imageWidth; | private $imageWidth; | ||||
private $imageHeight; | private $imageHeight; | ||||
public function setHeader($header) { | public function setHeader($header) { | ||||
$this->header = $header; | $this->header = $header; | ||||
return $this; | return $this; | ||||
} | } | ||||
Show All 18 Lines | public function addIconCount($icon, $count) { | ||||
return $this; | return $this; | ||||
} | } | ||||
public function setDisabled($disabled) { | public function setDisabled($disabled) { | ||||
$this->disabled = $disabled; | $this->disabled = $disabled; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function setObject($object) { | |||||
$this->object = $object; | |||||
return $this; | |||||
} | |||||
public function render() { | public function render() { | ||||
require_celerity_resource('phui-pinboard-view-css'); | require_celerity_resource('phui-pinboard-view-css'); | ||||
$header = null; | $header = null; | ||||
if ($this->header) { | if ($this->header) { | ||||
if ($this->disabled) { | if ($this->disabled) { | ||||
$header_color = 'gradient-lightgrey-header'; | $header_color = 'gradient-lightgrey-header'; | ||||
} else { | } else { | ||||
$header_color = 'gradient-lightblue-header'; | $header_color = 'gradient-lightblue-header'; | ||||
} | } | ||||
$header = phutil_tag( | $header = phutil_tag( | ||||
'div', | 'div', | ||||
array( | array( | ||||
'class' => 'phui-pinboard-item-header '. | 'class' => 'phui-pinboard-item-header '. | ||||
'sprite-gradient '.$header_color, | 'sprite-gradient '.$header_color, | ||||
), | ), | ||||
phutil_tag('a', array('href' => $this->uri), $this->header)); | array( | ||||
id(new PHUISpacesNamespaceContextView()) | |||||
->setUser($this->getUser()) | |||||
->setObject($this->object), | |||||
phutil_tag( | |||||
'a', | |||||
array( | |||||
'href' => $this->uri, | |||||
), | |||||
$this->header), | |||||
)); | |||||
} | } | ||||
$image = null; | $image = null; | ||||
if ($this->imageWidth) { | if ($this->imageWidth) { | ||||
$image = phutil_tag( | $image = phutil_tag( | ||||
'a', | 'a', | ||||
array( | array( | ||||
'href' => $this->uri, | 'href' => $this->uri, | ||||
▲ Show 20 Lines • Show All 65 Lines • Show Last 20 Lines |