Changeset View
Changeset View
Standalone View
Standalone View
src/view/phui/PHUITimelineEventView.php
| Show All 22 Lines | final class PHUITimelineEventView extends AphrontView { | ||||
| private $tokenRemoved; | private $tokenRemoved; | ||||
| private $quoteTargetID; | private $quoteTargetID; | ||||
| private $isNormalComment; | private $isNormalComment; | ||||
| private $quoteRef; | private $quoteRef; | ||||
| private $reallyMajorEvent; | private $reallyMajorEvent; | ||||
| private $hideCommentOptions = false; | private $hideCommentOptions = false; | ||||
| private $authorPHID; | private $authorPHID; | ||||
| private $badges = array(); | private $badges = array(); | ||||
| private $pinboardItems = array(); | |||||
| public function setAuthorPHID($author_phid) { | public function setAuthorPHID($author_phid) { | ||||
| $this->authorPHID = $author_phid; | $this->authorPHID = $author_phid; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getAuthorPHID() { | public function getAuthorPHID() { | ||||
| return $this->authorPHID; | return $this->authorPHID; | ||||
| ▲ Show 20 Lines • Show All 146 Lines • ▼ Show 20 Lines | public function setHideCommentOptions($hide_comment_options) { | ||||
| $this->hideCommentOptions = $hide_comment_options; | $this->hideCommentOptions = $hide_comment_options; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getHideCommentOptions() { | public function getHideCommentOptions() { | ||||
| return $this->hideCommentOptions; | return $this->hideCommentOptions; | ||||
| } | } | ||||
| public function addPinboardItem(PHUIPinboardItemView $item) { | |||||
| $this->pinboardItems[] = $item; | |||||
| return $this; | |||||
| } | |||||
| public function setToken($token, $removed = false) { | public function setToken($token, $removed = false) { | ||||
| $this->token = $token; | $this->token = $token; | ||||
| $this->tokenRemoved = $removed; | $this->tokenRemoved = $removed; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getEventGroup() { | public function getEventGroup() { | ||||
| return array_merge(array($this), $this->eventGroup); | return array_merge(array($this), $this->eventGroup); | ||||
| ▲ Show 20 Lines • Show All 235 Lines • ▼ Show 20 Lines | public function render() { | ||||
| $content = phutil_tag( | $content = phutil_tag( | ||||
| 'div', | 'div', | ||||
| array( | array( | ||||
| 'class' => 'phui-timeline-group phui-timeline-border', | 'class' => 'phui-timeline-group phui-timeline-border', | ||||
| ), | ), | ||||
| $content); | $content); | ||||
| // Image Events | |||||
| $pinboard = null; | |||||
| if ($this->pinboardItems) { | |||||
| $pinboard = new PHUIPinboardView(); | |||||
| foreach ($this->pinboardItems as $item) { | |||||
| $pinboard->addItem($item); | |||||
| } | |||||
| } | |||||
| $content = phutil_tag( | $content = phutil_tag( | ||||
| 'div', | 'div', | ||||
| array( | array( | ||||
| 'class' => implode(' ', $content_classes), | 'class' => implode(' ', $content_classes), | ||||
| ), | ), | ||||
| array($image, $badges, $wedge, $content)); | array($image, $badges, $wedge, $content, $pinboard)); | ||||
| $outer_classes = $this->classes; | $outer_classes = $this->classes; | ||||
| $outer_classes[] = 'phui-timeline-shell'; | $outer_classes[] = 'phui-timeline-shell'; | ||||
| $color = null; | $color = null; | ||||
| foreach ($this->getEventGroup() as $event) { | foreach ($this->getEventGroup() as $event) { | ||||
| if ($event->color) { | if ($event->color) { | ||||
| $color = $event->color; | $color = $event->color; | ||||
| break; | break; | ||||
| ▲ Show 20 Lines • Show All 220 Lines • Show Last 20 Lines | |||||