Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F115527531
PHUIDiffTableOfContentsListView.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Jun 1, 13:55
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Jun 3, 13:55 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
26519341
Attached To
rPH Phabricator
PHUIDiffTableOfContentsListView.php
View Options
<?php
final
class
PHUIDiffTableOfContentsListView
extends
AphrontView
{
private
$items
=
array
();
public
function
addItem
(
PHUIDiffTableOfContentsItemView
$item
)
{
$this
->
items
[]
=
$item
;
return
$this
;
}
public
function
render
()
{
$this
->
requireResource
(
'differential-core-view-css'
);
$this
->
requireResource
(
'differential-table-of-contents-css'
);
$this
->
requireResource
(
'phui-text-css'
);
$items
=
$this
->
items
;
$rows
=
array
();
foreach
(
$items
as
$item
)
{
$rows
[]
=
$item
->
render
();
}
$reveal_link
=
javelin_tag
(
'a'
,
array
(
'sigil'
=>
'differential-reveal-all'
,
'mustcapture'
=>
true
,
'class'
=>
'button differential-toc-reveal-all'
,
),
pht
(
'Show All Context'
));
$buttons
=
phutil_tag
(
'div'
,
array
(
'class'
=>
'differential-toc-buttons grouped'
,
),
$reveal_link
);
$table
=
id
(
new
AphrontTableView
(
$rows
))
->
setHeaders
(
array
(
''
,
''
,
''
,
pht
(
'Path'
),
pht
(
'Coverage (All)'
),
pht
(
'Coverage (Touched)'
),
))
->
setColumnClasses
(
array
(
'differential-toc-char center'
,
'differential-toc-prop center'
,
'differential-toc-ftype center'
,
'differential-toc-file wide'
,
'differential-toc-cov'
,
'differential-toc-cov'
,
))
->
setDeviceVisibility
(
array
(
true
,
true
,
true
,
true
,
false
,
false
,
));
$anchor
=
id
(
new
PhabricatorAnchorView
())
->
setAnchorName
(
'toc'
)
->
setNavigationMarker
(
true
);
return
id
(
new
PHUIObjectBoxView
())
->
setHeaderText
(
pht
(
'Table of Contents'
))
->
setTable
(
$table
)
->
appendChild
(
$anchor
)
->
appendChild
(
$buttons
);
}
}
Event Timeline
Log In to Comment