revision = $revision;
return $this;
}
public function setActions(array $actions) {
$this->actions = $actions;
return $this;
}
public function setUser($user) {
$this->user = $user;
return $this;
}
public function setAuxiliaryFields(array $fields) {
$this->auxiliaryFields = $fields;
return $this;
}
public function render() {
require_celerity_resource('differential-core-view-css');
require_celerity_resource('differential-revision-detail-css');
$revision = $this->revision;
$rows = array();
foreach ($this->auxiliaryFields as $field) {
$value = $field->renderValueForRevisionView();
if (strlen($value)) {
$label = $field->renderLabelForRevisionView();
$rows[] =
'
'.
''.$label.' | '.
''.$value.' | '.
'
';
}
}
$properties =
''.
implode("\n", $rows).
'
';
$actions = array();
foreach ($this->actions as $action) {
$obj = new AphrontHeadsupActionView();
$obj->setName($action['name']);
$obj->setURI(idx($action, 'href'));
$obj->setWorkflow(idx($action, 'sigil') == 'workflow');
$obj->setClass(idx($action, 'class'));
$obj->setInstant(idx($action, 'instant'));
$obj->setUser($this->user);
$actions[] = $obj;
}
$action_list = new AphrontHeadsupActionListView();
$action_list->setActions($actions);
return
''.
$action_list->render().
'
'.
id(new AphrontKeyboardShortcutsAvailableView())->render().
'
'.
'
'.
'
'.
''.
phutil_escape_html('D'.$revision->getID()).
''.
' '.
phutil_escape_html($revision->getTitle()).'
'.
$properties.
''.
'
'.
'
';
}
}