Changeset View
Changeset View
Standalone View
Standalone View
src/view/phui/PHUITimelineView.php
<?php | <?php | ||||
final class PHUITimelineView extends AphrontView { | final class PHUITimelineView extends AphrontView { | ||||
private $events = array(); | private $events = array(); | ||||
private $id; | private $id; | ||||
private $shouldTerminate = false; | private $shouldTerminate = false; | ||||
private $shouldAddSpacers = true; | private $shouldAddSpacers = true; | ||||
private $pager; | private $pager; | ||||
private $renderData = array(); | private $viewData = array(); | ||||
private $quoteTargetID; | private $quoteTargetID; | ||||
private $quoteRef; | private $quoteRef; | ||||
public function setID($id) { | public function setID($id) { | ||||
$this->id = $id; | $this->id = $id; | ||||
return $this; | return $this; | ||||
} | } | ||||
Show All 16 Lines | public function getPager() { | ||||
return $this->pager; | return $this->pager; | ||||
} | } | ||||
public function addEvent(PHUITimelineEventView $event) { | public function addEvent(PHUITimelineEventView $event) { | ||||
$this->events[] = $event; | $this->events[] = $event; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function setRenderData(array $data) { | public function setViewData(array $data) { | ||||
$this->renderData = $data; | $this->viewData = $data; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getViewData() { | |||||
return $this->viewData; | |||||
} | |||||
public function setQuoteTargetID($quote_target_id) { | public function setQuoteTargetID($quote_target_id) { | ||||
$this->quoteTargetID = $quote_target_id; | $this->quoteTargetID = $quote_target_id; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getQuoteTargetID() { | public function getQuoteTargetID() { | ||||
return $this->quoteTargetID; | return $this->quoteTargetID; | ||||
} | } | ||||
Show All 11 Lines | public function render() { | ||||
if ($this->getPager()) { | if ($this->getPager()) { | ||||
if ($this->id === null) { | if ($this->id === null) { | ||||
$this->id = celerity_generate_unique_node_id(); | $this->id = celerity_generate_unique_node_id(); | ||||
} | } | ||||
Javelin::initBehavior( | Javelin::initBehavior( | ||||
'phabricator-show-older-transactions', | 'phabricator-show-older-transactions', | ||||
array( | array( | ||||
'timelineID' => $this->id, | 'timelineID' => $this->id, | ||||
'renderData' => $this->renderData, | 'viewData' => $this->getViewData(), | ||||
)); | )); | ||||
} | } | ||||
$events = $this->buildEvents(); | $events = $this->buildEvents(); | ||||
return phutil_tag( | return phutil_tag( | ||||
'div', | 'div', | ||||
array( | array( | ||||
'class' => 'phui-timeline-view', | 'class' => 'phui-timeline-view', | ||||
▲ Show 20 Lines • Show All 196 Lines • Show Last 20 Lines |