1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-15 03:12:41 +01:00
phorge-phorge/src/view/layout/PhabricatorTimelineView.php

49 lines
1,012 B
PHP
Raw Normal View History

<?php
final class PhabricatorTimelineView extends AphrontView {
private $events = array();
private $id;
public function setID($id) {
$this->id = $id;
return $this;
}
public function addEvent(PhabricatorTimelineEventView $event) {
$this->events[] = $event;
return $this;
}
public function render() {
require_celerity_resource('phabricator-timeline-view-css');
$spacer = self::renderSpacer();
$events = array();
foreach ($this->events as $event) {
$events[] = $spacer;
$events[] = $this->renderSingleView($event);
}
$events[] = $spacer;
return phutil_render_tag(
'div',
array(
'class' => 'phabricator-timeline-view',
'id' => $this->id,
),
implode('', $events));
}
public static function renderSpacer() {
return phutil_render_tag(
'div',
array(
'class' => 'phabricator-timeline-event-view '.
'phabricator-timeline-spacer',
),
'');
}
}