forked from phacility/phabricator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPHUIDiffInlineCommentRowScaffold.php
48 lines (39 loc) · 1.03 KB
/
PHUIDiffInlineCommentRowScaffold.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/**
* Wraps an inline comment in a table row.
*
* Inline comments need different wrapping cells when shown in unified vs
* side-by-side diffs, as the two tables have different layouts. This wraps
* an inline comment element in an appropriate table row.
*/
abstract class PHUIDiffInlineCommentRowScaffold extends AphrontView {
private $views = array();
public function getInlineViews() {
return $this->views;
}
public function addInlineView(PHUIDiffInlineCommentView $view) {
$this->views[] = $view;
return $this;
}
protected function getRowAttributes() {
$is_hidden = false;
foreach ($this->getInlineViews() as $view) {
if ($view->isHidden()) {
$is_hidden = true;
}
}
$classes = array();
$classes[] = 'inline';
if ($is_hidden) {
$classes[] = 'inline-hidden';
}
$result = array(
'class' => implode(' ', $classes),
'sigil' => 'inline-row',
'meta' => array(
'hidden' => $is_hidden,
),
);
return $result;
}
}