Changeset View
Changeset View
Standalone View
Standalone View
src/view/phui/PHUITimelineEventView.php
Show All 19 Lines | final class PHUITimelineEventView extends AphrontView { | ||||
private $eventGroup = array(); | private $eventGroup = array(); | ||||
private $hideByDefault; | private $hideByDefault; | ||||
private $token; | private $token; | ||||
private $tokenRemoved; | private $tokenRemoved; | ||||
private $quoteTargetID; | private $quoteTargetID; | ||||
private $isNormalComment; | private $isNormalComment; | ||||
private $quoteRef; | private $quoteRef; | ||||
private $reallyMajorEvent; | private $reallyMajorEvent; | ||||
private $hideCommentOptions = false; | |||||
public function setQuoteRef($quote_ref) { | public function setQuoteRef($quote_ref) { | ||||
$this->quoteRef = $quote_ref; | $this->quoteRef = $quote_ref; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getQuoteRef() { | public function getQuoteRef() { | ||||
return $this->quoteRef; | return $this->quoteRef; | ||||
▲ Show 20 Lines • Show All 123 Lines • ▼ Show 20 Lines | public function setColor($color) { | ||||
return $this; | return $this; | ||||
} | } | ||||
public function setReallyMajorEvent($me) { | public function setReallyMajorEvent($me) { | ||||
$this->reallyMajorEvent = $me; | $this->reallyMajorEvent = $me; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function setHideCommentOptions($hide_comment_options) { | |||||
$this->hideCommentOptions = $hide_comment_options; | |||||
return $this; | |||||
} | |||||
public function getHideCommentOptions() { | |||||
return $this->hideCommentOptions; | |||||
} | |||||
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 79 Lines • ▼ Show 20 Lines | foreach ($this->getEventGroup() as $key => $event) { | ||||
} | } | ||||
} | } | ||||
$events = array_select_keys($events, $icon_keys) + $events; | $events = array_select_keys($events, $icon_keys) + $events; | ||||
$force_icon = (bool)$icon_keys; | $force_icon = (bool)$icon_keys; | ||||
$menu = null; | $menu = null; | ||||
$items = array(); | $items = array(); | ||||
$has_menu = false; | $has_menu = false; | ||||
if (!$this->getIsPreview()) { | if (!$this->getIsPreview() && !$this->getHideCommentOptions()) { | ||||
foreach ($this->getEventGroup() as $event) { | foreach ($this->getEventGroup() as $event) { | ||||
$items[] = $event->getMenuItems($this->anchor); | $items[] = $event->getMenuItems($this->anchor); | ||||
if ($event->hasChildren()) { | if ($event->hasChildren()) { | ||||
$has_menu = true; | $has_menu = true; | ||||
} | } | ||||
} | } | ||||
$items = array_mergev($items); | $items = array_mergev($items); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 345 Lines • Show Last 20 Lines |