Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/infrastructure/diff/view/PHUIDiffOneUpInlineCommentRowScaffold.php
12242 views
1
<?php
2
3
/**
4
* Row scaffold for `1up` (unified) changeset views.
5
*
6
* This scaffold is straightforward.
7
*/
8
final class PHUIDiffOneUpInlineCommentRowScaffold
9
extends PHUIDiffInlineCommentRowScaffold {
10
11
public function render() {
12
$inlines = $this->getInlineViews();
13
if (count($inlines) != 1) {
14
throw new Exception(
15
pht('One-up inline row scaffold must have exactly one inline view!'));
16
}
17
$inline = head($inlines);
18
19
$attrs = array(
20
'colspan' => 2,
21
'id' => $inline->getScaffoldCellID(),
22
);
23
24
if ($inline->getIsOnRight()) {
25
$left_hidden = null;
26
$right_hidden = $inline->newHiddenIcon();
27
} else {
28
$left_hidden = $inline->newHiddenIcon();
29
$right_hidden = null;
30
}
31
32
$cells = array(
33
phutil_tag('td', array('class' => 'n'), $left_hidden),
34
phutil_tag('td', array('class' => 'n'), $right_hidden),
35
phutil_tag('td', array('class' => 'copy')),
36
phutil_tag('td', $attrs, $inline),
37
);
38
39
return javelin_tag('tr', $this->getRowAttributes(), $cells);
40
}
41
42
}
43
44