Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F100563312
AlmanacBindingTableView.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
Fri, Jan 31, 18:46
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Feb 2, 18:46 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23992049
Attached To
rPH Phabricator
AlmanacBindingTableView.php
View Options
<?php
final
class
AlmanacBindingTableView
extends
AphrontView
{
private
$bindings
;
private
$handles
;
private
$noDataString
;
public
function
setNoDataString
(
$no_data_string
)
{
$this
->
noDataString
=
$no_data_string
;
return
$this
;
}
public
function
getNoDataString
()
{
return
$this
->
noDataString
;
}
public
function
setHandles
(
array
$handles
)
{
$this
->
handles
=
$handles
;
return
$this
;
}
public
function
getHandles
()
{
return
$this
->
handles
;
}
public
function
setBindings
(
array
$bindings
)
{
$this
->
bindings
=
$bindings
;
return
$this
;
}
public
function
getBindings
()
{
return
$this
->
bindings
;
}
public
function
render
()
{
$bindings
=
$this
->
getBindings
();
$handles
=
$this
->
getHandles
();
$viewer
=
$this
->
getUser
();
$rows
=
array
();
foreach
(
$bindings
as
$binding
)
{
$addr
=
$binding
->
getInterface
()->
getAddress
();
$port
=
$binding
->
getInterface
()->
getPort
();
$rows
[]
=
array
(
$binding
->
getID
(),
$handles
[
$binding
->
getServicePHID
()]->
renderLink
(),
$handles
[
$binding
->
getDevicePHID
()]->
renderLink
(),
$handles
[
$binding
->
getInterface
()->
getNetworkPHID
()]->
renderLink
(),
$binding
->
getInterface
()->
renderDisplayAddress
(),
phutil_tag
(
'a'
,
array
(
'class'
=>
'small grey button'
,
'href'
=>
'/almanac/binding/'
.
$binding
->
getID
().
'/'
,
),
pht
(
'Details'
)),
);
}
$table
=
id
(
new
AphrontTableView
(
$rows
))
->
setNoDataString
(
$this
->
getNoDataString
())
->
setHeaders
(
array
(
pht
(
'ID'
),
pht
(
'Service'
),
pht
(
'Device'
),
pht
(
'Network'
),
pht
(
'Interface'
),
null
,
))
->
setColumnClasses
(
array
(
''
,
''
,
''
,
''
,
'wide'
,
'action'
,
));
return
$table
;
}
}
Event Timeline
Log In to Comment