Changeset View
Changeset View
Standalone View
Standalone View
src/view/phui/PHUIFeedStoryView.php
Show All 10 Lines | final class PHUIFeedStoryView extends AphrontView { | ||||
private $viewed; | private $viewed; | ||||
private $href; | private $href; | ||||
private $pontification = null; | private $pontification = null; | ||||
private $tokenBar = array(); | private $tokenBar = array(); | ||||
private $projects = array(); | private $projects = array(); | ||||
private $actions = array(); | private $actions = array(); | ||||
private $chronologicalKey; | private $chronologicalKey; | ||||
private $tags; | private $tags; | ||||
private $authorIcon; | |||||
public function setTags($tags) { | public function setTags($tags) { | ||||
$this->tags = $tags; | $this->tags = $tags; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getTags() { | public function getTags() { | ||||
return $this->tags; | return $this->tags; | ||||
▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | public function getViewed() { | ||||
return $this->viewed; | return $this->viewed; | ||||
} | } | ||||
public function setHref($href) { | public function setHref($href) { | ||||
$this->href = $href; | $this->href = $href; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function setAuthorIcon($author_icon) { | |||||
$this->authorIcon = $author_icon; | |||||
return $this; | |||||
} | |||||
public function getAuthorIcon() { | |||||
return $this->authorIcon; | |||||
} | |||||
public function setTokenBar(array $tokens) { | public function setTokenBar(array $tokens) { | ||||
$this->tokenBar = $tokens; | $this->tokenBar = $tokens; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function addProject($project) { | public function addProject($project) { | ||||
$this->projects[] = $project; | $this->projects[] = $project; | ||||
return $this; | return $this; | ||||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | public function render() { | ||||
require_celerity_resource('phui-feed-story-css'); | require_celerity_resource('phui-feed-story-css'); | ||||
Javelin::initBehavior('phui-hovercards'); | Javelin::initBehavior('phui-hovercards'); | ||||
$body = null; | $body = null; | ||||
$foot = null; | $foot = null; | ||||
$actor = new PHUIIconView(); | $actor = new PHUIIconView(); | ||||
$actor->setImage($this->image); | $actor->addClass('phui-feed-story-actor'); | ||||
$author_icon = $this->getAuthorIcon(); | |||||
if ($this->image) { | |||||
$actor->addClass('phui-feed-story-actor-image'); | $actor->addClass('phui-feed-story-actor-image'); | ||||
$actor->setImage($this->image); | |||||
} else if ($author_icon) { | |||||
$actor->addClass('phui-feed-story-actor-icon'); | |||||
$actor->setIcon($author_icon); | |||||
} | |||||
if ($this->imageHref) { | if ($this->imageHref) { | ||||
$actor->setHref($this->imageHref); | $actor->setHref($this->imageHref); | ||||
} | } | ||||
if ($this->epoch) { | if ($this->epoch) { | ||||
// TODO: This is really bad; when rendering through Conduit and via | // TODO: This is really bad; when rendering through Conduit and via | ||||
// renderText() we don't have a user. | // renderText() we don't have a user. | ||||
if ($this->hasViewer()) { | if ($this->hasViewer()) { | ||||
▲ Show 20 Lines • Show All 102 Lines • Show Last 20 Lines |